@vueup_vue-quill.js 640 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191
  1. import {
  2. __commonJS,
  3. __toESM,
  4. defineComponent,
  5. h,
  6. nextTick,
  7. onBeforeUnmount,
  8. onMounted,
  9. ref,
  10. watch
  11. } from "./chunk-GFV24RRW.js";
  12. // node_modules/@vueup/vue-quill/node_modules/quill/dist/quill.js
  13. var require_quill = __commonJS({
  14. "node_modules/@vueup/vue-quill/node_modules/quill/dist/quill.js"(exports, module) {
  15. (function webpackUniversalModuleDefinition(root, factory) {
  16. if (typeof exports === "object" && typeof module === "object")
  17. module.exports = factory();
  18. else if (typeof define === "function" && define.amd)
  19. define([], factory);
  20. else if (typeof exports === "object")
  21. exports["Quill"] = factory();
  22. else
  23. root["Quill"] = factory();
  24. })(typeof self !== "undefined" ? self : exports, function() {
  25. return (
  26. /******/
  27. (function(modules) {
  28. var installedModules = {};
  29. function __webpack_require__(moduleId) {
  30. if (installedModules[moduleId]) {
  31. return installedModules[moduleId].exports;
  32. }
  33. var module2 = installedModules[moduleId] = {
  34. /******/
  35. i: moduleId,
  36. /******/
  37. l: false,
  38. /******/
  39. exports: {}
  40. /******/
  41. };
  42. modules[moduleId].call(module2.exports, module2, module2.exports, __webpack_require__);
  43. module2.l = true;
  44. return module2.exports;
  45. }
  46. __webpack_require__.m = modules;
  47. __webpack_require__.c = installedModules;
  48. __webpack_require__.d = function(exports2, name, getter) {
  49. if (!__webpack_require__.o(exports2, name)) {
  50. Object.defineProperty(exports2, name, {
  51. /******/
  52. configurable: false,
  53. /******/
  54. enumerable: true,
  55. /******/
  56. get: getter
  57. /******/
  58. });
  59. }
  60. };
  61. __webpack_require__.n = function(module2) {
  62. var getter = module2 && module2.__esModule ? (
  63. /******/
  64. function getDefault() {
  65. return module2["default"];
  66. }
  67. ) : (
  68. /******/
  69. function getModuleExports() {
  70. return module2;
  71. }
  72. );
  73. __webpack_require__.d(getter, "a", getter);
  74. return getter;
  75. };
  76. __webpack_require__.o = function(object, property) {
  77. return Object.prototype.hasOwnProperty.call(object, property);
  78. };
  79. __webpack_require__.p = "";
  80. return __webpack_require__(__webpack_require__.s = 109);
  81. })([
  82. /* 0 */
  83. /***/
  84. (function(module2, exports2, __webpack_require__) {
  85. "use strict";
  86. Object.defineProperty(exports2, "__esModule", { value: true });
  87. var container_1 = __webpack_require__(17);
  88. var format_1 = __webpack_require__(18);
  89. var leaf_1 = __webpack_require__(19);
  90. var scroll_1 = __webpack_require__(45);
  91. var inline_1 = __webpack_require__(46);
  92. var block_1 = __webpack_require__(47);
  93. var embed_1 = __webpack_require__(48);
  94. var text_1 = __webpack_require__(49);
  95. var attributor_1 = __webpack_require__(12);
  96. var class_1 = __webpack_require__(32);
  97. var style_1 = __webpack_require__(33);
  98. var store_1 = __webpack_require__(31);
  99. var Registry = __webpack_require__(1);
  100. var Parchment = {
  101. Scope: Registry.Scope,
  102. create: Registry.create,
  103. find: Registry.find,
  104. query: Registry.query,
  105. register: Registry.register,
  106. Container: container_1.default,
  107. Format: format_1.default,
  108. Leaf: leaf_1.default,
  109. Embed: embed_1.default,
  110. Scroll: scroll_1.default,
  111. Block: block_1.default,
  112. Inline: inline_1.default,
  113. Text: text_1.default,
  114. Attributor: {
  115. Attribute: attributor_1.default,
  116. Class: class_1.default,
  117. Style: style_1.default,
  118. Store: store_1.default
  119. }
  120. };
  121. exports2.default = Parchment;
  122. }),
  123. /* 1 */
  124. /***/
  125. (function(module2, exports2, __webpack_require__) {
  126. "use strict";
  127. var __extends = this && this.__extends || (function() {
  128. var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
  129. d.__proto__ = b;
  130. } || function(d, b) {
  131. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  132. };
  133. return function(d, b) {
  134. extendStatics(d, b);
  135. function __() {
  136. this.constructor = d;
  137. }
  138. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  139. };
  140. })();
  141. Object.defineProperty(exports2, "__esModule", { value: true });
  142. var ParchmentError = (
  143. /** @class */
  144. (function(_super) {
  145. __extends(ParchmentError2, _super);
  146. function ParchmentError2(message) {
  147. var _this = this;
  148. message = "[Parchment] " + message;
  149. _this = _super.call(this, message) || this;
  150. _this.message = message;
  151. _this.name = _this.constructor.name;
  152. return _this;
  153. }
  154. return ParchmentError2;
  155. })(Error)
  156. );
  157. exports2.ParchmentError = ParchmentError;
  158. var attributes = {};
  159. var classes = {};
  160. var tags = {};
  161. var types = {};
  162. exports2.DATA_KEY = "__blot";
  163. var Scope;
  164. (function(Scope2) {
  165. Scope2[Scope2["TYPE"] = 3] = "TYPE";
  166. Scope2[Scope2["LEVEL"] = 12] = "LEVEL";
  167. Scope2[Scope2["ATTRIBUTE"] = 13] = "ATTRIBUTE";
  168. Scope2[Scope2["BLOT"] = 14] = "BLOT";
  169. Scope2[Scope2["INLINE"] = 7] = "INLINE";
  170. Scope2[Scope2["BLOCK"] = 11] = "BLOCK";
  171. Scope2[Scope2["BLOCK_BLOT"] = 10] = "BLOCK_BLOT";
  172. Scope2[Scope2["INLINE_BLOT"] = 6] = "INLINE_BLOT";
  173. Scope2[Scope2["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE";
  174. Scope2[Scope2["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE";
  175. Scope2[Scope2["ANY"] = 15] = "ANY";
  176. })(Scope = exports2.Scope || (exports2.Scope = {}));
  177. function create(input, value) {
  178. var match = query(input);
  179. if (match == null) {
  180. throw new ParchmentError("Unable to create " + input + " blot");
  181. }
  182. var BlotClass = match;
  183. var node = (
  184. // @ts-ignore
  185. input instanceof Node || input["nodeType"] === Node.TEXT_NODE ? input : BlotClass.create(value)
  186. );
  187. return new BlotClass(node, value);
  188. }
  189. exports2.create = create;
  190. function find(node, bubble) {
  191. if (bubble === void 0) {
  192. bubble = false;
  193. }
  194. if (node == null)
  195. return null;
  196. if (node[exports2.DATA_KEY] != null)
  197. return node[exports2.DATA_KEY].blot;
  198. if (bubble)
  199. return find(node.parentNode, bubble);
  200. return null;
  201. }
  202. exports2.find = find;
  203. function query(query2, scope) {
  204. if (scope === void 0) {
  205. scope = Scope.ANY;
  206. }
  207. var match;
  208. if (typeof query2 === "string") {
  209. match = types[query2] || attributes[query2];
  210. } else if (query2 instanceof Text || query2["nodeType"] === Node.TEXT_NODE) {
  211. match = types["text"];
  212. } else if (typeof query2 === "number") {
  213. if (query2 & Scope.LEVEL & Scope.BLOCK) {
  214. match = types["block"];
  215. } else if (query2 & Scope.LEVEL & Scope.INLINE) {
  216. match = types["inline"];
  217. }
  218. } else if (query2 instanceof HTMLElement) {
  219. var names = (query2.getAttribute("class") || "").split(/\s+/);
  220. for (var i in names) {
  221. match = classes[names[i]];
  222. if (match)
  223. break;
  224. }
  225. match = match || tags[query2.tagName];
  226. }
  227. if (match == null)
  228. return null;
  229. if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope)
  230. return match;
  231. return null;
  232. }
  233. exports2.query = query;
  234. function register() {
  235. var Definitions = [];
  236. for (var _i = 0; _i < arguments.length; _i++) {
  237. Definitions[_i] = arguments[_i];
  238. }
  239. if (Definitions.length > 1) {
  240. return Definitions.map(function(d) {
  241. return register(d);
  242. });
  243. }
  244. var Definition = Definitions[0];
  245. if (typeof Definition.blotName !== "string" && typeof Definition.attrName !== "string") {
  246. throw new ParchmentError("Invalid definition");
  247. } else if (Definition.blotName === "abstract") {
  248. throw new ParchmentError("Cannot register abstract class");
  249. }
  250. types[Definition.blotName || Definition.attrName] = Definition;
  251. if (typeof Definition.keyName === "string") {
  252. attributes[Definition.keyName] = Definition;
  253. } else {
  254. if (Definition.className != null) {
  255. classes[Definition.className] = Definition;
  256. }
  257. if (Definition.tagName != null) {
  258. if (Array.isArray(Definition.tagName)) {
  259. Definition.tagName = Definition.tagName.map(function(tagName) {
  260. return tagName.toUpperCase();
  261. });
  262. } else {
  263. Definition.tagName = Definition.tagName.toUpperCase();
  264. }
  265. var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName];
  266. tagNames.forEach(function(tag) {
  267. if (tags[tag] == null || Definition.className == null) {
  268. tags[tag] = Definition;
  269. }
  270. });
  271. }
  272. }
  273. return Definition;
  274. }
  275. exports2.register = register;
  276. }),
  277. /* 2 */
  278. /***/
  279. (function(module2, exports2, __webpack_require__) {
  280. var diff = __webpack_require__(51);
  281. var equal = __webpack_require__(11);
  282. var extend = __webpack_require__(3);
  283. var op = __webpack_require__(20);
  284. var NULL_CHARACTER = String.fromCharCode(0);
  285. var Delta2 = function(ops) {
  286. if (Array.isArray(ops)) {
  287. this.ops = ops;
  288. } else if (ops != null && Array.isArray(ops.ops)) {
  289. this.ops = ops.ops;
  290. } else {
  291. this.ops = [];
  292. }
  293. };
  294. Delta2.prototype.insert = function(text, attributes) {
  295. var newOp = {};
  296. if (text.length === 0) return this;
  297. newOp.insert = text;
  298. if (attributes != null && typeof attributes === "object" && Object.keys(attributes).length > 0) {
  299. newOp.attributes = attributes;
  300. }
  301. return this.push(newOp);
  302. };
  303. Delta2.prototype["delete"] = function(length) {
  304. if (length <= 0) return this;
  305. return this.push({ "delete": length });
  306. };
  307. Delta2.prototype.retain = function(length, attributes) {
  308. if (length <= 0) return this;
  309. var newOp = { retain: length };
  310. if (attributes != null && typeof attributes === "object" && Object.keys(attributes).length > 0) {
  311. newOp.attributes = attributes;
  312. }
  313. return this.push(newOp);
  314. };
  315. Delta2.prototype.push = function(newOp) {
  316. var index = this.ops.length;
  317. var lastOp = this.ops[index - 1];
  318. newOp = extend(true, {}, newOp);
  319. if (typeof lastOp === "object") {
  320. if (typeof newOp["delete"] === "number" && typeof lastOp["delete"] === "number") {
  321. this.ops[index - 1] = { "delete": lastOp["delete"] + newOp["delete"] };
  322. return this;
  323. }
  324. if (typeof lastOp["delete"] === "number" && newOp.insert != null) {
  325. index -= 1;
  326. lastOp = this.ops[index - 1];
  327. if (typeof lastOp !== "object") {
  328. this.ops.unshift(newOp);
  329. return this;
  330. }
  331. }
  332. if (equal(newOp.attributes, lastOp.attributes)) {
  333. if (typeof newOp.insert === "string" && typeof lastOp.insert === "string") {
  334. this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };
  335. if (typeof newOp.attributes === "object") this.ops[index - 1].attributes = newOp.attributes;
  336. return this;
  337. } else if (typeof newOp.retain === "number" && typeof lastOp.retain === "number") {
  338. this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };
  339. if (typeof newOp.attributes === "object") this.ops[index - 1].attributes = newOp.attributes;
  340. return this;
  341. }
  342. }
  343. }
  344. if (index === this.ops.length) {
  345. this.ops.push(newOp);
  346. } else {
  347. this.ops.splice(index, 0, newOp);
  348. }
  349. return this;
  350. };
  351. Delta2.prototype.chop = function() {
  352. var lastOp = this.ops[this.ops.length - 1];
  353. if (lastOp && lastOp.retain && !lastOp.attributes) {
  354. this.ops.pop();
  355. }
  356. return this;
  357. };
  358. Delta2.prototype.filter = function(predicate) {
  359. return this.ops.filter(predicate);
  360. };
  361. Delta2.prototype.forEach = function(predicate) {
  362. this.ops.forEach(predicate);
  363. };
  364. Delta2.prototype.map = function(predicate) {
  365. return this.ops.map(predicate);
  366. };
  367. Delta2.prototype.partition = function(predicate) {
  368. var passed = [], failed = [];
  369. this.forEach(function(op2) {
  370. var target = predicate(op2) ? passed : failed;
  371. target.push(op2);
  372. });
  373. return [passed, failed];
  374. };
  375. Delta2.prototype.reduce = function(predicate, initial) {
  376. return this.ops.reduce(predicate, initial);
  377. };
  378. Delta2.prototype.changeLength = function() {
  379. return this.reduce(function(length, elem) {
  380. if (elem.insert) {
  381. return length + op.length(elem);
  382. } else if (elem.delete) {
  383. return length - elem.delete;
  384. }
  385. return length;
  386. }, 0);
  387. };
  388. Delta2.prototype.length = function() {
  389. return this.reduce(function(length, elem) {
  390. return length + op.length(elem);
  391. }, 0);
  392. };
  393. Delta2.prototype.slice = function(start, end) {
  394. start = start || 0;
  395. if (typeof end !== "number") end = Infinity;
  396. var ops = [];
  397. var iter = op.iterator(this.ops);
  398. var index = 0;
  399. while (index < end && iter.hasNext()) {
  400. var nextOp;
  401. if (index < start) {
  402. nextOp = iter.next(start - index);
  403. } else {
  404. nextOp = iter.next(end - index);
  405. ops.push(nextOp);
  406. }
  407. index += op.length(nextOp);
  408. }
  409. return new Delta2(ops);
  410. };
  411. Delta2.prototype.compose = function(other) {
  412. var thisIter = op.iterator(this.ops);
  413. var otherIter = op.iterator(other.ops);
  414. var ops = [];
  415. var firstOther = otherIter.peek();
  416. if (firstOther != null && typeof firstOther.retain === "number" && firstOther.attributes == null) {
  417. var firstLeft = firstOther.retain;
  418. while (thisIter.peekType() === "insert" && thisIter.peekLength() <= firstLeft) {
  419. firstLeft -= thisIter.peekLength();
  420. ops.push(thisIter.next());
  421. }
  422. if (firstOther.retain - firstLeft > 0) {
  423. otherIter.next(firstOther.retain - firstLeft);
  424. }
  425. }
  426. var delta = new Delta2(ops);
  427. while (thisIter.hasNext() || otherIter.hasNext()) {
  428. if (otherIter.peekType() === "insert") {
  429. delta.push(otherIter.next());
  430. } else if (thisIter.peekType() === "delete") {
  431. delta.push(thisIter.next());
  432. } else {
  433. var length = Math.min(thisIter.peekLength(), otherIter.peekLength());
  434. var thisOp = thisIter.next(length);
  435. var otherOp = otherIter.next(length);
  436. if (typeof otherOp.retain === "number") {
  437. var newOp = {};
  438. if (typeof thisOp.retain === "number") {
  439. newOp.retain = length;
  440. } else {
  441. newOp.insert = thisOp.insert;
  442. }
  443. var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === "number");
  444. if (attributes) newOp.attributes = attributes;
  445. delta.push(newOp);
  446. if (!otherIter.hasNext() && equal(delta.ops[delta.ops.length - 1], newOp)) {
  447. var rest = new Delta2(thisIter.rest());
  448. return delta.concat(rest).chop();
  449. }
  450. } else if (typeof otherOp["delete"] === "number" && typeof thisOp.retain === "number") {
  451. delta.push(otherOp);
  452. }
  453. }
  454. }
  455. return delta.chop();
  456. };
  457. Delta2.prototype.concat = function(other) {
  458. var delta = new Delta2(this.ops.slice());
  459. if (other.ops.length > 0) {
  460. delta.push(other.ops[0]);
  461. delta.ops = delta.ops.concat(other.ops.slice(1));
  462. }
  463. return delta;
  464. };
  465. Delta2.prototype.diff = function(other, index) {
  466. if (this.ops === other.ops) {
  467. return new Delta2();
  468. }
  469. var strings = [this, other].map(function(delta2) {
  470. return delta2.map(function(op2) {
  471. if (op2.insert != null) {
  472. return typeof op2.insert === "string" ? op2.insert : NULL_CHARACTER;
  473. }
  474. var prep = delta2 === other ? "on" : "with";
  475. throw new Error("diff() called " + prep + " non-document");
  476. }).join("");
  477. });
  478. var delta = new Delta2();
  479. var diffResult = diff(strings[0], strings[1], index);
  480. var thisIter = op.iterator(this.ops);
  481. var otherIter = op.iterator(other.ops);
  482. diffResult.forEach(function(component) {
  483. var length = component[1].length;
  484. while (length > 0) {
  485. var opLength = 0;
  486. switch (component[0]) {
  487. case diff.INSERT:
  488. opLength = Math.min(otherIter.peekLength(), length);
  489. delta.push(otherIter.next(opLength));
  490. break;
  491. case diff.DELETE:
  492. opLength = Math.min(length, thisIter.peekLength());
  493. thisIter.next(opLength);
  494. delta["delete"](opLength);
  495. break;
  496. case diff.EQUAL:
  497. opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);
  498. var thisOp = thisIter.next(opLength);
  499. var otherOp = otherIter.next(opLength);
  500. if (equal(thisOp.insert, otherOp.insert)) {
  501. delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes));
  502. } else {
  503. delta.push(otherOp)["delete"](opLength);
  504. }
  505. break;
  506. }
  507. length -= opLength;
  508. }
  509. });
  510. return delta.chop();
  511. };
  512. Delta2.prototype.eachLine = function(predicate, newline) {
  513. newline = newline || "\n";
  514. var iter = op.iterator(this.ops);
  515. var line = new Delta2();
  516. var i = 0;
  517. while (iter.hasNext()) {
  518. if (iter.peekType() !== "insert") return;
  519. var thisOp = iter.peek();
  520. var start = op.length(thisOp) - iter.peekLength();
  521. var index = typeof thisOp.insert === "string" ? thisOp.insert.indexOf(newline, start) - start : -1;
  522. if (index < 0) {
  523. line.push(iter.next());
  524. } else if (index > 0) {
  525. line.push(iter.next(index));
  526. } else {
  527. if (predicate(line, iter.next(1).attributes || {}, i) === false) {
  528. return;
  529. }
  530. i += 1;
  531. line = new Delta2();
  532. }
  533. }
  534. if (line.length() > 0) {
  535. predicate(line, {}, i);
  536. }
  537. };
  538. Delta2.prototype.transform = function(other, priority) {
  539. priority = !!priority;
  540. if (typeof other === "number") {
  541. return this.transformPosition(other, priority);
  542. }
  543. var thisIter = op.iterator(this.ops);
  544. var otherIter = op.iterator(other.ops);
  545. var delta = new Delta2();
  546. while (thisIter.hasNext() || otherIter.hasNext()) {
  547. if (thisIter.peekType() === "insert" && (priority || otherIter.peekType() !== "insert")) {
  548. delta.retain(op.length(thisIter.next()));
  549. } else if (otherIter.peekType() === "insert") {
  550. delta.push(otherIter.next());
  551. } else {
  552. var length = Math.min(thisIter.peekLength(), otherIter.peekLength());
  553. var thisOp = thisIter.next(length);
  554. var otherOp = otherIter.next(length);
  555. if (thisOp["delete"]) {
  556. continue;
  557. } else if (otherOp["delete"]) {
  558. delta.push(otherOp);
  559. } else {
  560. delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority));
  561. }
  562. }
  563. }
  564. return delta.chop();
  565. };
  566. Delta2.prototype.transformPosition = function(index, priority) {
  567. priority = !!priority;
  568. var thisIter = op.iterator(this.ops);
  569. var offset = 0;
  570. while (thisIter.hasNext() && offset <= index) {
  571. var length = thisIter.peekLength();
  572. var nextType = thisIter.peekType();
  573. thisIter.next();
  574. if (nextType === "delete") {
  575. index -= Math.min(length, index - offset);
  576. continue;
  577. } else if (nextType === "insert" && (offset < index || !priority)) {
  578. index += length;
  579. }
  580. offset += length;
  581. }
  582. return index;
  583. };
  584. module2.exports = Delta2;
  585. }),
  586. /* 3 */
  587. /***/
  588. (function(module2, exports2) {
  589. "use strict";
  590. var hasOwn = Object.prototype.hasOwnProperty;
  591. var toStr = Object.prototype.toString;
  592. var defineProperty = Object.defineProperty;
  593. var gOPD = Object.getOwnPropertyDescriptor;
  594. var isArray = function isArray2(arr) {
  595. if (typeof Array.isArray === "function") {
  596. return Array.isArray(arr);
  597. }
  598. return toStr.call(arr) === "[object Array]";
  599. };
  600. var isPlainObject = function isPlainObject2(obj) {
  601. if (!obj || toStr.call(obj) !== "[object Object]") {
  602. return false;
  603. }
  604. var hasOwnConstructor = hasOwn.call(obj, "constructor");
  605. var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, "isPrototypeOf");
  606. if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
  607. return false;
  608. }
  609. var key;
  610. for (key in obj) {
  611. }
  612. return typeof key === "undefined" || hasOwn.call(obj, key);
  613. };
  614. var setProperty = function setProperty2(target, options) {
  615. if (defineProperty && options.name === "__proto__") {
  616. defineProperty(target, options.name, {
  617. enumerable: true,
  618. configurable: true,
  619. value: options.newValue,
  620. writable: true
  621. });
  622. } else {
  623. target[options.name] = options.newValue;
  624. }
  625. };
  626. var getProperty = function getProperty2(obj, name) {
  627. if (name === "__proto__") {
  628. if (!hasOwn.call(obj, name)) {
  629. return void 0;
  630. } else if (gOPD) {
  631. return gOPD(obj, name).value;
  632. }
  633. }
  634. return obj[name];
  635. };
  636. module2.exports = function extend() {
  637. var options, name, src, copy, copyIsArray, clone;
  638. var target = arguments[0];
  639. var i = 1;
  640. var length = arguments.length;
  641. var deep = false;
  642. if (typeof target === "boolean") {
  643. deep = target;
  644. target = arguments[1] || {};
  645. i = 2;
  646. }
  647. if (target == null || typeof target !== "object" && typeof target !== "function") {
  648. target = {};
  649. }
  650. for (; i < length; ++i) {
  651. options = arguments[i];
  652. if (options != null) {
  653. for (name in options) {
  654. src = getProperty(target, name);
  655. copy = getProperty(options, name);
  656. if (target !== copy) {
  657. if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
  658. if (copyIsArray) {
  659. copyIsArray = false;
  660. clone = src && isArray(src) ? src : [];
  661. } else {
  662. clone = src && isPlainObject(src) ? src : {};
  663. }
  664. setProperty(target, { name, newValue: extend(deep, clone, copy) });
  665. } else if (typeof copy !== "undefined") {
  666. setProperty(target, { name, newValue: copy });
  667. }
  668. }
  669. }
  670. }
  671. }
  672. return target;
  673. };
  674. }),
  675. /* 4 */
  676. /***/
  677. (function(module2, exports2, __webpack_require__) {
  678. "use strict";
  679. Object.defineProperty(exports2, "__esModule", {
  680. value: true
  681. });
  682. exports2.default = exports2.BlockEmbed = exports2.bubbleFormats = void 0;
  683. var _createClass = /* @__PURE__ */ (function() {
  684. function defineProperties(target, props) {
  685. for (var i = 0; i < props.length; i++) {
  686. var descriptor = props[i];
  687. descriptor.enumerable = descriptor.enumerable || false;
  688. descriptor.configurable = true;
  689. if ("value" in descriptor) descriptor.writable = true;
  690. Object.defineProperty(target, descriptor.key, descriptor);
  691. }
  692. }
  693. return function(Constructor, protoProps, staticProps) {
  694. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  695. if (staticProps) defineProperties(Constructor, staticProps);
  696. return Constructor;
  697. };
  698. })();
  699. var _get = function get(object, property, receiver) {
  700. if (object === null) object = Function.prototype;
  701. var desc = Object.getOwnPropertyDescriptor(object, property);
  702. if (desc === void 0) {
  703. var parent = Object.getPrototypeOf(object);
  704. if (parent === null) {
  705. return void 0;
  706. } else {
  707. return get(parent, property, receiver);
  708. }
  709. } else if ("value" in desc) {
  710. return desc.value;
  711. } else {
  712. var getter = desc.get;
  713. if (getter === void 0) {
  714. return void 0;
  715. }
  716. return getter.call(receiver);
  717. }
  718. };
  719. var _extend = __webpack_require__(3);
  720. var _extend2 = _interopRequireDefault(_extend);
  721. var _quillDelta = __webpack_require__(2);
  722. var _quillDelta2 = _interopRequireDefault(_quillDelta);
  723. var _parchment = __webpack_require__(0);
  724. var _parchment2 = _interopRequireDefault(_parchment);
  725. var _break = __webpack_require__(16);
  726. var _break2 = _interopRequireDefault(_break);
  727. var _inline = __webpack_require__(6);
  728. var _inline2 = _interopRequireDefault(_inline);
  729. var _text = __webpack_require__(7);
  730. var _text2 = _interopRequireDefault(_text);
  731. function _interopRequireDefault(obj) {
  732. return obj && obj.__esModule ? obj : { default: obj };
  733. }
  734. function _classCallCheck(instance, Constructor) {
  735. if (!(instance instanceof Constructor)) {
  736. throw new TypeError("Cannot call a class as a function");
  737. }
  738. }
  739. function _possibleConstructorReturn(self2, call) {
  740. if (!self2) {
  741. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  742. }
  743. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  744. }
  745. function _inherits(subClass, superClass) {
  746. if (typeof superClass !== "function" && superClass !== null) {
  747. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  748. }
  749. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  750. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  751. }
  752. var NEWLINE_LENGTH = 1;
  753. var BlockEmbed = (function(_Parchment$Embed) {
  754. _inherits(BlockEmbed2, _Parchment$Embed);
  755. function BlockEmbed2() {
  756. _classCallCheck(this, BlockEmbed2);
  757. return _possibleConstructorReturn(this, (BlockEmbed2.__proto__ || Object.getPrototypeOf(BlockEmbed2)).apply(this, arguments));
  758. }
  759. _createClass(BlockEmbed2, [{
  760. key: "attach",
  761. value: function attach() {
  762. _get(BlockEmbed2.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed2.prototype), "attach", this).call(this);
  763. this.attributes = new _parchment2.default.Attributor.Store(this.domNode);
  764. }
  765. }, {
  766. key: "delta",
  767. value: function delta() {
  768. return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values()));
  769. }
  770. }, {
  771. key: "format",
  772. value: function format(name, value) {
  773. var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE);
  774. if (attribute != null) {
  775. this.attributes.attribute(attribute, value);
  776. }
  777. }
  778. }, {
  779. key: "formatAt",
  780. value: function formatAt(index, length, name, value) {
  781. this.format(name, value);
  782. }
  783. }, {
  784. key: "insertAt",
  785. value: function insertAt(index, value, def) {
  786. if (typeof value === "string" && value.endsWith("\n")) {
  787. var block = _parchment2.default.create(Block.blotName);
  788. this.parent.insertBefore(block, index === 0 ? this : this.next);
  789. block.insertAt(0, value.slice(0, -1));
  790. } else {
  791. _get(BlockEmbed2.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed2.prototype), "insertAt", this).call(this, index, value, def);
  792. }
  793. }
  794. }]);
  795. return BlockEmbed2;
  796. })(_parchment2.default.Embed);
  797. BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT;
  798. var Block = (function(_Parchment$Block) {
  799. _inherits(Block2, _Parchment$Block);
  800. function Block2(domNode) {
  801. _classCallCheck(this, Block2);
  802. var _this2 = _possibleConstructorReturn(this, (Block2.__proto__ || Object.getPrototypeOf(Block2)).call(this, domNode));
  803. _this2.cache = {};
  804. return _this2;
  805. }
  806. _createClass(Block2, [{
  807. key: "delta",
  808. value: function delta() {
  809. if (this.cache.delta == null) {
  810. this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function(delta2, leaf) {
  811. if (leaf.length() === 0) {
  812. return delta2;
  813. } else {
  814. return delta2.insert(leaf.value(), bubbleFormats(leaf));
  815. }
  816. }, new _quillDelta2.default()).insert("\n", bubbleFormats(this));
  817. }
  818. return this.cache.delta;
  819. }
  820. }, {
  821. key: "deleteAt",
  822. value: function deleteAt(index, length) {
  823. _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "deleteAt", this).call(this, index, length);
  824. this.cache = {};
  825. }
  826. }, {
  827. key: "formatAt",
  828. value: function formatAt(index, length, name, value) {
  829. if (length <= 0) return;
  830. if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {
  831. if (index + length === this.length()) {
  832. this.format(name, value);
  833. }
  834. } else {
  835. _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "formatAt", this).call(this, index, Math.min(length, this.length() - index - 1), name, value);
  836. }
  837. this.cache = {};
  838. }
  839. }, {
  840. key: "insertAt",
  841. value: function insertAt(index, value, def) {
  842. if (def != null) return _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "insertAt", this).call(this, index, value, def);
  843. if (value.length === 0) return;
  844. var lines = value.split("\n");
  845. var text = lines.shift();
  846. if (text.length > 0) {
  847. if (index < this.length() - 1 || this.children.tail == null) {
  848. _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "insertAt", this).call(this, Math.min(index, this.length() - 1), text);
  849. } else {
  850. this.children.tail.insertAt(this.children.tail.length(), text);
  851. }
  852. this.cache = {};
  853. }
  854. var block = this;
  855. lines.reduce(function(index2, line) {
  856. block = block.split(index2, true);
  857. block.insertAt(0, line);
  858. return line.length;
  859. }, index + text.length);
  860. }
  861. }, {
  862. key: "insertBefore",
  863. value: function insertBefore(blot, ref2) {
  864. var head = this.children.head;
  865. _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "insertBefore", this).call(this, blot, ref2);
  866. if (head instanceof _break2.default) {
  867. head.remove();
  868. }
  869. this.cache = {};
  870. }
  871. }, {
  872. key: "length",
  873. value: function length() {
  874. if (this.cache.length == null) {
  875. this.cache.length = _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "length", this).call(this) + NEWLINE_LENGTH;
  876. }
  877. return this.cache.length;
  878. }
  879. }, {
  880. key: "moveChildren",
  881. value: function moveChildren(target, ref2) {
  882. _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "moveChildren", this).call(this, target, ref2);
  883. this.cache = {};
  884. }
  885. }, {
  886. key: "optimize",
  887. value: function optimize(context) {
  888. _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "optimize", this).call(this, context);
  889. this.cache = {};
  890. }
  891. }, {
  892. key: "path",
  893. value: function path(index) {
  894. return _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "path", this).call(this, index, true);
  895. }
  896. }, {
  897. key: "removeChild",
  898. value: function removeChild(child) {
  899. _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "removeChild", this).call(this, child);
  900. this.cache = {};
  901. }
  902. }, {
  903. key: "split",
  904. value: function split(index) {
  905. var force = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
  906. if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {
  907. var clone = this.clone();
  908. if (index === 0) {
  909. this.parent.insertBefore(clone, this);
  910. return this;
  911. } else {
  912. this.parent.insertBefore(clone, this.next);
  913. return clone;
  914. }
  915. } else {
  916. var next = _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "split", this).call(this, index, force);
  917. this.cache = {};
  918. return next;
  919. }
  920. }
  921. }]);
  922. return Block2;
  923. })(_parchment2.default.Block);
  924. Block.blotName = "block";
  925. Block.tagName = "P";
  926. Block.defaultChild = "break";
  927. Block.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default];
  928. function bubbleFormats(blot) {
  929. var formats = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  930. if (blot == null) return formats;
  931. if (typeof blot.formats === "function") {
  932. formats = (0, _extend2.default)(formats, blot.formats());
  933. }
  934. if (blot.parent == null || blot.parent.blotName == "scroll" || blot.parent.statics.scope !== blot.statics.scope) {
  935. return formats;
  936. }
  937. return bubbleFormats(blot.parent, formats);
  938. }
  939. exports2.bubbleFormats = bubbleFormats;
  940. exports2.BlockEmbed = BlockEmbed;
  941. exports2.default = Block;
  942. }),
  943. /* 5 */
  944. /***/
  945. (function(module2, exports2, __webpack_require__) {
  946. "use strict";
  947. Object.defineProperty(exports2, "__esModule", {
  948. value: true
  949. });
  950. exports2.default = exports2.overload = exports2.expandConfig = void 0;
  951. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
  952. return typeof obj;
  953. } : function(obj) {
  954. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  955. };
  956. var _slicedToArray = /* @__PURE__ */ (function() {
  957. function sliceIterator(arr, i) {
  958. var _arr = [];
  959. var _n = true;
  960. var _d = false;
  961. var _e = void 0;
  962. try {
  963. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  964. _arr.push(_s.value);
  965. if (i && _arr.length === i) break;
  966. }
  967. } catch (err) {
  968. _d = true;
  969. _e = err;
  970. } finally {
  971. try {
  972. if (!_n && _i["return"]) _i["return"]();
  973. } finally {
  974. if (_d) throw _e;
  975. }
  976. }
  977. return _arr;
  978. }
  979. return function(arr, i) {
  980. if (Array.isArray(arr)) {
  981. return arr;
  982. } else if (Symbol.iterator in Object(arr)) {
  983. return sliceIterator(arr, i);
  984. } else {
  985. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  986. }
  987. };
  988. })();
  989. var _createClass = /* @__PURE__ */ (function() {
  990. function defineProperties(target, props) {
  991. for (var i = 0; i < props.length; i++) {
  992. var descriptor = props[i];
  993. descriptor.enumerable = descriptor.enumerable || false;
  994. descriptor.configurable = true;
  995. if ("value" in descriptor) descriptor.writable = true;
  996. Object.defineProperty(target, descriptor.key, descriptor);
  997. }
  998. }
  999. return function(Constructor, protoProps, staticProps) {
  1000. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  1001. if (staticProps) defineProperties(Constructor, staticProps);
  1002. return Constructor;
  1003. };
  1004. })();
  1005. __webpack_require__(50);
  1006. var _quillDelta = __webpack_require__(2);
  1007. var _quillDelta2 = _interopRequireDefault(_quillDelta);
  1008. var _editor = __webpack_require__(14);
  1009. var _editor2 = _interopRequireDefault(_editor);
  1010. var _emitter3 = __webpack_require__(8);
  1011. var _emitter4 = _interopRequireDefault(_emitter3);
  1012. var _module = __webpack_require__(9);
  1013. var _module2 = _interopRequireDefault(_module);
  1014. var _parchment = __webpack_require__(0);
  1015. var _parchment2 = _interopRequireDefault(_parchment);
  1016. var _selection = __webpack_require__(15);
  1017. var _selection2 = _interopRequireDefault(_selection);
  1018. var _extend = __webpack_require__(3);
  1019. var _extend2 = _interopRequireDefault(_extend);
  1020. var _logger = __webpack_require__(10);
  1021. var _logger2 = _interopRequireDefault(_logger);
  1022. var _theme = __webpack_require__(34);
  1023. var _theme2 = _interopRequireDefault(_theme);
  1024. function _interopRequireDefault(obj) {
  1025. return obj && obj.__esModule ? obj : { default: obj };
  1026. }
  1027. function _defineProperty(obj, key, value) {
  1028. if (key in obj) {
  1029. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  1030. } else {
  1031. obj[key] = value;
  1032. }
  1033. return obj;
  1034. }
  1035. function _classCallCheck(instance, Constructor) {
  1036. if (!(instance instanceof Constructor)) {
  1037. throw new TypeError("Cannot call a class as a function");
  1038. }
  1039. }
  1040. var debug = (0, _logger2.default)("quill");
  1041. var Quill2 = (function() {
  1042. _createClass(Quill3, null, [{
  1043. key: "debug",
  1044. value: function debug2(limit) {
  1045. if (limit === true) {
  1046. limit = "log";
  1047. }
  1048. _logger2.default.level(limit);
  1049. }
  1050. }, {
  1051. key: "find",
  1052. value: function find(node) {
  1053. return node.__quill || _parchment2.default.find(node);
  1054. }
  1055. }, {
  1056. key: "import",
  1057. value: function _import(name) {
  1058. if (this.imports[name] == null) {
  1059. debug.error("Cannot import " + name + ". Are you sure it was registered?");
  1060. }
  1061. return this.imports[name];
  1062. }
  1063. }, {
  1064. key: "register",
  1065. value: function register(path, target) {
  1066. var _this = this;
  1067. var overwrite = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
  1068. if (typeof path !== "string") {
  1069. var name = path.attrName || path.blotName;
  1070. if (typeof name === "string") {
  1071. this.register("formats/" + name, path, target);
  1072. } else {
  1073. Object.keys(path).forEach(function(key) {
  1074. _this.register(key, path[key], target);
  1075. });
  1076. }
  1077. } else {
  1078. if (this.imports[path] != null && !overwrite) {
  1079. debug.warn("Overwriting " + path + " with", target);
  1080. }
  1081. this.imports[path] = target;
  1082. if ((path.startsWith("blots/") || path.startsWith("formats/")) && target.blotName !== "abstract") {
  1083. _parchment2.default.register(target);
  1084. } else if (path.startsWith("modules") && typeof target.register === "function") {
  1085. target.register();
  1086. }
  1087. }
  1088. }
  1089. }]);
  1090. function Quill3(container) {
  1091. var _this2 = this;
  1092. var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  1093. _classCallCheck(this, Quill3);
  1094. this.options = expandConfig(container, options);
  1095. this.container = this.options.container;
  1096. if (this.container == null) {
  1097. return debug.error("Invalid Quill container", container);
  1098. }
  1099. if (this.options.debug) {
  1100. Quill3.debug(this.options.debug);
  1101. }
  1102. var html = this.container.innerHTML.trim();
  1103. this.container.classList.add("ql-container");
  1104. this.container.innerHTML = "";
  1105. this.container.__quill = this;
  1106. this.root = this.addContainer("ql-editor");
  1107. this.root.classList.add("ql-blank");
  1108. this.root.setAttribute("data-gramm", false);
  1109. this.scrollingContainer = this.options.scrollingContainer || this.root;
  1110. this.emitter = new _emitter4.default();
  1111. this.scroll = _parchment2.default.create(this.root, {
  1112. emitter: this.emitter,
  1113. whitelist: this.options.formats
  1114. });
  1115. this.editor = new _editor2.default(this.scroll);
  1116. this.selection = new _selection2.default(this.scroll, this.emitter);
  1117. this.theme = new this.options.theme(this, this.options);
  1118. this.keyboard = this.theme.addModule("keyboard");
  1119. this.clipboard = this.theme.addModule("clipboard");
  1120. this.history = this.theme.addModule("history");
  1121. this.theme.init();
  1122. this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function(type) {
  1123. if (type === _emitter4.default.events.TEXT_CHANGE) {
  1124. _this2.root.classList.toggle("ql-blank", _this2.editor.isBlank());
  1125. }
  1126. });
  1127. this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function(source, mutations) {
  1128. var range = _this2.selection.lastRange;
  1129. var index = range && range.length === 0 ? range.index : void 0;
  1130. modify.call(_this2, function() {
  1131. return _this2.editor.update(null, mutations, index);
  1132. }, source);
  1133. });
  1134. var contents = this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">` + html + "<p><br></p></div>");
  1135. this.setContents(contents);
  1136. this.history.clear();
  1137. if (this.options.placeholder) {
  1138. this.root.setAttribute("data-placeholder", this.options.placeholder);
  1139. }
  1140. if (this.options.readOnly) {
  1141. this.disable();
  1142. }
  1143. }
  1144. _createClass(Quill3, [{
  1145. key: "addContainer",
  1146. value: function addContainer(container) {
  1147. var refNode = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
  1148. if (typeof container === "string") {
  1149. var className = container;
  1150. container = document.createElement("div");
  1151. container.classList.add(className);
  1152. }
  1153. this.container.insertBefore(container, refNode);
  1154. return container;
  1155. }
  1156. }, {
  1157. key: "blur",
  1158. value: function blur() {
  1159. this.selection.setRange(null);
  1160. }
  1161. }, {
  1162. key: "deleteText",
  1163. value: function deleteText(index, length, source) {
  1164. var _this3 = this;
  1165. var _overload = overload(index, length, source);
  1166. var _overload2 = _slicedToArray(_overload, 4);
  1167. index = _overload2[0];
  1168. length = _overload2[1];
  1169. source = _overload2[3];
  1170. return modify.call(this, function() {
  1171. return _this3.editor.deleteText(index, length);
  1172. }, source, index, -1 * length);
  1173. }
  1174. }, {
  1175. key: "disable",
  1176. value: function disable() {
  1177. this.enable(false);
  1178. }
  1179. }, {
  1180. key: "enable",
  1181. value: function enable() {
  1182. var enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
  1183. this.scroll.enable(enabled);
  1184. this.container.classList.toggle("ql-disabled", !enabled);
  1185. }
  1186. }, {
  1187. key: "focus",
  1188. value: function focus() {
  1189. var scrollTop = this.scrollingContainer.scrollTop;
  1190. this.selection.focus();
  1191. this.scrollingContainer.scrollTop = scrollTop;
  1192. this.scrollIntoView();
  1193. }
  1194. }, {
  1195. key: "format",
  1196. value: function format(name, value) {
  1197. var _this4 = this;
  1198. var source = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _emitter4.default.sources.API;
  1199. return modify.call(this, function() {
  1200. var range = _this4.getSelection(true);
  1201. var change = new _quillDelta2.default();
  1202. if (range == null) {
  1203. return change;
  1204. } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {
  1205. change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value));
  1206. } else if (range.length === 0) {
  1207. _this4.selection.format(name, value);
  1208. return change;
  1209. } else {
  1210. change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value));
  1211. }
  1212. _this4.setSelection(range, _emitter4.default.sources.SILENT);
  1213. return change;
  1214. }, source);
  1215. }
  1216. }, {
  1217. key: "formatLine",
  1218. value: function formatLine(index, length, name, value, source) {
  1219. var _this5 = this;
  1220. var formats = void 0;
  1221. var _overload3 = overload(index, length, name, value, source);
  1222. var _overload4 = _slicedToArray(_overload3, 4);
  1223. index = _overload4[0];
  1224. length = _overload4[1];
  1225. formats = _overload4[2];
  1226. source = _overload4[3];
  1227. return modify.call(this, function() {
  1228. return _this5.editor.formatLine(index, length, formats);
  1229. }, source, index, 0);
  1230. }
  1231. }, {
  1232. key: "formatText",
  1233. value: function formatText(index, length, name, value, source) {
  1234. var _this6 = this;
  1235. var formats = void 0;
  1236. var _overload5 = overload(index, length, name, value, source);
  1237. var _overload6 = _slicedToArray(_overload5, 4);
  1238. index = _overload6[0];
  1239. length = _overload6[1];
  1240. formats = _overload6[2];
  1241. source = _overload6[3];
  1242. return modify.call(this, function() {
  1243. return _this6.editor.formatText(index, length, formats);
  1244. }, source, index, 0);
  1245. }
  1246. }, {
  1247. key: "getBounds",
  1248. value: function getBounds(index) {
  1249. var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
  1250. var bounds = void 0;
  1251. if (typeof index === "number") {
  1252. bounds = this.selection.getBounds(index, length);
  1253. } else {
  1254. bounds = this.selection.getBounds(index.index, index.length);
  1255. }
  1256. var containerBounds = this.container.getBoundingClientRect();
  1257. return {
  1258. bottom: bounds.bottom - containerBounds.top,
  1259. height: bounds.height,
  1260. left: bounds.left - containerBounds.left,
  1261. right: bounds.right - containerBounds.left,
  1262. top: bounds.top - containerBounds.top,
  1263. width: bounds.width
  1264. };
  1265. }
  1266. }, {
  1267. key: "getContents",
  1268. value: function getContents() {
  1269. var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
  1270. var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.getLength() - index;
  1271. var _overload7 = overload(index, length);
  1272. var _overload8 = _slicedToArray(_overload7, 2);
  1273. index = _overload8[0];
  1274. length = _overload8[1];
  1275. return this.editor.getContents(index, length);
  1276. }
  1277. }, {
  1278. key: "getFormat",
  1279. value: function getFormat() {
  1280. var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.getSelection(true);
  1281. var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
  1282. if (typeof index === "number") {
  1283. return this.editor.getFormat(index, length);
  1284. } else {
  1285. return this.editor.getFormat(index.index, index.length);
  1286. }
  1287. }
  1288. }, {
  1289. key: "getIndex",
  1290. value: function getIndex(blot) {
  1291. return blot.offset(this.scroll);
  1292. }
  1293. }, {
  1294. key: "getLength",
  1295. value: function getLength() {
  1296. return this.scroll.length();
  1297. }
  1298. }, {
  1299. key: "getLeaf",
  1300. value: function getLeaf(index) {
  1301. return this.scroll.leaf(index);
  1302. }
  1303. }, {
  1304. key: "getLine",
  1305. value: function getLine(index) {
  1306. return this.scroll.line(index);
  1307. }
  1308. }, {
  1309. key: "getLines",
  1310. value: function getLines() {
  1311. var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
  1312. var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Number.MAX_VALUE;
  1313. if (typeof index !== "number") {
  1314. return this.scroll.lines(index.index, index.length);
  1315. } else {
  1316. return this.scroll.lines(index, length);
  1317. }
  1318. }
  1319. }, {
  1320. key: "getModule",
  1321. value: function getModule(name) {
  1322. return this.theme.modules[name];
  1323. }
  1324. }, {
  1325. key: "getSelection",
  1326. value: function getSelection() {
  1327. var focus = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
  1328. if (focus) this.focus();
  1329. this.update();
  1330. return this.selection.getRange()[0];
  1331. }
  1332. }, {
  1333. key: "getText",
  1334. value: function getText() {
  1335. var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
  1336. var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.getLength() - index;
  1337. var _overload9 = overload(index, length);
  1338. var _overload10 = _slicedToArray(_overload9, 2);
  1339. index = _overload10[0];
  1340. length = _overload10[1];
  1341. return this.editor.getText(index, length);
  1342. }
  1343. }, {
  1344. key: "hasFocus",
  1345. value: function hasFocus() {
  1346. return this.selection.hasFocus();
  1347. }
  1348. }, {
  1349. key: "insertEmbed",
  1350. value: function insertEmbed(index, embed, value) {
  1351. var _this7 = this;
  1352. var source = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : Quill3.sources.API;
  1353. return modify.call(this, function() {
  1354. return _this7.editor.insertEmbed(index, embed, value);
  1355. }, source, index);
  1356. }
  1357. }, {
  1358. key: "insertText",
  1359. value: function insertText(index, text, name, value, source) {
  1360. var _this8 = this;
  1361. var formats = void 0;
  1362. var _overload11 = overload(index, 0, name, value, source);
  1363. var _overload12 = _slicedToArray(_overload11, 4);
  1364. index = _overload12[0];
  1365. formats = _overload12[2];
  1366. source = _overload12[3];
  1367. return modify.call(this, function() {
  1368. return _this8.editor.insertText(index, text, formats);
  1369. }, source, index, text.length);
  1370. }
  1371. }, {
  1372. key: "isEnabled",
  1373. value: function isEnabled() {
  1374. return !this.container.classList.contains("ql-disabled");
  1375. }
  1376. }, {
  1377. key: "off",
  1378. value: function off() {
  1379. return this.emitter.off.apply(this.emitter, arguments);
  1380. }
  1381. }, {
  1382. key: "on",
  1383. value: function on() {
  1384. return this.emitter.on.apply(this.emitter, arguments);
  1385. }
  1386. }, {
  1387. key: "once",
  1388. value: function once() {
  1389. return this.emitter.once.apply(this.emitter, arguments);
  1390. }
  1391. }, {
  1392. key: "pasteHTML",
  1393. value: function pasteHTML(index, html, source) {
  1394. this.clipboard.dangerouslyPasteHTML(index, html, source);
  1395. }
  1396. }, {
  1397. key: "removeFormat",
  1398. value: function removeFormat(index, length, source) {
  1399. var _this9 = this;
  1400. var _overload13 = overload(index, length, source);
  1401. var _overload14 = _slicedToArray(_overload13, 4);
  1402. index = _overload14[0];
  1403. length = _overload14[1];
  1404. source = _overload14[3];
  1405. return modify.call(this, function() {
  1406. return _this9.editor.removeFormat(index, length);
  1407. }, source, index);
  1408. }
  1409. }, {
  1410. key: "scrollIntoView",
  1411. value: function scrollIntoView() {
  1412. this.selection.scrollIntoView(this.scrollingContainer);
  1413. }
  1414. }, {
  1415. key: "setContents",
  1416. value: function setContents(delta) {
  1417. var _this10 = this;
  1418. var source = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _emitter4.default.sources.API;
  1419. return modify.call(this, function() {
  1420. delta = new _quillDelta2.default(delta);
  1421. var length = _this10.getLength();
  1422. var deleted = _this10.editor.deleteText(0, length);
  1423. var applied = _this10.editor.applyDelta(delta);
  1424. var lastOp = applied.ops[applied.ops.length - 1];
  1425. if (lastOp != null && typeof lastOp.insert === "string" && lastOp.insert[lastOp.insert.length - 1] === "\n") {
  1426. _this10.editor.deleteText(_this10.getLength() - 1, 1);
  1427. applied.delete(1);
  1428. }
  1429. var ret = deleted.compose(applied);
  1430. return ret;
  1431. }, source);
  1432. }
  1433. }, {
  1434. key: "setSelection",
  1435. value: function setSelection(index, length, source) {
  1436. if (index == null) {
  1437. this.selection.setRange(null, length || Quill3.sources.API);
  1438. } else {
  1439. var _overload15 = overload(index, length, source);
  1440. var _overload16 = _slicedToArray(_overload15, 4);
  1441. index = _overload16[0];
  1442. length = _overload16[1];
  1443. source = _overload16[3];
  1444. this.selection.setRange(new _selection.Range(index, length), source);
  1445. if (source !== _emitter4.default.sources.SILENT) {
  1446. this.selection.scrollIntoView(this.scrollingContainer);
  1447. }
  1448. }
  1449. }
  1450. }, {
  1451. key: "setText",
  1452. value: function setText(text) {
  1453. var source = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _emitter4.default.sources.API;
  1454. var delta = new _quillDelta2.default().insert(text);
  1455. return this.setContents(delta, source);
  1456. }
  1457. }, {
  1458. key: "update",
  1459. value: function update() {
  1460. var source = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _emitter4.default.sources.USER;
  1461. var change = this.scroll.update(source);
  1462. this.selection.update(source);
  1463. return change;
  1464. }
  1465. }, {
  1466. key: "updateContents",
  1467. value: function updateContents(delta) {
  1468. var _this11 = this;
  1469. var source = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _emitter4.default.sources.API;
  1470. return modify.call(this, function() {
  1471. delta = new _quillDelta2.default(delta);
  1472. return _this11.editor.applyDelta(delta, source);
  1473. }, source, true);
  1474. }
  1475. }]);
  1476. return Quill3;
  1477. })();
  1478. Quill2.DEFAULTS = {
  1479. bounds: null,
  1480. formats: null,
  1481. modules: {},
  1482. placeholder: "",
  1483. readOnly: false,
  1484. scrollingContainer: null,
  1485. strict: true,
  1486. theme: "default"
  1487. };
  1488. Quill2.events = _emitter4.default.events;
  1489. Quill2.sources = _emitter4.default.sources;
  1490. Quill2.version = false ? "dev" : "1.3.7";
  1491. Quill2.imports = {
  1492. "delta": _quillDelta2.default,
  1493. "parchment": _parchment2.default,
  1494. "core/module": _module2.default,
  1495. "core/theme": _theme2.default
  1496. };
  1497. function expandConfig(container, userConfig) {
  1498. userConfig = (0, _extend2.default)(true, {
  1499. container,
  1500. modules: {
  1501. clipboard: true,
  1502. keyboard: true,
  1503. history: true
  1504. }
  1505. }, userConfig);
  1506. if (!userConfig.theme || userConfig.theme === Quill2.DEFAULTS.theme) {
  1507. userConfig.theme = _theme2.default;
  1508. } else {
  1509. userConfig.theme = Quill2.import("themes/" + userConfig.theme);
  1510. if (userConfig.theme == null) {
  1511. throw new Error("Invalid theme " + userConfig.theme + ". Did you register it?");
  1512. }
  1513. }
  1514. var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS);
  1515. [themeConfig, userConfig].forEach(function(config) {
  1516. config.modules = config.modules || {};
  1517. Object.keys(config.modules).forEach(function(module3) {
  1518. if (config.modules[module3] === true) {
  1519. config.modules[module3] = {};
  1520. }
  1521. });
  1522. });
  1523. var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));
  1524. var moduleConfig = moduleNames.reduce(function(config, name) {
  1525. var moduleClass = Quill2.import("modules/" + name);
  1526. if (moduleClass == null) {
  1527. debug.error("Cannot load " + name + " module. Are you sure you registered it?");
  1528. } else {
  1529. config[name] = moduleClass.DEFAULTS || {};
  1530. }
  1531. return config;
  1532. }, {});
  1533. if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) {
  1534. userConfig.modules.toolbar = {
  1535. container: userConfig.modules.toolbar
  1536. };
  1537. }
  1538. userConfig = (0, _extend2.default)(true, {}, Quill2.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig);
  1539. ["bounds", "container", "scrollingContainer"].forEach(function(key) {
  1540. if (typeof userConfig[key] === "string") {
  1541. userConfig[key] = document.querySelector(userConfig[key]);
  1542. }
  1543. });
  1544. userConfig.modules = Object.keys(userConfig.modules).reduce(function(config, name) {
  1545. if (userConfig.modules[name]) {
  1546. config[name] = userConfig.modules[name];
  1547. }
  1548. return config;
  1549. }, {});
  1550. return userConfig;
  1551. }
  1552. function modify(modifier, source, index, shift) {
  1553. if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {
  1554. return new _quillDelta2.default();
  1555. }
  1556. var range = index == null ? null : this.getSelection();
  1557. var oldDelta = this.editor.delta;
  1558. var change = modifier();
  1559. if (range != null) {
  1560. if (index === true) index = range.index;
  1561. if (shift == null) {
  1562. range = shiftRange(range, change, source);
  1563. } else if (shift !== 0) {
  1564. range = shiftRange(range, index, shift, source);
  1565. }
  1566. this.setSelection(range, _emitter4.default.sources.SILENT);
  1567. }
  1568. if (change.length() > 0) {
  1569. var _emitter;
  1570. var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];
  1571. (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));
  1572. if (source !== _emitter4.default.sources.SILENT) {
  1573. var _emitter2;
  1574. (_emitter2 = this.emitter).emit.apply(_emitter2, args);
  1575. }
  1576. }
  1577. return change;
  1578. }
  1579. function overload(index, length, name, value, source) {
  1580. var formats = {};
  1581. if (typeof index.index === "number" && typeof index.length === "number") {
  1582. if (typeof length !== "number") {
  1583. source = value, value = name, name = length, length = index.length, index = index.index;
  1584. } else {
  1585. length = index.length, index = index.index;
  1586. }
  1587. } else if (typeof length !== "number") {
  1588. source = value, value = name, name = length, length = 0;
  1589. }
  1590. if ((typeof name === "undefined" ? "undefined" : _typeof(name)) === "object") {
  1591. formats = name;
  1592. source = value;
  1593. } else if (typeof name === "string") {
  1594. if (value != null) {
  1595. formats[name] = value;
  1596. } else {
  1597. source = name;
  1598. }
  1599. }
  1600. source = source || _emitter4.default.sources.API;
  1601. return [index, length, formats, source];
  1602. }
  1603. function shiftRange(range, index, length, source) {
  1604. if (range == null) return null;
  1605. var start = void 0, end = void 0;
  1606. if (index instanceof _quillDelta2.default) {
  1607. var _map = [range.index, range.index + range.length].map(function(pos) {
  1608. return index.transformPosition(pos, source !== _emitter4.default.sources.USER);
  1609. });
  1610. var _map2 = _slicedToArray(_map, 2);
  1611. start = _map2[0];
  1612. end = _map2[1];
  1613. } else {
  1614. var _map3 = [range.index, range.index + range.length].map(function(pos) {
  1615. if (pos < index || pos === index && source === _emitter4.default.sources.USER) return pos;
  1616. if (length >= 0) {
  1617. return pos + length;
  1618. } else {
  1619. return Math.max(index, pos + length);
  1620. }
  1621. });
  1622. var _map4 = _slicedToArray(_map3, 2);
  1623. start = _map4[0];
  1624. end = _map4[1];
  1625. }
  1626. return new _selection.Range(start, end - start);
  1627. }
  1628. exports2.expandConfig = expandConfig;
  1629. exports2.overload = overload;
  1630. exports2.default = Quill2;
  1631. }),
  1632. /* 6 */
  1633. /***/
  1634. (function(module2, exports2, __webpack_require__) {
  1635. "use strict";
  1636. Object.defineProperty(exports2, "__esModule", {
  1637. value: true
  1638. });
  1639. var _createClass = /* @__PURE__ */ (function() {
  1640. function defineProperties(target, props) {
  1641. for (var i = 0; i < props.length; i++) {
  1642. var descriptor = props[i];
  1643. descriptor.enumerable = descriptor.enumerable || false;
  1644. descriptor.configurable = true;
  1645. if ("value" in descriptor) descriptor.writable = true;
  1646. Object.defineProperty(target, descriptor.key, descriptor);
  1647. }
  1648. }
  1649. return function(Constructor, protoProps, staticProps) {
  1650. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  1651. if (staticProps) defineProperties(Constructor, staticProps);
  1652. return Constructor;
  1653. };
  1654. })();
  1655. var _get = function get(object, property, receiver) {
  1656. if (object === null) object = Function.prototype;
  1657. var desc = Object.getOwnPropertyDescriptor(object, property);
  1658. if (desc === void 0) {
  1659. var parent = Object.getPrototypeOf(object);
  1660. if (parent === null) {
  1661. return void 0;
  1662. } else {
  1663. return get(parent, property, receiver);
  1664. }
  1665. } else if ("value" in desc) {
  1666. return desc.value;
  1667. } else {
  1668. var getter = desc.get;
  1669. if (getter === void 0) {
  1670. return void 0;
  1671. }
  1672. return getter.call(receiver);
  1673. }
  1674. };
  1675. var _text = __webpack_require__(7);
  1676. var _text2 = _interopRequireDefault(_text);
  1677. var _parchment = __webpack_require__(0);
  1678. var _parchment2 = _interopRequireDefault(_parchment);
  1679. function _interopRequireDefault(obj) {
  1680. return obj && obj.__esModule ? obj : { default: obj };
  1681. }
  1682. function _classCallCheck(instance, Constructor) {
  1683. if (!(instance instanceof Constructor)) {
  1684. throw new TypeError("Cannot call a class as a function");
  1685. }
  1686. }
  1687. function _possibleConstructorReturn(self2, call) {
  1688. if (!self2) {
  1689. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  1690. }
  1691. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  1692. }
  1693. function _inherits(subClass, superClass) {
  1694. if (typeof superClass !== "function" && superClass !== null) {
  1695. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  1696. }
  1697. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  1698. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  1699. }
  1700. var Inline = (function(_Parchment$Inline) {
  1701. _inherits(Inline2, _Parchment$Inline);
  1702. function Inline2() {
  1703. _classCallCheck(this, Inline2);
  1704. return _possibleConstructorReturn(this, (Inline2.__proto__ || Object.getPrototypeOf(Inline2)).apply(this, arguments));
  1705. }
  1706. _createClass(Inline2, [{
  1707. key: "formatAt",
  1708. value: function formatAt(index, length, name, value) {
  1709. if (Inline2.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) {
  1710. var blot = this.isolate(index, length);
  1711. if (value) {
  1712. blot.wrap(name, value);
  1713. }
  1714. } else {
  1715. _get(Inline2.prototype.__proto__ || Object.getPrototypeOf(Inline2.prototype), "formatAt", this).call(this, index, length, name, value);
  1716. }
  1717. }
  1718. }, {
  1719. key: "optimize",
  1720. value: function optimize(context) {
  1721. _get(Inline2.prototype.__proto__ || Object.getPrototypeOf(Inline2.prototype), "optimize", this).call(this, context);
  1722. if (this.parent instanceof Inline2 && Inline2.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {
  1723. var parent = this.parent.isolate(this.offset(), this.length());
  1724. this.moveChildren(parent);
  1725. parent.wrap(this);
  1726. }
  1727. }
  1728. }], [{
  1729. key: "compare",
  1730. value: function compare(self2, other) {
  1731. var selfIndex = Inline2.order.indexOf(self2);
  1732. var otherIndex = Inline2.order.indexOf(other);
  1733. if (selfIndex >= 0 || otherIndex >= 0) {
  1734. return selfIndex - otherIndex;
  1735. } else if (self2 === other) {
  1736. return 0;
  1737. } else if (self2 < other) {
  1738. return -1;
  1739. } else {
  1740. return 1;
  1741. }
  1742. }
  1743. }]);
  1744. return Inline2;
  1745. })(_parchment2.default.Inline);
  1746. Inline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default];
  1747. Inline.order = [
  1748. "cursor",
  1749. "inline",
  1750. // Must be lower
  1751. "underline",
  1752. "strike",
  1753. "italic",
  1754. "bold",
  1755. "script",
  1756. "link",
  1757. "code"
  1758. // Must be higher
  1759. ];
  1760. exports2.default = Inline;
  1761. }),
  1762. /* 7 */
  1763. /***/
  1764. (function(module2, exports2, __webpack_require__) {
  1765. "use strict";
  1766. Object.defineProperty(exports2, "__esModule", {
  1767. value: true
  1768. });
  1769. var _parchment = __webpack_require__(0);
  1770. var _parchment2 = _interopRequireDefault(_parchment);
  1771. function _interopRequireDefault(obj) {
  1772. return obj && obj.__esModule ? obj : { default: obj };
  1773. }
  1774. function _classCallCheck(instance, Constructor) {
  1775. if (!(instance instanceof Constructor)) {
  1776. throw new TypeError("Cannot call a class as a function");
  1777. }
  1778. }
  1779. function _possibleConstructorReturn(self2, call) {
  1780. if (!self2) {
  1781. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  1782. }
  1783. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  1784. }
  1785. function _inherits(subClass, superClass) {
  1786. if (typeof superClass !== "function" && superClass !== null) {
  1787. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  1788. }
  1789. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  1790. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  1791. }
  1792. var TextBlot = (function(_Parchment$Text) {
  1793. _inherits(TextBlot2, _Parchment$Text);
  1794. function TextBlot2() {
  1795. _classCallCheck(this, TextBlot2);
  1796. return _possibleConstructorReturn(this, (TextBlot2.__proto__ || Object.getPrototypeOf(TextBlot2)).apply(this, arguments));
  1797. }
  1798. return TextBlot2;
  1799. })(_parchment2.default.Text);
  1800. exports2.default = TextBlot;
  1801. }),
  1802. /* 8 */
  1803. /***/
  1804. (function(module2, exports2, __webpack_require__) {
  1805. "use strict";
  1806. Object.defineProperty(exports2, "__esModule", {
  1807. value: true
  1808. });
  1809. var _createClass = /* @__PURE__ */ (function() {
  1810. function defineProperties(target, props) {
  1811. for (var i = 0; i < props.length; i++) {
  1812. var descriptor = props[i];
  1813. descriptor.enumerable = descriptor.enumerable || false;
  1814. descriptor.configurable = true;
  1815. if ("value" in descriptor) descriptor.writable = true;
  1816. Object.defineProperty(target, descriptor.key, descriptor);
  1817. }
  1818. }
  1819. return function(Constructor, protoProps, staticProps) {
  1820. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  1821. if (staticProps) defineProperties(Constructor, staticProps);
  1822. return Constructor;
  1823. };
  1824. })();
  1825. var _get = function get(object, property, receiver) {
  1826. if (object === null) object = Function.prototype;
  1827. var desc = Object.getOwnPropertyDescriptor(object, property);
  1828. if (desc === void 0) {
  1829. var parent = Object.getPrototypeOf(object);
  1830. if (parent === null) {
  1831. return void 0;
  1832. } else {
  1833. return get(parent, property, receiver);
  1834. }
  1835. } else if ("value" in desc) {
  1836. return desc.value;
  1837. } else {
  1838. var getter = desc.get;
  1839. if (getter === void 0) {
  1840. return void 0;
  1841. }
  1842. return getter.call(receiver);
  1843. }
  1844. };
  1845. var _eventemitter = __webpack_require__(54);
  1846. var _eventemitter2 = _interopRequireDefault(_eventemitter);
  1847. var _logger = __webpack_require__(10);
  1848. var _logger2 = _interopRequireDefault(_logger);
  1849. function _interopRequireDefault(obj) {
  1850. return obj && obj.__esModule ? obj : { default: obj };
  1851. }
  1852. function _classCallCheck(instance, Constructor) {
  1853. if (!(instance instanceof Constructor)) {
  1854. throw new TypeError("Cannot call a class as a function");
  1855. }
  1856. }
  1857. function _possibleConstructorReturn(self2, call) {
  1858. if (!self2) {
  1859. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  1860. }
  1861. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  1862. }
  1863. function _inherits(subClass, superClass) {
  1864. if (typeof superClass !== "function" && superClass !== null) {
  1865. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  1866. }
  1867. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  1868. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  1869. }
  1870. var debug = (0, _logger2.default)("quill:events");
  1871. var EVENTS = ["selectionchange", "mousedown", "mouseup", "click"];
  1872. EVENTS.forEach(function(eventName) {
  1873. document.addEventListener(eventName, function() {
  1874. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1875. args[_key] = arguments[_key];
  1876. }
  1877. [].slice.call(document.querySelectorAll(".ql-container")).forEach(function(node) {
  1878. if (node.__quill && node.__quill.emitter) {
  1879. var _node$__quill$emitter;
  1880. (_node$__quill$emitter = node.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args);
  1881. }
  1882. });
  1883. });
  1884. });
  1885. var Emitter = (function(_EventEmitter) {
  1886. _inherits(Emitter2, _EventEmitter);
  1887. function Emitter2() {
  1888. _classCallCheck(this, Emitter2);
  1889. var _this = _possibleConstructorReturn(this, (Emitter2.__proto__ || Object.getPrototypeOf(Emitter2)).call(this));
  1890. _this.listeners = {};
  1891. _this.on("error", debug.error);
  1892. return _this;
  1893. }
  1894. _createClass(Emitter2, [{
  1895. key: "emit",
  1896. value: function emit() {
  1897. debug.log.apply(debug, arguments);
  1898. _get(Emitter2.prototype.__proto__ || Object.getPrototypeOf(Emitter2.prototype), "emit", this).apply(this, arguments);
  1899. }
  1900. }, {
  1901. key: "handleDOM",
  1902. value: function handleDOM(event) {
  1903. for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  1904. args[_key2 - 1] = arguments[_key2];
  1905. }
  1906. (this.listeners[event.type] || []).forEach(function(_ref) {
  1907. var node = _ref.node, handler = _ref.handler;
  1908. if (event.target === node || node.contains(event.target)) {
  1909. handler.apply(void 0, [event].concat(args));
  1910. }
  1911. });
  1912. }
  1913. }, {
  1914. key: "listenDOM",
  1915. value: function listenDOM(eventName, node, handler) {
  1916. if (!this.listeners[eventName]) {
  1917. this.listeners[eventName] = [];
  1918. }
  1919. this.listeners[eventName].push({ node, handler });
  1920. }
  1921. }]);
  1922. return Emitter2;
  1923. })(_eventemitter2.default);
  1924. Emitter.events = {
  1925. EDITOR_CHANGE: "editor-change",
  1926. SCROLL_BEFORE_UPDATE: "scroll-before-update",
  1927. SCROLL_OPTIMIZE: "scroll-optimize",
  1928. SCROLL_UPDATE: "scroll-update",
  1929. SELECTION_CHANGE: "selection-change",
  1930. TEXT_CHANGE: "text-change"
  1931. };
  1932. Emitter.sources = {
  1933. API: "api",
  1934. SILENT: "silent",
  1935. USER: "user"
  1936. };
  1937. exports2.default = Emitter;
  1938. }),
  1939. /* 9 */
  1940. /***/
  1941. (function(module2, exports2, __webpack_require__) {
  1942. "use strict";
  1943. Object.defineProperty(exports2, "__esModule", {
  1944. value: true
  1945. });
  1946. function _classCallCheck(instance, Constructor) {
  1947. if (!(instance instanceof Constructor)) {
  1948. throw new TypeError("Cannot call a class as a function");
  1949. }
  1950. }
  1951. var Module = function Module2(quill) {
  1952. var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  1953. _classCallCheck(this, Module2);
  1954. this.quill = quill;
  1955. this.options = options;
  1956. };
  1957. Module.DEFAULTS = {};
  1958. exports2.default = Module;
  1959. }),
  1960. /* 10 */
  1961. /***/
  1962. (function(module2, exports2, __webpack_require__) {
  1963. "use strict";
  1964. Object.defineProperty(exports2, "__esModule", {
  1965. value: true
  1966. });
  1967. var levels = ["error", "warn", "log", "info"];
  1968. var level = "warn";
  1969. function debug(method) {
  1970. if (levels.indexOf(method) <= levels.indexOf(level)) {
  1971. var _console;
  1972. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  1973. args[_key - 1] = arguments[_key];
  1974. }
  1975. (_console = console)[method].apply(_console, args);
  1976. }
  1977. }
  1978. function namespace(ns) {
  1979. return levels.reduce(function(logger, method) {
  1980. logger[method] = debug.bind(console, method, ns);
  1981. return logger;
  1982. }, {});
  1983. }
  1984. debug.level = namespace.level = function(newLevel) {
  1985. level = newLevel;
  1986. };
  1987. exports2.default = namespace;
  1988. }),
  1989. /* 11 */
  1990. /***/
  1991. (function(module2, exports2, __webpack_require__) {
  1992. var pSlice = Array.prototype.slice;
  1993. var objectKeys = __webpack_require__(52);
  1994. var isArguments = __webpack_require__(53);
  1995. var deepEqual = module2.exports = function(actual, expected, opts) {
  1996. if (!opts) opts = {};
  1997. if (actual === expected) {
  1998. return true;
  1999. } else if (actual instanceof Date && expected instanceof Date) {
  2000. return actual.getTime() === expected.getTime();
  2001. } else if (!actual || !expected || typeof actual != "object" && typeof expected != "object") {
  2002. return opts.strict ? actual === expected : actual == expected;
  2003. } else {
  2004. return objEquiv(actual, expected, opts);
  2005. }
  2006. };
  2007. function isUndefinedOrNull(value) {
  2008. return value === null || value === void 0;
  2009. }
  2010. function isBuffer(x) {
  2011. if (!x || typeof x !== "object" || typeof x.length !== "number") return false;
  2012. if (typeof x.copy !== "function" || typeof x.slice !== "function") {
  2013. return false;
  2014. }
  2015. if (x.length > 0 && typeof x[0] !== "number") return false;
  2016. return true;
  2017. }
  2018. function objEquiv(a, b, opts) {
  2019. var i, key;
  2020. if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
  2021. return false;
  2022. if (a.prototype !== b.prototype) return false;
  2023. if (isArguments(a)) {
  2024. if (!isArguments(b)) {
  2025. return false;
  2026. }
  2027. a = pSlice.call(a);
  2028. b = pSlice.call(b);
  2029. return deepEqual(a, b, opts);
  2030. }
  2031. if (isBuffer(a)) {
  2032. if (!isBuffer(b)) {
  2033. return false;
  2034. }
  2035. if (a.length !== b.length) return false;
  2036. for (i = 0; i < a.length; i++) {
  2037. if (a[i] !== b[i]) return false;
  2038. }
  2039. return true;
  2040. }
  2041. try {
  2042. var ka = objectKeys(a), kb = objectKeys(b);
  2043. } catch (e) {
  2044. return false;
  2045. }
  2046. if (ka.length != kb.length)
  2047. return false;
  2048. ka.sort();
  2049. kb.sort();
  2050. for (i = ka.length - 1; i >= 0; i--) {
  2051. if (ka[i] != kb[i])
  2052. return false;
  2053. }
  2054. for (i = ka.length - 1; i >= 0; i--) {
  2055. key = ka[i];
  2056. if (!deepEqual(a[key], b[key], opts)) return false;
  2057. }
  2058. return typeof a === typeof b;
  2059. }
  2060. }),
  2061. /* 12 */
  2062. /***/
  2063. (function(module2, exports2, __webpack_require__) {
  2064. "use strict";
  2065. Object.defineProperty(exports2, "__esModule", { value: true });
  2066. var Registry = __webpack_require__(1);
  2067. var Attributor = (
  2068. /** @class */
  2069. (function() {
  2070. function Attributor2(attrName, keyName, options) {
  2071. if (options === void 0) {
  2072. options = {};
  2073. }
  2074. this.attrName = attrName;
  2075. this.keyName = keyName;
  2076. var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE;
  2077. if (options.scope != null) {
  2078. this.scope = options.scope & Registry.Scope.LEVEL | attributeBit;
  2079. } else {
  2080. this.scope = Registry.Scope.ATTRIBUTE;
  2081. }
  2082. if (options.whitelist != null)
  2083. this.whitelist = options.whitelist;
  2084. }
  2085. Attributor2.keys = function(node) {
  2086. return [].map.call(node.attributes, function(item) {
  2087. return item.name;
  2088. });
  2089. };
  2090. Attributor2.prototype.add = function(node, value) {
  2091. if (!this.canAdd(node, value))
  2092. return false;
  2093. node.setAttribute(this.keyName, value);
  2094. return true;
  2095. };
  2096. Attributor2.prototype.canAdd = function(node, value) {
  2097. var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE));
  2098. if (match == null)
  2099. return false;
  2100. if (this.whitelist == null)
  2101. return true;
  2102. if (typeof value === "string") {
  2103. return this.whitelist.indexOf(value.replace(/["']/g, "")) > -1;
  2104. } else {
  2105. return this.whitelist.indexOf(value) > -1;
  2106. }
  2107. };
  2108. Attributor2.prototype.remove = function(node) {
  2109. node.removeAttribute(this.keyName);
  2110. };
  2111. Attributor2.prototype.value = function(node) {
  2112. var value = node.getAttribute(this.keyName);
  2113. if (this.canAdd(node, value) && value) {
  2114. return value;
  2115. }
  2116. return "";
  2117. };
  2118. return Attributor2;
  2119. })()
  2120. );
  2121. exports2.default = Attributor;
  2122. }),
  2123. /* 13 */
  2124. /***/
  2125. (function(module2, exports2, __webpack_require__) {
  2126. "use strict";
  2127. Object.defineProperty(exports2, "__esModule", {
  2128. value: true
  2129. });
  2130. exports2.default = exports2.Code = void 0;
  2131. var _slicedToArray = /* @__PURE__ */ (function() {
  2132. function sliceIterator(arr, i) {
  2133. var _arr = [];
  2134. var _n = true;
  2135. var _d = false;
  2136. var _e = void 0;
  2137. try {
  2138. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  2139. _arr.push(_s.value);
  2140. if (i && _arr.length === i) break;
  2141. }
  2142. } catch (err) {
  2143. _d = true;
  2144. _e = err;
  2145. } finally {
  2146. try {
  2147. if (!_n && _i["return"]) _i["return"]();
  2148. } finally {
  2149. if (_d) throw _e;
  2150. }
  2151. }
  2152. return _arr;
  2153. }
  2154. return function(arr, i) {
  2155. if (Array.isArray(arr)) {
  2156. return arr;
  2157. } else if (Symbol.iterator in Object(arr)) {
  2158. return sliceIterator(arr, i);
  2159. } else {
  2160. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  2161. }
  2162. };
  2163. })();
  2164. var _createClass = /* @__PURE__ */ (function() {
  2165. function defineProperties(target, props) {
  2166. for (var i = 0; i < props.length; i++) {
  2167. var descriptor = props[i];
  2168. descriptor.enumerable = descriptor.enumerable || false;
  2169. descriptor.configurable = true;
  2170. if ("value" in descriptor) descriptor.writable = true;
  2171. Object.defineProperty(target, descriptor.key, descriptor);
  2172. }
  2173. }
  2174. return function(Constructor, protoProps, staticProps) {
  2175. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  2176. if (staticProps) defineProperties(Constructor, staticProps);
  2177. return Constructor;
  2178. };
  2179. })();
  2180. var _get = function get(object, property, receiver) {
  2181. if (object === null) object = Function.prototype;
  2182. var desc = Object.getOwnPropertyDescriptor(object, property);
  2183. if (desc === void 0) {
  2184. var parent = Object.getPrototypeOf(object);
  2185. if (parent === null) {
  2186. return void 0;
  2187. } else {
  2188. return get(parent, property, receiver);
  2189. }
  2190. } else if ("value" in desc) {
  2191. return desc.value;
  2192. } else {
  2193. var getter = desc.get;
  2194. if (getter === void 0) {
  2195. return void 0;
  2196. }
  2197. return getter.call(receiver);
  2198. }
  2199. };
  2200. var _quillDelta = __webpack_require__(2);
  2201. var _quillDelta2 = _interopRequireDefault(_quillDelta);
  2202. var _parchment = __webpack_require__(0);
  2203. var _parchment2 = _interopRequireDefault(_parchment);
  2204. var _block = __webpack_require__(4);
  2205. var _block2 = _interopRequireDefault(_block);
  2206. var _inline = __webpack_require__(6);
  2207. var _inline2 = _interopRequireDefault(_inline);
  2208. var _text = __webpack_require__(7);
  2209. var _text2 = _interopRequireDefault(_text);
  2210. function _interopRequireDefault(obj) {
  2211. return obj && obj.__esModule ? obj : { default: obj };
  2212. }
  2213. function _classCallCheck(instance, Constructor) {
  2214. if (!(instance instanceof Constructor)) {
  2215. throw new TypeError("Cannot call a class as a function");
  2216. }
  2217. }
  2218. function _possibleConstructorReturn(self2, call) {
  2219. if (!self2) {
  2220. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  2221. }
  2222. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  2223. }
  2224. function _inherits(subClass, superClass) {
  2225. if (typeof superClass !== "function" && superClass !== null) {
  2226. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  2227. }
  2228. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  2229. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  2230. }
  2231. var Code = (function(_Inline) {
  2232. _inherits(Code2, _Inline);
  2233. function Code2() {
  2234. _classCallCheck(this, Code2);
  2235. return _possibleConstructorReturn(this, (Code2.__proto__ || Object.getPrototypeOf(Code2)).apply(this, arguments));
  2236. }
  2237. return Code2;
  2238. })(_inline2.default);
  2239. Code.blotName = "code";
  2240. Code.tagName = "CODE";
  2241. var CodeBlock = (function(_Block) {
  2242. _inherits(CodeBlock2, _Block);
  2243. function CodeBlock2() {
  2244. _classCallCheck(this, CodeBlock2);
  2245. return _possibleConstructorReturn(this, (CodeBlock2.__proto__ || Object.getPrototypeOf(CodeBlock2)).apply(this, arguments));
  2246. }
  2247. _createClass(CodeBlock2, [{
  2248. key: "delta",
  2249. value: function delta() {
  2250. var _this3 = this;
  2251. var text = this.domNode.textContent;
  2252. if (text.endsWith("\n")) {
  2253. text = text.slice(0, -1);
  2254. }
  2255. return text.split("\n").reduce(function(delta2, frag) {
  2256. return delta2.insert(frag).insert("\n", _this3.formats());
  2257. }, new _quillDelta2.default());
  2258. }
  2259. }, {
  2260. key: "format",
  2261. value: function format(name, value) {
  2262. if (name === this.statics.blotName && value) return;
  2263. var _descendant = this.descendant(_text2.default, this.length() - 1), _descendant2 = _slicedToArray(_descendant, 1), text = _descendant2[0];
  2264. if (text != null) {
  2265. text.deleteAt(text.length() - 1, 1);
  2266. }
  2267. _get(CodeBlock2.prototype.__proto__ || Object.getPrototypeOf(CodeBlock2.prototype), "format", this).call(this, name, value);
  2268. }
  2269. }, {
  2270. key: "formatAt",
  2271. value: function formatAt(index, length, name, value) {
  2272. if (length === 0) return;
  2273. if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) {
  2274. return;
  2275. }
  2276. var nextNewline = this.newlineIndex(index);
  2277. if (nextNewline < 0 || nextNewline >= index + length) return;
  2278. var prevNewline = this.newlineIndex(index, true) + 1;
  2279. var isolateLength = nextNewline - prevNewline + 1;
  2280. var blot = this.isolate(prevNewline, isolateLength);
  2281. var next = blot.next;
  2282. blot.format(name, value);
  2283. if (next instanceof CodeBlock2) {
  2284. next.formatAt(0, index - prevNewline + length - isolateLength, name, value);
  2285. }
  2286. }
  2287. }, {
  2288. key: "insertAt",
  2289. value: function insertAt(index, value, def) {
  2290. if (def != null) return;
  2291. var _descendant3 = this.descendant(_text2.default, index), _descendant4 = _slicedToArray(_descendant3, 2), text = _descendant4[0], offset = _descendant4[1];
  2292. text.insertAt(offset, value);
  2293. }
  2294. }, {
  2295. key: "length",
  2296. value: function length() {
  2297. var length2 = this.domNode.textContent.length;
  2298. if (!this.domNode.textContent.endsWith("\n")) {
  2299. return length2 + 1;
  2300. }
  2301. return length2;
  2302. }
  2303. }, {
  2304. key: "newlineIndex",
  2305. value: function newlineIndex(searchIndex) {
  2306. var reverse = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
  2307. if (!reverse) {
  2308. var offset = this.domNode.textContent.slice(searchIndex).indexOf("\n");
  2309. return offset > -1 ? searchIndex + offset : -1;
  2310. } else {
  2311. return this.domNode.textContent.slice(0, searchIndex).lastIndexOf("\n");
  2312. }
  2313. }
  2314. }, {
  2315. key: "optimize",
  2316. value: function optimize(context) {
  2317. if (!this.domNode.textContent.endsWith("\n")) {
  2318. this.appendChild(_parchment2.default.create("text", "\n"));
  2319. }
  2320. _get(CodeBlock2.prototype.__proto__ || Object.getPrototypeOf(CodeBlock2.prototype), "optimize", this).call(this, context);
  2321. var next = this.next;
  2322. if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) {
  2323. next.optimize(context);
  2324. next.moveChildren(this);
  2325. next.remove();
  2326. }
  2327. }
  2328. }, {
  2329. key: "replace",
  2330. value: function replace(target) {
  2331. _get(CodeBlock2.prototype.__proto__ || Object.getPrototypeOf(CodeBlock2.prototype), "replace", this).call(this, target);
  2332. [].slice.call(this.domNode.querySelectorAll("*")).forEach(function(node) {
  2333. var blot = _parchment2.default.find(node);
  2334. if (blot == null) {
  2335. node.parentNode.removeChild(node);
  2336. } else if (blot instanceof _parchment2.default.Embed) {
  2337. blot.remove();
  2338. } else {
  2339. blot.unwrap();
  2340. }
  2341. });
  2342. }
  2343. }], [{
  2344. key: "create",
  2345. value: function create(value) {
  2346. var domNode = _get(CodeBlock2.__proto__ || Object.getPrototypeOf(CodeBlock2), "create", this).call(this, value);
  2347. domNode.setAttribute("spellcheck", false);
  2348. return domNode;
  2349. }
  2350. }, {
  2351. key: "formats",
  2352. value: function formats() {
  2353. return true;
  2354. }
  2355. }]);
  2356. return CodeBlock2;
  2357. })(_block2.default);
  2358. CodeBlock.blotName = "code-block";
  2359. CodeBlock.tagName = "PRE";
  2360. CodeBlock.TAB = " ";
  2361. exports2.Code = Code;
  2362. exports2.default = CodeBlock;
  2363. }),
  2364. /* 14 */
  2365. /***/
  2366. (function(module2, exports2, __webpack_require__) {
  2367. "use strict";
  2368. Object.defineProperty(exports2, "__esModule", {
  2369. value: true
  2370. });
  2371. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
  2372. return typeof obj;
  2373. } : function(obj) {
  2374. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  2375. };
  2376. var _slicedToArray = /* @__PURE__ */ (function() {
  2377. function sliceIterator(arr, i) {
  2378. var _arr = [];
  2379. var _n = true;
  2380. var _d = false;
  2381. var _e = void 0;
  2382. try {
  2383. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  2384. _arr.push(_s.value);
  2385. if (i && _arr.length === i) break;
  2386. }
  2387. } catch (err) {
  2388. _d = true;
  2389. _e = err;
  2390. } finally {
  2391. try {
  2392. if (!_n && _i["return"]) _i["return"]();
  2393. } finally {
  2394. if (_d) throw _e;
  2395. }
  2396. }
  2397. return _arr;
  2398. }
  2399. return function(arr, i) {
  2400. if (Array.isArray(arr)) {
  2401. return arr;
  2402. } else if (Symbol.iterator in Object(arr)) {
  2403. return sliceIterator(arr, i);
  2404. } else {
  2405. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  2406. }
  2407. };
  2408. })();
  2409. var _createClass = /* @__PURE__ */ (function() {
  2410. function defineProperties(target, props) {
  2411. for (var i = 0; i < props.length; i++) {
  2412. var descriptor = props[i];
  2413. descriptor.enumerable = descriptor.enumerable || false;
  2414. descriptor.configurable = true;
  2415. if ("value" in descriptor) descriptor.writable = true;
  2416. Object.defineProperty(target, descriptor.key, descriptor);
  2417. }
  2418. }
  2419. return function(Constructor, protoProps, staticProps) {
  2420. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  2421. if (staticProps) defineProperties(Constructor, staticProps);
  2422. return Constructor;
  2423. };
  2424. })();
  2425. var _quillDelta = __webpack_require__(2);
  2426. var _quillDelta2 = _interopRequireDefault(_quillDelta);
  2427. var _op = __webpack_require__(20);
  2428. var _op2 = _interopRequireDefault(_op);
  2429. var _parchment = __webpack_require__(0);
  2430. var _parchment2 = _interopRequireDefault(_parchment);
  2431. var _code = __webpack_require__(13);
  2432. var _code2 = _interopRequireDefault(_code);
  2433. var _cursor = __webpack_require__(24);
  2434. var _cursor2 = _interopRequireDefault(_cursor);
  2435. var _block = __webpack_require__(4);
  2436. var _block2 = _interopRequireDefault(_block);
  2437. var _break = __webpack_require__(16);
  2438. var _break2 = _interopRequireDefault(_break);
  2439. var _clone = __webpack_require__(21);
  2440. var _clone2 = _interopRequireDefault(_clone);
  2441. var _deepEqual = __webpack_require__(11);
  2442. var _deepEqual2 = _interopRequireDefault(_deepEqual);
  2443. var _extend = __webpack_require__(3);
  2444. var _extend2 = _interopRequireDefault(_extend);
  2445. function _interopRequireDefault(obj) {
  2446. return obj && obj.__esModule ? obj : { default: obj };
  2447. }
  2448. function _defineProperty(obj, key, value) {
  2449. if (key in obj) {
  2450. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  2451. } else {
  2452. obj[key] = value;
  2453. }
  2454. return obj;
  2455. }
  2456. function _classCallCheck(instance, Constructor) {
  2457. if (!(instance instanceof Constructor)) {
  2458. throw new TypeError("Cannot call a class as a function");
  2459. }
  2460. }
  2461. var ASCII = /^[ -~]*$/;
  2462. var Editor = (function() {
  2463. function Editor2(scroll) {
  2464. _classCallCheck(this, Editor2);
  2465. this.scroll = scroll;
  2466. this.delta = this.getDelta();
  2467. }
  2468. _createClass(Editor2, [{
  2469. key: "applyDelta",
  2470. value: function applyDelta(delta) {
  2471. var _this = this;
  2472. var consumeNextNewline = false;
  2473. this.scroll.update();
  2474. var scrollLength = this.scroll.length();
  2475. this.scroll.batchStart();
  2476. delta = normalizeDelta(delta);
  2477. delta.reduce(function(index, op) {
  2478. var length = op.retain || op.delete || op.insert.length || 1;
  2479. var attributes = op.attributes || {};
  2480. if (op.insert != null) {
  2481. if (typeof op.insert === "string") {
  2482. var text = op.insert;
  2483. if (text.endsWith("\n") && consumeNextNewline) {
  2484. consumeNextNewline = false;
  2485. text = text.slice(0, -1);
  2486. }
  2487. if (index >= scrollLength && !text.endsWith("\n")) {
  2488. consumeNextNewline = true;
  2489. }
  2490. _this.scroll.insertAt(index, text);
  2491. var _scroll$line = _this.scroll.line(index), _scroll$line2 = _slicedToArray(_scroll$line, 2), line = _scroll$line2[0], offset = _scroll$line2[1];
  2492. var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line));
  2493. if (line instanceof _block2.default) {
  2494. var _line$descendant = line.descendant(_parchment2.default.Leaf, offset), _line$descendant2 = _slicedToArray(_line$descendant, 1), leaf = _line$descendant2[0];
  2495. formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf));
  2496. }
  2497. attributes = _op2.default.attributes.diff(formats, attributes) || {};
  2498. } else if (_typeof(op.insert) === "object") {
  2499. var key = Object.keys(op.insert)[0];
  2500. if (key == null) return index;
  2501. _this.scroll.insertAt(index, key, op.insert[key]);
  2502. }
  2503. scrollLength += length;
  2504. }
  2505. Object.keys(attributes).forEach(function(name) {
  2506. _this.scroll.formatAt(index, length, name, attributes[name]);
  2507. });
  2508. return index + length;
  2509. }, 0);
  2510. delta.reduce(function(index, op) {
  2511. if (typeof op.delete === "number") {
  2512. _this.scroll.deleteAt(index, op.delete);
  2513. return index;
  2514. }
  2515. return index + (op.retain || op.insert.length || 1);
  2516. }, 0);
  2517. this.scroll.batchEnd();
  2518. return this.update(delta);
  2519. }
  2520. }, {
  2521. key: "deleteText",
  2522. value: function deleteText(index, length) {
  2523. this.scroll.deleteAt(index, length);
  2524. return this.update(new _quillDelta2.default().retain(index).delete(length));
  2525. }
  2526. }, {
  2527. key: "formatLine",
  2528. value: function formatLine(index, length) {
  2529. var _this2 = this;
  2530. var formats = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  2531. this.scroll.update();
  2532. Object.keys(formats).forEach(function(format) {
  2533. if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format]) return;
  2534. var lines = _this2.scroll.lines(index, Math.max(length, 1));
  2535. var lengthRemaining = length;
  2536. lines.forEach(function(line) {
  2537. var lineLength = line.length();
  2538. if (!(line instanceof _code2.default)) {
  2539. line.format(format, formats[format]);
  2540. } else {
  2541. var codeIndex = index - line.offset(_this2.scroll);
  2542. var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1;
  2543. line.formatAt(codeIndex, codeLength, format, formats[format]);
  2544. }
  2545. lengthRemaining -= lineLength;
  2546. });
  2547. });
  2548. this.scroll.optimize();
  2549. return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));
  2550. }
  2551. }, {
  2552. key: "formatText",
  2553. value: function formatText(index, length) {
  2554. var _this3 = this;
  2555. var formats = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  2556. Object.keys(formats).forEach(function(format) {
  2557. _this3.scroll.formatAt(index, length, format, formats[format]);
  2558. });
  2559. return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));
  2560. }
  2561. }, {
  2562. key: "getContents",
  2563. value: function getContents(index, length) {
  2564. return this.delta.slice(index, index + length);
  2565. }
  2566. }, {
  2567. key: "getDelta",
  2568. value: function getDelta() {
  2569. return this.scroll.lines().reduce(function(delta, line) {
  2570. return delta.concat(line.delta());
  2571. }, new _quillDelta2.default());
  2572. }
  2573. }, {
  2574. key: "getFormat",
  2575. value: function getFormat(index) {
  2576. var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
  2577. var lines = [], leaves = [];
  2578. if (length === 0) {
  2579. this.scroll.path(index).forEach(function(path) {
  2580. var _path = _slicedToArray(path, 1), blot = _path[0];
  2581. if (blot instanceof _block2.default) {
  2582. lines.push(blot);
  2583. } else if (blot instanceof _parchment2.default.Leaf) {
  2584. leaves.push(blot);
  2585. }
  2586. });
  2587. } else {
  2588. lines = this.scroll.lines(index, length);
  2589. leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length);
  2590. }
  2591. var formatsArr = [lines, leaves].map(function(blots) {
  2592. if (blots.length === 0) return {};
  2593. var formats = (0, _block.bubbleFormats)(blots.shift());
  2594. while (Object.keys(formats).length > 0) {
  2595. var blot = blots.shift();
  2596. if (blot == null) return formats;
  2597. formats = combineFormats((0, _block.bubbleFormats)(blot), formats);
  2598. }
  2599. return formats;
  2600. });
  2601. return _extend2.default.apply(_extend2.default, formatsArr);
  2602. }
  2603. }, {
  2604. key: "getText",
  2605. value: function getText(index, length) {
  2606. return this.getContents(index, length).filter(function(op) {
  2607. return typeof op.insert === "string";
  2608. }).map(function(op) {
  2609. return op.insert;
  2610. }).join("");
  2611. }
  2612. }, {
  2613. key: "insertEmbed",
  2614. value: function insertEmbed(index, embed, value) {
  2615. this.scroll.insertAt(index, embed, value);
  2616. return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value)));
  2617. }
  2618. }, {
  2619. key: "insertText",
  2620. value: function insertText(index, text) {
  2621. var _this4 = this;
  2622. var formats = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  2623. text = text.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
  2624. this.scroll.insertAt(index, text);
  2625. Object.keys(formats).forEach(function(format) {
  2626. _this4.scroll.formatAt(index, text.length, format, formats[format]);
  2627. });
  2628. return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats)));
  2629. }
  2630. }, {
  2631. key: "isBlank",
  2632. value: function isBlank() {
  2633. if (this.scroll.children.length == 0) return true;
  2634. if (this.scroll.children.length > 1) return false;
  2635. var block = this.scroll.children.head;
  2636. if (block.statics.blotName !== _block2.default.blotName) return false;
  2637. if (block.children.length > 1) return false;
  2638. return block.children.head instanceof _break2.default;
  2639. }
  2640. }, {
  2641. key: "removeFormat",
  2642. value: function removeFormat(index, length) {
  2643. var text = this.getText(index, length);
  2644. var _scroll$line3 = this.scroll.line(index + length), _scroll$line4 = _slicedToArray(_scroll$line3, 2), line = _scroll$line4[0], offset = _scroll$line4[1];
  2645. var suffixLength = 0, suffix = new _quillDelta2.default();
  2646. if (line != null) {
  2647. if (!(line instanceof _code2.default)) {
  2648. suffixLength = line.length() - offset;
  2649. } else {
  2650. suffixLength = line.newlineIndex(offset) - offset + 1;
  2651. }
  2652. suffix = line.delta().slice(offset, offset + suffixLength - 1).insert("\n");
  2653. }
  2654. var contents = this.getContents(index, length + suffixLength);
  2655. var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix));
  2656. var delta = new _quillDelta2.default().retain(index).concat(diff);
  2657. return this.applyDelta(delta);
  2658. }
  2659. }, {
  2660. key: "update",
  2661. value: function update(change) {
  2662. var mutations = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
  2663. var cursorIndex = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0;
  2664. var oldDelta = this.delta;
  2665. if (mutations.length === 1 && mutations[0].type === "characterData" && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) {
  2666. var textBlot = _parchment2.default.find(mutations[0].target);
  2667. var formats = (0, _block.bubbleFormats)(textBlot);
  2668. var index = textBlot.offset(this.scroll);
  2669. var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, "");
  2670. var oldText = new _quillDelta2.default().insert(oldValue);
  2671. var newText = new _quillDelta2.default().insert(textBlot.value());
  2672. var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex));
  2673. change = diffDelta.reduce(function(delta, op) {
  2674. if (op.insert) {
  2675. return delta.insert(op.insert, formats);
  2676. } else {
  2677. return delta.push(op);
  2678. }
  2679. }, new _quillDelta2.default());
  2680. this.delta = oldDelta.compose(change);
  2681. } else {
  2682. this.delta = this.getDelta();
  2683. if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) {
  2684. change = oldDelta.diff(this.delta, cursorIndex);
  2685. }
  2686. }
  2687. return change;
  2688. }
  2689. }]);
  2690. return Editor2;
  2691. })();
  2692. function combineFormats(formats, combined) {
  2693. return Object.keys(combined).reduce(function(merged, name) {
  2694. if (formats[name] == null) return merged;
  2695. if (combined[name] === formats[name]) {
  2696. merged[name] = combined[name];
  2697. } else if (Array.isArray(combined[name])) {
  2698. if (combined[name].indexOf(formats[name]) < 0) {
  2699. merged[name] = combined[name].concat([formats[name]]);
  2700. }
  2701. } else {
  2702. merged[name] = [combined[name], formats[name]];
  2703. }
  2704. return merged;
  2705. }, {});
  2706. }
  2707. function normalizeDelta(delta) {
  2708. return delta.reduce(function(delta2, op) {
  2709. if (op.insert === 1) {
  2710. var attributes = (0, _clone2.default)(op.attributes);
  2711. delete attributes["image"];
  2712. return delta2.insert({ image: op.attributes.image }, attributes);
  2713. }
  2714. if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) {
  2715. op = (0, _clone2.default)(op);
  2716. if (op.attributes.list) {
  2717. op.attributes.list = "ordered";
  2718. } else {
  2719. op.attributes.list = "bullet";
  2720. delete op.attributes.bullet;
  2721. }
  2722. }
  2723. if (typeof op.insert === "string") {
  2724. var text = op.insert.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
  2725. return delta2.insert(text, op.attributes);
  2726. }
  2727. return delta2.push(op);
  2728. }, new _quillDelta2.default());
  2729. }
  2730. exports2.default = Editor;
  2731. }),
  2732. /* 15 */
  2733. /***/
  2734. (function(module2, exports2, __webpack_require__) {
  2735. "use strict";
  2736. Object.defineProperty(exports2, "__esModule", {
  2737. value: true
  2738. });
  2739. exports2.default = exports2.Range = void 0;
  2740. var _slicedToArray = /* @__PURE__ */ (function() {
  2741. function sliceIterator(arr, i) {
  2742. var _arr = [];
  2743. var _n = true;
  2744. var _d = false;
  2745. var _e = void 0;
  2746. try {
  2747. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  2748. _arr.push(_s.value);
  2749. if (i && _arr.length === i) break;
  2750. }
  2751. } catch (err) {
  2752. _d = true;
  2753. _e = err;
  2754. } finally {
  2755. try {
  2756. if (!_n && _i["return"]) _i["return"]();
  2757. } finally {
  2758. if (_d) throw _e;
  2759. }
  2760. }
  2761. return _arr;
  2762. }
  2763. return function(arr, i) {
  2764. if (Array.isArray(arr)) {
  2765. return arr;
  2766. } else if (Symbol.iterator in Object(arr)) {
  2767. return sliceIterator(arr, i);
  2768. } else {
  2769. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  2770. }
  2771. };
  2772. })();
  2773. var _createClass = /* @__PURE__ */ (function() {
  2774. function defineProperties(target, props) {
  2775. for (var i = 0; i < props.length; i++) {
  2776. var descriptor = props[i];
  2777. descriptor.enumerable = descriptor.enumerable || false;
  2778. descriptor.configurable = true;
  2779. if ("value" in descriptor) descriptor.writable = true;
  2780. Object.defineProperty(target, descriptor.key, descriptor);
  2781. }
  2782. }
  2783. return function(Constructor, protoProps, staticProps) {
  2784. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  2785. if (staticProps) defineProperties(Constructor, staticProps);
  2786. return Constructor;
  2787. };
  2788. })();
  2789. var _parchment = __webpack_require__(0);
  2790. var _parchment2 = _interopRequireDefault(_parchment);
  2791. var _clone = __webpack_require__(21);
  2792. var _clone2 = _interopRequireDefault(_clone);
  2793. var _deepEqual = __webpack_require__(11);
  2794. var _deepEqual2 = _interopRequireDefault(_deepEqual);
  2795. var _emitter3 = __webpack_require__(8);
  2796. var _emitter4 = _interopRequireDefault(_emitter3);
  2797. var _logger = __webpack_require__(10);
  2798. var _logger2 = _interopRequireDefault(_logger);
  2799. function _interopRequireDefault(obj) {
  2800. return obj && obj.__esModule ? obj : { default: obj };
  2801. }
  2802. function _toConsumableArray(arr) {
  2803. if (Array.isArray(arr)) {
  2804. for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
  2805. arr2[i] = arr[i];
  2806. }
  2807. return arr2;
  2808. } else {
  2809. return Array.from(arr);
  2810. }
  2811. }
  2812. function _classCallCheck(instance, Constructor) {
  2813. if (!(instance instanceof Constructor)) {
  2814. throw new TypeError("Cannot call a class as a function");
  2815. }
  2816. }
  2817. var debug = (0, _logger2.default)("quill:selection");
  2818. var Range = function Range2(index) {
  2819. var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
  2820. _classCallCheck(this, Range2);
  2821. this.index = index;
  2822. this.length = length;
  2823. };
  2824. var Selection = (function() {
  2825. function Selection2(scroll, emitter) {
  2826. var _this = this;
  2827. _classCallCheck(this, Selection2);
  2828. this.emitter = emitter;
  2829. this.scroll = scroll;
  2830. this.composing = false;
  2831. this.mouseDown = false;
  2832. this.root = this.scroll.domNode;
  2833. this.cursor = _parchment2.default.create("cursor", this);
  2834. this.lastRange = this.savedRange = new Range(0, 0);
  2835. this.handleComposition();
  2836. this.handleDragging();
  2837. this.emitter.listenDOM("selectionchange", document, function() {
  2838. if (!_this.mouseDown) {
  2839. setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1);
  2840. }
  2841. });
  2842. this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function(type, delta) {
  2843. if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) {
  2844. _this.update(_emitter4.default.sources.SILENT);
  2845. }
  2846. });
  2847. this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function() {
  2848. if (!_this.hasFocus()) return;
  2849. var native = _this.getNativeRange();
  2850. if (native == null) return;
  2851. if (native.start.node === _this.cursor.textNode) return;
  2852. _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function() {
  2853. try {
  2854. _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset);
  2855. } catch (ignored) {
  2856. }
  2857. });
  2858. });
  2859. this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function(mutations, context) {
  2860. if (context.range) {
  2861. var _context$range = context.range, startNode = _context$range.startNode, startOffset = _context$range.startOffset, endNode = _context$range.endNode, endOffset = _context$range.endOffset;
  2862. _this.setNativeRange(startNode, startOffset, endNode, endOffset);
  2863. }
  2864. });
  2865. this.update(_emitter4.default.sources.SILENT);
  2866. }
  2867. _createClass(Selection2, [{
  2868. key: "handleComposition",
  2869. value: function handleComposition() {
  2870. var _this2 = this;
  2871. this.root.addEventListener("compositionstart", function() {
  2872. _this2.composing = true;
  2873. });
  2874. this.root.addEventListener("compositionend", function() {
  2875. _this2.composing = false;
  2876. if (_this2.cursor.parent) {
  2877. var range = _this2.cursor.restore();
  2878. if (!range) return;
  2879. setTimeout(function() {
  2880. _this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset);
  2881. }, 1);
  2882. }
  2883. });
  2884. }
  2885. }, {
  2886. key: "handleDragging",
  2887. value: function handleDragging() {
  2888. var _this3 = this;
  2889. this.emitter.listenDOM("mousedown", document.body, function() {
  2890. _this3.mouseDown = true;
  2891. });
  2892. this.emitter.listenDOM("mouseup", document.body, function() {
  2893. _this3.mouseDown = false;
  2894. _this3.update(_emitter4.default.sources.USER);
  2895. });
  2896. }
  2897. }, {
  2898. key: "focus",
  2899. value: function focus() {
  2900. if (this.hasFocus()) return;
  2901. this.root.focus();
  2902. this.setRange(this.savedRange);
  2903. }
  2904. }, {
  2905. key: "format",
  2906. value: function format(_format, value) {
  2907. if (this.scroll.whitelist != null && !this.scroll.whitelist[_format]) return;
  2908. this.scroll.update();
  2909. var nativeRange = this.getNativeRange();
  2910. if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return;
  2911. if (nativeRange.start.node !== this.cursor.textNode) {
  2912. var blot = _parchment2.default.find(nativeRange.start.node, false);
  2913. if (blot == null) return;
  2914. if (blot instanceof _parchment2.default.Leaf) {
  2915. var after = blot.split(nativeRange.start.offset);
  2916. blot.parent.insertBefore(this.cursor, after);
  2917. } else {
  2918. blot.insertBefore(this.cursor, nativeRange.start.node);
  2919. }
  2920. this.cursor.attach();
  2921. }
  2922. this.cursor.format(_format, value);
  2923. this.scroll.optimize();
  2924. this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);
  2925. this.update();
  2926. }
  2927. }, {
  2928. key: "getBounds",
  2929. value: function getBounds(index) {
  2930. var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
  2931. var scrollLength = this.scroll.length();
  2932. index = Math.min(index, scrollLength - 1);
  2933. length = Math.min(index + length, scrollLength - 1) - index;
  2934. var node = void 0, _scroll$leaf = this.scroll.leaf(index), _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2), leaf = _scroll$leaf2[0], offset = _scroll$leaf2[1];
  2935. if (leaf == null) return null;
  2936. var _leaf$position = leaf.position(offset, true);
  2937. var _leaf$position2 = _slicedToArray(_leaf$position, 2);
  2938. node = _leaf$position2[0];
  2939. offset = _leaf$position2[1];
  2940. var range = document.createRange();
  2941. if (length > 0) {
  2942. range.setStart(node, offset);
  2943. var _scroll$leaf3 = this.scroll.leaf(index + length);
  2944. var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2);
  2945. leaf = _scroll$leaf4[0];
  2946. offset = _scroll$leaf4[1];
  2947. if (leaf == null) return null;
  2948. var _leaf$position3 = leaf.position(offset, true);
  2949. var _leaf$position4 = _slicedToArray(_leaf$position3, 2);
  2950. node = _leaf$position4[0];
  2951. offset = _leaf$position4[1];
  2952. range.setEnd(node, offset);
  2953. return range.getBoundingClientRect();
  2954. } else {
  2955. var side = "left";
  2956. var rect = void 0;
  2957. if (node instanceof Text) {
  2958. if (offset < node.data.length) {
  2959. range.setStart(node, offset);
  2960. range.setEnd(node, offset + 1);
  2961. } else {
  2962. range.setStart(node, offset - 1);
  2963. range.setEnd(node, offset);
  2964. side = "right";
  2965. }
  2966. rect = range.getBoundingClientRect();
  2967. } else {
  2968. rect = leaf.domNode.getBoundingClientRect();
  2969. if (offset > 0) side = "right";
  2970. }
  2971. return {
  2972. bottom: rect.top + rect.height,
  2973. height: rect.height,
  2974. left: rect[side],
  2975. right: rect[side],
  2976. top: rect.top,
  2977. width: 0
  2978. };
  2979. }
  2980. }
  2981. }, {
  2982. key: "getNativeRange",
  2983. value: function getNativeRange() {
  2984. var selection = document.getSelection();
  2985. if (selection == null || selection.rangeCount <= 0) return null;
  2986. var nativeRange = selection.getRangeAt(0);
  2987. if (nativeRange == null) return null;
  2988. var range = this.normalizeNative(nativeRange);
  2989. debug.info("getNativeRange", range);
  2990. return range;
  2991. }
  2992. }, {
  2993. key: "getRange",
  2994. value: function getRange() {
  2995. var normalized = this.getNativeRange();
  2996. if (normalized == null) return [null, null];
  2997. var range = this.normalizedToRange(normalized);
  2998. return [range, normalized];
  2999. }
  3000. }, {
  3001. key: "hasFocus",
  3002. value: function hasFocus() {
  3003. return document.activeElement === this.root;
  3004. }
  3005. }, {
  3006. key: "normalizedToRange",
  3007. value: function normalizedToRange(range) {
  3008. var _this4 = this;
  3009. var positions = [[range.start.node, range.start.offset]];
  3010. if (!range.native.collapsed) {
  3011. positions.push([range.end.node, range.end.offset]);
  3012. }
  3013. var indexes = positions.map(function(position) {
  3014. var _position = _slicedToArray(position, 2), node = _position[0], offset = _position[1];
  3015. var blot = _parchment2.default.find(node, true);
  3016. var index = blot.offset(_this4.scroll);
  3017. if (offset === 0) {
  3018. return index;
  3019. } else if (blot instanceof _parchment2.default.Container) {
  3020. return index + blot.length();
  3021. } else {
  3022. return index + blot.index(node, offset);
  3023. }
  3024. });
  3025. var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1);
  3026. var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes)));
  3027. return new Range(start, end - start);
  3028. }
  3029. }, {
  3030. key: "normalizeNative",
  3031. value: function normalizeNative(nativeRange) {
  3032. if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) {
  3033. return null;
  3034. }
  3035. var range = {
  3036. start: { node: nativeRange.startContainer, offset: nativeRange.startOffset },
  3037. end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },
  3038. native: nativeRange
  3039. };
  3040. [range.start, range.end].forEach(function(position) {
  3041. var node = position.node, offset = position.offset;
  3042. while (!(node instanceof Text) && node.childNodes.length > 0) {
  3043. if (node.childNodes.length > offset) {
  3044. node = node.childNodes[offset];
  3045. offset = 0;
  3046. } else if (node.childNodes.length === offset) {
  3047. node = node.lastChild;
  3048. offset = node instanceof Text ? node.data.length : node.childNodes.length + 1;
  3049. } else {
  3050. break;
  3051. }
  3052. }
  3053. position.node = node, position.offset = offset;
  3054. });
  3055. return range;
  3056. }
  3057. }, {
  3058. key: "rangeToNative",
  3059. value: function rangeToNative(range) {
  3060. var _this5 = this;
  3061. var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length];
  3062. var args = [];
  3063. var scrollLength = this.scroll.length();
  3064. indexes.forEach(function(index, i) {
  3065. index = Math.min(scrollLength - 1, index);
  3066. var node = void 0, _scroll$leaf5 = _this5.scroll.leaf(index), _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2), leaf = _scroll$leaf6[0], offset = _scroll$leaf6[1];
  3067. var _leaf$position5 = leaf.position(offset, i !== 0);
  3068. var _leaf$position6 = _slicedToArray(_leaf$position5, 2);
  3069. node = _leaf$position6[0];
  3070. offset = _leaf$position6[1];
  3071. args.push(node, offset);
  3072. });
  3073. if (args.length < 2) {
  3074. args = args.concat(args);
  3075. }
  3076. return args;
  3077. }
  3078. }, {
  3079. key: "scrollIntoView",
  3080. value: function scrollIntoView(scrollingContainer) {
  3081. var range = this.lastRange;
  3082. if (range == null) return;
  3083. var bounds = this.getBounds(range.index, range.length);
  3084. if (bounds == null) return;
  3085. var limit = this.scroll.length() - 1;
  3086. var _scroll$line = this.scroll.line(Math.min(range.index, limit)), _scroll$line2 = _slicedToArray(_scroll$line, 1), first = _scroll$line2[0];
  3087. var last = first;
  3088. if (range.length > 0) {
  3089. var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit));
  3090. var _scroll$line4 = _slicedToArray(_scroll$line3, 1);
  3091. last = _scroll$line4[0];
  3092. }
  3093. if (first == null || last == null) return;
  3094. var scrollBounds = scrollingContainer.getBoundingClientRect();
  3095. if (bounds.top < scrollBounds.top) {
  3096. scrollingContainer.scrollTop -= scrollBounds.top - bounds.top;
  3097. } else if (bounds.bottom > scrollBounds.bottom) {
  3098. scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom;
  3099. }
  3100. }
  3101. }, {
  3102. key: "setNativeRange",
  3103. value: function setNativeRange(startNode, startOffset) {
  3104. var endNode = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : startNode;
  3105. var endOffset = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : startOffset;
  3106. var force = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
  3107. debug.info("setNativeRange", startNode, startOffset, endNode, endOffset);
  3108. if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) {
  3109. return;
  3110. }
  3111. var selection = document.getSelection();
  3112. if (selection == null) return;
  3113. if (startNode != null) {
  3114. if (!this.hasFocus()) this.root.focus();
  3115. var native = (this.getNativeRange() || {}).native;
  3116. if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) {
  3117. if (startNode.tagName == "BR") {
  3118. startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode);
  3119. startNode = startNode.parentNode;
  3120. }
  3121. if (endNode.tagName == "BR") {
  3122. endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode);
  3123. endNode = endNode.parentNode;
  3124. }
  3125. var range = document.createRange();
  3126. range.setStart(startNode, startOffset);
  3127. range.setEnd(endNode, endOffset);
  3128. selection.removeAllRanges();
  3129. selection.addRange(range);
  3130. }
  3131. } else {
  3132. selection.removeAllRanges();
  3133. this.root.blur();
  3134. document.body.focus();
  3135. }
  3136. }
  3137. }, {
  3138. key: "setRange",
  3139. value: function setRange(range) {
  3140. var force = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
  3141. var source = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _emitter4.default.sources.API;
  3142. if (typeof force === "string") {
  3143. source = force;
  3144. force = false;
  3145. }
  3146. debug.info("setRange", range);
  3147. if (range != null) {
  3148. var args = this.rangeToNative(range);
  3149. this.setNativeRange.apply(this, _toConsumableArray(args).concat([force]));
  3150. } else {
  3151. this.setNativeRange(null);
  3152. }
  3153. this.update(source);
  3154. }
  3155. }, {
  3156. key: "update",
  3157. value: function update() {
  3158. var source = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _emitter4.default.sources.USER;
  3159. var oldRange = this.lastRange;
  3160. var _getRange = this.getRange(), _getRange2 = _slicedToArray(_getRange, 2), lastRange = _getRange2[0], nativeRange = _getRange2[1];
  3161. this.lastRange = lastRange;
  3162. if (this.lastRange != null) {
  3163. this.savedRange = this.lastRange;
  3164. }
  3165. if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) {
  3166. var _emitter;
  3167. if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {
  3168. this.cursor.restore();
  3169. }
  3170. var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source];
  3171. (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));
  3172. if (source !== _emitter4.default.sources.SILENT) {
  3173. var _emitter2;
  3174. (_emitter2 = this.emitter).emit.apply(_emitter2, args);
  3175. }
  3176. }
  3177. }
  3178. }]);
  3179. return Selection2;
  3180. })();
  3181. function contains(parent, descendant) {
  3182. try {
  3183. descendant.parentNode;
  3184. } catch (e) {
  3185. return false;
  3186. }
  3187. if (descendant instanceof Text) {
  3188. descendant = descendant.parentNode;
  3189. }
  3190. return parent.contains(descendant);
  3191. }
  3192. exports2.Range = Range;
  3193. exports2.default = Selection;
  3194. }),
  3195. /* 16 */
  3196. /***/
  3197. (function(module2, exports2, __webpack_require__) {
  3198. "use strict";
  3199. Object.defineProperty(exports2, "__esModule", {
  3200. value: true
  3201. });
  3202. var _createClass = /* @__PURE__ */ (function() {
  3203. function defineProperties(target, props) {
  3204. for (var i = 0; i < props.length; i++) {
  3205. var descriptor = props[i];
  3206. descriptor.enumerable = descriptor.enumerable || false;
  3207. descriptor.configurable = true;
  3208. if ("value" in descriptor) descriptor.writable = true;
  3209. Object.defineProperty(target, descriptor.key, descriptor);
  3210. }
  3211. }
  3212. return function(Constructor, protoProps, staticProps) {
  3213. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  3214. if (staticProps) defineProperties(Constructor, staticProps);
  3215. return Constructor;
  3216. };
  3217. })();
  3218. var _get = function get(object, property, receiver) {
  3219. if (object === null) object = Function.prototype;
  3220. var desc = Object.getOwnPropertyDescriptor(object, property);
  3221. if (desc === void 0) {
  3222. var parent = Object.getPrototypeOf(object);
  3223. if (parent === null) {
  3224. return void 0;
  3225. } else {
  3226. return get(parent, property, receiver);
  3227. }
  3228. } else if ("value" in desc) {
  3229. return desc.value;
  3230. } else {
  3231. var getter = desc.get;
  3232. if (getter === void 0) {
  3233. return void 0;
  3234. }
  3235. return getter.call(receiver);
  3236. }
  3237. };
  3238. var _parchment = __webpack_require__(0);
  3239. var _parchment2 = _interopRequireDefault(_parchment);
  3240. function _interopRequireDefault(obj) {
  3241. return obj && obj.__esModule ? obj : { default: obj };
  3242. }
  3243. function _classCallCheck(instance, Constructor) {
  3244. if (!(instance instanceof Constructor)) {
  3245. throw new TypeError("Cannot call a class as a function");
  3246. }
  3247. }
  3248. function _possibleConstructorReturn(self2, call) {
  3249. if (!self2) {
  3250. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  3251. }
  3252. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  3253. }
  3254. function _inherits(subClass, superClass) {
  3255. if (typeof superClass !== "function" && superClass !== null) {
  3256. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  3257. }
  3258. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  3259. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  3260. }
  3261. var Break = (function(_Parchment$Embed) {
  3262. _inherits(Break2, _Parchment$Embed);
  3263. function Break2() {
  3264. _classCallCheck(this, Break2);
  3265. return _possibleConstructorReturn(this, (Break2.__proto__ || Object.getPrototypeOf(Break2)).apply(this, arguments));
  3266. }
  3267. _createClass(Break2, [{
  3268. key: "insertInto",
  3269. value: function insertInto(parent, ref2) {
  3270. if (parent.children.length === 0) {
  3271. _get(Break2.prototype.__proto__ || Object.getPrototypeOf(Break2.prototype), "insertInto", this).call(this, parent, ref2);
  3272. } else {
  3273. this.remove();
  3274. }
  3275. }
  3276. }, {
  3277. key: "length",
  3278. value: function length() {
  3279. return 0;
  3280. }
  3281. }, {
  3282. key: "value",
  3283. value: function value() {
  3284. return "";
  3285. }
  3286. }], [{
  3287. key: "value",
  3288. value: function value() {
  3289. return void 0;
  3290. }
  3291. }]);
  3292. return Break2;
  3293. })(_parchment2.default.Embed);
  3294. Break.blotName = "break";
  3295. Break.tagName = "BR";
  3296. exports2.default = Break;
  3297. }),
  3298. /* 17 */
  3299. /***/
  3300. (function(module2, exports2, __webpack_require__) {
  3301. "use strict";
  3302. var __extends = this && this.__extends || (function() {
  3303. var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
  3304. d.__proto__ = b;
  3305. } || function(d, b) {
  3306. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  3307. };
  3308. return function(d, b) {
  3309. extendStatics(d, b);
  3310. function __() {
  3311. this.constructor = d;
  3312. }
  3313. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3314. };
  3315. })();
  3316. Object.defineProperty(exports2, "__esModule", { value: true });
  3317. var linked_list_1 = __webpack_require__(44);
  3318. var shadow_1 = __webpack_require__(30);
  3319. var Registry = __webpack_require__(1);
  3320. var ContainerBlot = (
  3321. /** @class */
  3322. (function(_super) {
  3323. __extends(ContainerBlot2, _super);
  3324. function ContainerBlot2(domNode) {
  3325. var _this = _super.call(this, domNode) || this;
  3326. _this.build();
  3327. return _this;
  3328. }
  3329. ContainerBlot2.prototype.appendChild = function(other) {
  3330. this.insertBefore(other);
  3331. };
  3332. ContainerBlot2.prototype.attach = function() {
  3333. _super.prototype.attach.call(this);
  3334. this.children.forEach(function(child) {
  3335. child.attach();
  3336. });
  3337. };
  3338. ContainerBlot2.prototype.build = function() {
  3339. var _this = this;
  3340. this.children = new linked_list_1.default();
  3341. [].slice.call(this.domNode.childNodes).reverse().forEach(function(node) {
  3342. try {
  3343. var child = makeBlot(node);
  3344. _this.insertBefore(child, _this.children.head || void 0);
  3345. } catch (err) {
  3346. if (err instanceof Registry.ParchmentError)
  3347. return;
  3348. else
  3349. throw err;
  3350. }
  3351. });
  3352. };
  3353. ContainerBlot2.prototype.deleteAt = function(index, length) {
  3354. if (index === 0 && length === this.length()) {
  3355. return this.remove();
  3356. }
  3357. this.children.forEachAt(index, length, function(child, offset, length2) {
  3358. child.deleteAt(offset, length2);
  3359. });
  3360. };
  3361. ContainerBlot2.prototype.descendant = function(criteria, index) {
  3362. var _a = this.children.find(index), child = _a[0], offset = _a[1];
  3363. if (criteria.blotName == null && criteria(child) || criteria.blotName != null && child instanceof criteria) {
  3364. return [child, offset];
  3365. } else if (child instanceof ContainerBlot2) {
  3366. return child.descendant(criteria, offset);
  3367. } else {
  3368. return [null, -1];
  3369. }
  3370. };
  3371. ContainerBlot2.prototype.descendants = function(criteria, index, length) {
  3372. if (index === void 0) {
  3373. index = 0;
  3374. }
  3375. if (length === void 0) {
  3376. length = Number.MAX_VALUE;
  3377. }
  3378. var descendants = [];
  3379. var lengthLeft = length;
  3380. this.children.forEachAt(index, length, function(child, index2, length2) {
  3381. if (criteria.blotName == null && criteria(child) || criteria.blotName != null && child instanceof criteria) {
  3382. descendants.push(child);
  3383. }
  3384. if (child instanceof ContainerBlot2) {
  3385. descendants = descendants.concat(child.descendants(criteria, index2, lengthLeft));
  3386. }
  3387. lengthLeft -= length2;
  3388. });
  3389. return descendants;
  3390. };
  3391. ContainerBlot2.prototype.detach = function() {
  3392. this.children.forEach(function(child) {
  3393. child.detach();
  3394. });
  3395. _super.prototype.detach.call(this);
  3396. };
  3397. ContainerBlot2.prototype.formatAt = function(index, length, name, value) {
  3398. this.children.forEachAt(index, length, function(child, offset, length2) {
  3399. child.formatAt(offset, length2, name, value);
  3400. });
  3401. };
  3402. ContainerBlot2.prototype.insertAt = function(index, value, def) {
  3403. var _a = this.children.find(index), child = _a[0], offset = _a[1];
  3404. if (child) {
  3405. child.insertAt(offset, value, def);
  3406. } else {
  3407. var blot = def == null ? Registry.create("text", value) : Registry.create(value, def);
  3408. this.appendChild(blot);
  3409. }
  3410. };
  3411. ContainerBlot2.prototype.insertBefore = function(childBlot, refBlot) {
  3412. if (this.statics.allowedChildren != null && !this.statics.allowedChildren.some(function(child) {
  3413. return childBlot instanceof child;
  3414. })) {
  3415. throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName);
  3416. }
  3417. childBlot.insertInto(this, refBlot);
  3418. };
  3419. ContainerBlot2.prototype.length = function() {
  3420. return this.children.reduce(function(memo, child) {
  3421. return memo + child.length();
  3422. }, 0);
  3423. };
  3424. ContainerBlot2.prototype.moveChildren = function(targetParent, refNode) {
  3425. this.children.forEach(function(child) {
  3426. targetParent.insertBefore(child, refNode);
  3427. });
  3428. };
  3429. ContainerBlot2.prototype.optimize = function(context) {
  3430. _super.prototype.optimize.call(this, context);
  3431. if (this.children.length === 0) {
  3432. if (this.statics.defaultChild != null) {
  3433. var child = Registry.create(this.statics.defaultChild);
  3434. this.appendChild(child);
  3435. child.optimize(context);
  3436. } else {
  3437. this.remove();
  3438. }
  3439. }
  3440. };
  3441. ContainerBlot2.prototype.path = function(index, inclusive) {
  3442. if (inclusive === void 0) {
  3443. inclusive = false;
  3444. }
  3445. var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1];
  3446. var position = [[this, index]];
  3447. if (child instanceof ContainerBlot2) {
  3448. return position.concat(child.path(offset, inclusive));
  3449. } else if (child != null) {
  3450. position.push([child, offset]);
  3451. }
  3452. return position;
  3453. };
  3454. ContainerBlot2.prototype.removeChild = function(child) {
  3455. this.children.remove(child);
  3456. };
  3457. ContainerBlot2.prototype.replace = function(target) {
  3458. if (target instanceof ContainerBlot2) {
  3459. target.moveChildren(this);
  3460. }
  3461. _super.prototype.replace.call(this, target);
  3462. };
  3463. ContainerBlot2.prototype.split = function(index, force) {
  3464. if (force === void 0) {
  3465. force = false;
  3466. }
  3467. if (!force) {
  3468. if (index === 0)
  3469. return this;
  3470. if (index === this.length())
  3471. return this.next;
  3472. }
  3473. var after = this.clone();
  3474. this.parent.insertBefore(after, this.next);
  3475. this.children.forEachAt(index, this.length(), function(child, offset, length) {
  3476. child = child.split(offset, force);
  3477. after.appendChild(child);
  3478. });
  3479. return after;
  3480. };
  3481. ContainerBlot2.prototype.unwrap = function() {
  3482. this.moveChildren(this.parent, this.next);
  3483. this.remove();
  3484. };
  3485. ContainerBlot2.prototype.update = function(mutations, context) {
  3486. var _this = this;
  3487. var addedNodes = [];
  3488. var removedNodes = [];
  3489. mutations.forEach(function(mutation) {
  3490. if (mutation.target === _this.domNode && mutation.type === "childList") {
  3491. addedNodes.push.apply(addedNodes, mutation.addedNodes);
  3492. removedNodes.push.apply(removedNodes, mutation.removedNodes);
  3493. }
  3494. });
  3495. removedNodes.forEach(function(node) {
  3496. if (node.parentNode != null && // @ts-ignore
  3497. node.tagName !== "IFRAME" && document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {
  3498. return;
  3499. }
  3500. var blot = Registry.find(node);
  3501. if (blot == null)
  3502. return;
  3503. if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) {
  3504. blot.detach();
  3505. }
  3506. });
  3507. addedNodes.filter(function(node) {
  3508. return node.parentNode == _this.domNode;
  3509. }).sort(function(a, b) {
  3510. if (a === b)
  3511. return 0;
  3512. if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {
  3513. return 1;
  3514. }
  3515. return -1;
  3516. }).forEach(function(node) {
  3517. var refBlot = null;
  3518. if (node.nextSibling != null) {
  3519. refBlot = Registry.find(node.nextSibling);
  3520. }
  3521. var blot = makeBlot(node);
  3522. if (blot.next != refBlot || blot.next == null) {
  3523. if (blot.parent != null) {
  3524. blot.parent.removeChild(_this);
  3525. }
  3526. _this.insertBefore(blot, refBlot || void 0);
  3527. }
  3528. });
  3529. };
  3530. return ContainerBlot2;
  3531. })(shadow_1.default)
  3532. );
  3533. function makeBlot(node) {
  3534. var blot = Registry.find(node);
  3535. if (blot == null) {
  3536. try {
  3537. blot = Registry.create(node);
  3538. } catch (e) {
  3539. blot = Registry.create(Registry.Scope.INLINE);
  3540. [].slice.call(node.childNodes).forEach(function(child) {
  3541. blot.domNode.appendChild(child);
  3542. });
  3543. if (node.parentNode) {
  3544. node.parentNode.replaceChild(blot.domNode, node);
  3545. }
  3546. blot.attach();
  3547. }
  3548. }
  3549. return blot;
  3550. }
  3551. exports2.default = ContainerBlot;
  3552. }),
  3553. /* 18 */
  3554. /***/
  3555. (function(module2, exports2, __webpack_require__) {
  3556. "use strict";
  3557. var __extends = this && this.__extends || (function() {
  3558. var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
  3559. d.__proto__ = b;
  3560. } || function(d, b) {
  3561. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  3562. };
  3563. return function(d, b) {
  3564. extendStatics(d, b);
  3565. function __() {
  3566. this.constructor = d;
  3567. }
  3568. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3569. };
  3570. })();
  3571. Object.defineProperty(exports2, "__esModule", { value: true });
  3572. var attributor_1 = __webpack_require__(12);
  3573. var store_1 = __webpack_require__(31);
  3574. var container_1 = __webpack_require__(17);
  3575. var Registry = __webpack_require__(1);
  3576. var FormatBlot = (
  3577. /** @class */
  3578. (function(_super) {
  3579. __extends(FormatBlot2, _super);
  3580. function FormatBlot2(domNode) {
  3581. var _this = _super.call(this, domNode) || this;
  3582. _this.attributes = new store_1.default(_this.domNode);
  3583. return _this;
  3584. }
  3585. FormatBlot2.formats = function(domNode) {
  3586. if (typeof this.tagName === "string") {
  3587. return true;
  3588. } else if (Array.isArray(this.tagName)) {
  3589. return domNode.tagName.toLowerCase();
  3590. }
  3591. return void 0;
  3592. };
  3593. FormatBlot2.prototype.format = function(name, value) {
  3594. var format = Registry.query(name);
  3595. if (format instanceof attributor_1.default) {
  3596. this.attributes.attribute(format, value);
  3597. } else if (value) {
  3598. if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) {
  3599. this.replaceWith(name, value);
  3600. }
  3601. }
  3602. };
  3603. FormatBlot2.prototype.formats = function() {
  3604. var formats = this.attributes.values();
  3605. var format = this.statics.formats(this.domNode);
  3606. if (format != null) {
  3607. formats[this.statics.blotName] = format;
  3608. }
  3609. return formats;
  3610. };
  3611. FormatBlot2.prototype.replaceWith = function(name, value) {
  3612. var replacement = _super.prototype.replaceWith.call(this, name, value);
  3613. this.attributes.copy(replacement);
  3614. return replacement;
  3615. };
  3616. FormatBlot2.prototype.update = function(mutations, context) {
  3617. var _this = this;
  3618. _super.prototype.update.call(this, mutations, context);
  3619. if (mutations.some(function(mutation) {
  3620. return mutation.target === _this.domNode && mutation.type === "attributes";
  3621. })) {
  3622. this.attributes.build();
  3623. }
  3624. };
  3625. FormatBlot2.prototype.wrap = function(name, value) {
  3626. var wrapper = _super.prototype.wrap.call(this, name, value);
  3627. if (wrapper instanceof FormatBlot2 && wrapper.statics.scope === this.statics.scope) {
  3628. this.attributes.move(wrapper);
  3629. }
  3630. return wrapper;
  3631. };
  3632. return FormatBlot2;
  3633. })(container_1.default)
  3634. );
  3635. exports2.default = FormatBlot;
  3636. }),
  3637. /* 19 */
  3638. /***/
  3639. (function(module2, exports2, __webpack_require__) {
  3640. "use strict";
  3641. var __extends = this && this.__extends || (function() {
  3642. var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
  3643. d.__proto__ = b;
  3644. } || function(d, b) {
  3645. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  3646. };
  3647. return function(d, b) {
  3648. extendStatics(d, b);
  3649. function __() {
  3650. this.constructor = d;
  3651. }
  3652. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3653. };
  3654. })();
  3655. Object.defineProperty(exports2, "__esModule", { value: true });
  3656. var shadow_1 = __webpack_require__(30);
  3657. var Registry = __webpack_require__(1);
  3658. var LeafBlot = (
  3659. /** @class */
  3660. (function(_super) {
  3661. __extends(LeafBlot2, _super);
  3662. function LeafBlot2() {
  3663. return _super !== null && _super.apply(this, arguments) || this;
  3664. }
  3665. LeafBlot2.value = function(domNode) {
  3666. return true;
  3667. };
  3668. LeafBlot2.prototype.index = function(node, offset) {
  3669. if (this.domNode === node || this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {
  3670. return Math.min(offset, 1);
  3671. }
  3672. return -1;
  3673. };
  3674. LeafBlot2.prototype.position = function(index, inclusive) {
  3675. var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode);
  3676. if (index > 0)
  3677. offset += 1;
  3678. return [this.parent.domNode, offset];
  3679. };
  3680. LeafBlot2.prototype.value = function() {
  3681. var _a;
  3682. return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a;
  3683. };
  3684. LeafBlot2.scope = Registry.Scope.INLINE_BLOT;
  3685. return LeafBlot2;
  3686. })(shadow_1.default)
  3687. );
  3688. exports2.default = LeafBlot;
  3689. }),
  3690. /* 20 */
  3691. /***/
  3692. (function(module2, exports2, __webpack_require__) {
  3693. var equal = __webpack_require__(11);
  3694. var extend = __webpack_require__(3);
  3695. var lib = {
  3696. attributes: {
  3697. compose: function(a, b, keepNull) {
  3698. if (typeof a !== "object") a = {};
  3699. if (typeof b !== "object") b = {};
  3700. var attributes = extend(true, {}, b);
  3701. if (!keepNull) {
  3702. attributes = Object.keys(attributes).reduce(function(copy, key2) {
  3703. if (attributes[key2] != null) {
  3704. copy[key2] = attributes[key2];
  3705. }
  3706. return copy;
  3707. }, {});
  3708. }
  3709. for (var key in a) {
  3710. if (a[key] !== void 0 && b[key] === void 0) {
  3711. attributes[key] = a[key];
  3712. }
  3713. }
  3714. return Object.keys(attributes).length > 0 ? attributes : void 0;
  3715. },
  3716. diff: function(a, b) {
  3717. if (typeof a !== "object") a = {};
  3718. if (typeof b !== "object") b = {};
  3719. var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function(attributes2, key) {
  3720. if (!equal(a[key], b[key])) {
  3721. attributes2[key] = b[key] === void 0 ? null : b[key];
  3722. }
  3723. return attributes2;
  3724. }, {});
  3725. return Object.keys(attributes).length > 0 ? attributes : void 0;
  3726. },
  3727. transform: function(a, b, priority) {
  3728. if (typeof a !== "object") return b;
  3729. if (typeof b !== "object") return void 0;
  3730. if (!priority) return b;
  3731. var attributes = Object.keys(b).reduce(function(attributes2, key) {
  3732. if (a[key] === void 0) attributes2[key] = b[key];
  3733. return attributes2;
  3734. }, {});
  3735. return Object.keys(attributes).length > 0 ? attributes : void 0;
  3736. }
  3737. },
  3738. iterator: function(ops) {
  3739. return new Iterator(ops);
  3740. },
  3741. length: function(op) {
  3742. if (typeof op["delete"] === "number") {
  3743. return op["delete"];
  3744. } else if (typeof op.retain === "number") {
  3745. return op.retain;
  3746. } else {
  3747. return typeof op.insert === "string" ? op.insert.length : 1;
  3748. }
  3749. }
  3750. };
  3751. function Iterator(ops) {
  3752. this.ops = ops;
  3753. this.index = 0;
  3754. this.offset = 0;
  3755. }
  3756. ;
  3757. Iterator.prototype.hasNext = function() {
  3758. return this.peekLength() < Infinity;
  3759. };
  3760. Iterator.prototype.next = function(length) {
  3761. if (!length) length = Infinity;
  3762. var nextOp = this.ops[this.index];
  3763. if (nextOp) {
  3764. var offset = this.offset;
  3765. var opLength = lib.length(nextOp);
  3766. if (length >= opLength - offset) {
  3767. length = opLength - offset;
  3768. this.index += 1;
  3769. this.offset = 0;
  3770. } else {
  3771. this.offset += length;
  3772. }
  3773. if (typeof nextOp["delete"] === "number") {
  3774. return { "delete": length };
  3775. } else {
  3776. var retOp = {};
  3777. if (nextOp.attributes) {
  3778. retOp.attributes = nextOp.attributes;
  3779. }
  3780. if (typeof nextOp.retain === "number") {
  3781. retOp.retain = length;
  3782. } else if (typeof nextOp.insert === "string") {
  3783. retOp.insert = nextOp.insert.substr(offset, length);
  3784. } else {
  3785. retOp.insert = nextOp.insert;
  3786. }
  3787. return retOp;
  3788. }
  3789. } else {
  3790. return { retain: Infinity };
  3791. }
  3792. };
  3793. Iterator.prototype.peek = function() {
  3794. return this.ops[this.index];
  3795. };
  3796. Iterator.prototype.peekLength = function() {
  3797. if (this.ops[this.index]) {
  3798. return lib.length(this.ops[this.index]) - this.offset;
  3799. } else {
  3800. return Infinity;
  3801. }
  3802. };
  3803. Iterator.prototype.peekType = function() {
  3804. if (this.ops[this.index]) {
  3805. if (typeof this.ops[this.index]["delete"] === "number") {
  3806. return "delete";
  3807. } else if (typeof this.ops[this.index].retain === "number") {
  3808. return "retain";
  3809. } else {
  3810. return "insert";
  3811. }
  3812. }
  3813. return "retain";
  3814. };
  3815. Iterator.prototype.rest = function() {
  3816. if (!this.hasNext()) {
  3817. return [];
  3818. } else if (this.offset === 0) {
  3819. return this.ops.slice(this.index);
  3820. } else {
  3821. var offset = this.offset;
  3822. var index = this.index;
  3823. var next = this.next();
  3824. var rest = this.ops.slice(this.index);
  3825. this.offset = offset;
  3826. this.index = index;
  3827. return [next].concat(rest);
  3828. }
  3829. };
  3830. module2.exports = lib;
  3831. }),
  3832. /* 21 */
  3833. /***/
  3834. (function(module2, exports2) {
  3835. var clone = (function() {
  3836. "use strict";
  3837. function _instanceof(obj, type) {
  3838. return type != null && obj instanceof type;
  3839. }
  3840. var nativeMap;
  3841. try {
  3842. nativeMap = Map;
  3843. } catch (_) {
  3844. nativeMap = function() {
  3845. };
  3846. }
  3847. var nativeSet;
  3848. try {
  3849. nativeSet = Set;
  3850. } catch (_) {
  3851. nativeSet = function() {
  3852. };
  3853. }
  3854. var nativePromise;
  3855. try {
  3856. nativePromise = Promise;
  3857. } catch (_) {
  3858. nativePromise = function() {
  3859. };
  3860. }
  3861. function clone2(parent, circular, depth, prototype, includeNonEnumerable) {
  3862. if (typeof circular === "object") {
  3863. depth = circular.depth;
  3864. prototype = circular.prototype;
  3865. includeNonEnumerable = circular.includeNonEnumerable;
  3866. circular = circular.circular;
  3867. }
  3868. var allParents = [];
  3869. var allChildren = [];
  3870. var useBuffer = typeof Buffer != "undefined";
  3871. if (typeof circular == "undefined")
  3872. circular = true;
  3873. if (typeof depth == "undefined")
  3874. depth = Infinity;
  3875. function _clone(parent2, depth2) {
  3876. if (parent2 === null)
  3877. return null;
  3878. if (depth2 === 0)
  3879. return parent2;
  3880. var child;
  3881. var proto;
  3882. if (typeof parent2 != "object") {
  3883. return parent2;
  3884. }
  3885. if (_instanceof(parent2, nativeMap)) {
  3886. child = new nativeMap();
  3887. } else if (_instanceof(parent2, nativeSet)) {
  3888. child = new nativeSet();
  3889. } else if (_instanceof(parent2, nativePromise)) {
  3890. child = new nativePromise(function(resolve, reject) {
  3891. parent2.then(function(value) {
  3892. resolve(_clone(value, depth2 - 1));
  3893. }, function(err) {
  3894. reject(_clone(err, depth2 - 1));
  3895. });
  3896. });
  3897. } else if (clone2.__isArray(parent2)) {
  3898. child = [];
  3899. } else if (clone2.__isRegExp(parent2)) {
  3900. child = new RegExp(parent2.source, __getRegExpFlags(parent2));
  3901. if (parent2.lastIndex) child.lastIndex = parent2.lastIndex;
  3902. } else if (clone2.__isDate(parent2)) {
  3903. child = new Date(parent2.getTime());
  3904. } else if (useBuffer && Buffer.isBuffer(parent2)) {
  3905. if (Buffer.allocUnsafe) {
  3906. child = Buffer.allocUnsafe(parent2.length);
  3907. } else {
  3908. child = new Buffer(parent2.length);
  3909. }
  3910. parent2.copy(child);
  3911. return child;
  3912. } else if (_instanceof(parent2, Error)) {
  3913. child = Object.create(parent2);
  3914. } else {
  3915. if (typeof prototype == "undefined") {
  3916. proto = Object.getPrototypeOf(parent2);
  3917. child = Object.create(proto);
  3918. } else {
  3919. child = Object.create(prototype);
  3920. proto = prototype;
  3921. }
  3922. }
  3923. if (circular) {
  3924. var index = allParents.indexOf(parent2);
  3925. if (index != -1) {
  3926. return allChildren[index];
  3927. }
  3928. allParents.push(parent2);
  3929. allChildren.push(child);
  3930. }
  3931. if (_instanceof(parent2, nativeMap)) {
  3932. parent2.forEach(function(value, key) {
  3933. var keyChild = _clone(key, depth2 - 1);
  3934. var valueChild = _clone(value, depth2 - 1);
  3935. child.set(keyChild, valueChild);
  3936. });
  3937. }
  3938. if (_instanceof(parent2, nativeSet)) {
  3939. parent2.forEach(function(value) {
  3940. var entryChild = _clone(value, depth2 - 1);
  3941. child.add(entryChild);
  3942. });
  3943. }
  3944. for (var i in parent2) {
  3945. var attrs;
  3946. if (proto) {
  3947. attrs = Object.getOwnPropertyDescriptor(proto, i);
  3948. }
  3949. if (attrs && attrs.set == null) {
  3950. continue;
  3951. }
  3952. child[i] = _clone(parent2[i], depth2 - 1);
  3953. }
  3954. if (Object.getOwnPropertySymbols) {
  3955. var symbols = Object.getOwnPropertySymbols(parent2);
  3956. for (var i = 0; i < symbols.length; i++) {
  3957. var symbol = symbols[i];
  3958. var descriptor = Object.getOwnPropertyDescriptor(parent2, symbol);
  3959. if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {
  3960. continue;
  3961. }
  3962. child[symbol] = _clone(parent2[symbol], depth2 - 1);
  3963. if (!descriptor.enumerable) {
  3964. Object.defineProperty(child, symbol, {
  3965. enumerable: false
  3966. });
  3967. }
  3968. }
  3969. }
  3970. if (includeNonEnumerable) {
  3971. var allPropertyNames = Object.getOwnPropertyNames(parent2);
  3972. for (var i = 0; i < allPropertyNames.length; i++) {
  3973. var propertyName = allPropertyNames[i];
  3974. var descriptor = Object.getOwnPropertyDescriptor(parent2, propertyName);
  3975. if (descriptor && descriptor.enumerable) {
  3976. continue;
  3977. }
  3978. child[propertyName] = _clone(parent2[propertyName], depth2 - 1);
  3979. Object.defineProperty(child, propertyName, {
  3980. enumerable: false
  3981. });
  3982. }
  3983. }
  3984. return child;
  3985. }
  3986. return _clone(parent, depth);
  3987. }
  3988. clone2.clonePrototype = function clonePrototype(parent) {
  3989. if (parent === null)
  3990. return null;
  3991. var c = function() {
  3992. };
  3993. c.prototype = parent;
  3994. return new c();
  3995. };
  3996. function __objToStr(o) {
  3997. return Object.prototype.toString.call(o);
  3998. }
  3999. clone2.__objToStr = __objToStr;
  4000. function __isDate(o) {
  4001. return typeof o === "object" && __objToStr(o) === "[object Date]";
  4002. }
  4003. clone2.__isDate = __isDate;
  4004. function __isArray(o) {
  4005. return typeof o === "object" && __objToStr(o) === "[object Array]";
  4006. }
  4007. clone2.__isArray = __isArray;
  4008. function __isRegExp(o) {
  4009. return typeof o === "object" && __objToStr(o) === "[object RegExp]";
  4010. }
  4011. clone2.__isRegExp = __isRegExp;
  4012. function __getRegExpFlags(re) {
  4013. var flags = "";
  4014. if (re.global) flags += "g";
  4015. if (re.ignoreCase) flags += "i";
  4016. if (re.multiline) flags += "m";
  4017. return flags;
  4018. }
  4019. clone2.__getRegExpFlags = __getRegExpFlags;
  4020. return clone2;
  4021. })();
  4022. if (typeof module2 === "object" && module2.exports) {
  4023. module2.exports = clone;
  4024. }
  4025. }),
  4026. /* 22 */
  4027. /***/
  4028. (function(module2, exports2, __webpack_require__) {
  4029. "use strict";
  4030. Object.defineProperty(exports2, "__esModule", {
  4031. value: true
  4032. });
  4033. var _slicedToArray = /* @__PURE__ */ (function() {
  4034. function sliceIterator(arr, i) {
  4035. var _arr = [];
  4036. var _n = true;
  4037. var _d = false;
  4038. var _e = void 0;
  4039. try {
  4040. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  4041. _arr.push(_s.value);
  4042. if (i && _arr.length === i) break;
  4043. }
  4044. } catch (err) {
  4045. _d = true;
  4046. _e = err;
  4047. } finally {
  4048. try {
  4049. if (!_n && _i["return"]) _i["return"]();
  4050. } finally {
  4051. if (_d) throw _e;
  4052. }
  4053. }
  4054. return _arr;
  4055. }
  4056. return function(arr, i) {
  4057. if (Array.isArray(arr)) {
  4058. return arr;
  4059. } else if (Symbol.iterator in Object(arr)) {
  4060. return sliceIterator(arr, i);
  4061. } else {
  4062. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  4063. }
  4064. };
  4065. })();
  4066. var _createClass = /* @__PURE__ */ (function() {
  4067. function defineProperties(target, props) {
  4068. for (var i = 0; i < props.length; i++) {
  4069. var descriptor = props[i];
  4070. descriptor.enumerable = descriptor.enumerable || false;
  4071. descriptor.configurable = true;
  4072. if ("value" in descriptor) descriptor.writable = true;
  4073. Object.defineProperty(target, descriptor.key, descriptor);
  4074. }
  4075. }
  4076. return function(Constructor, protoProps, staticProps) {
  4077. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  4078. if (staticProps) defineProperties(Constructor, staticProps);
  4079. return Constructor;
  4080. };
  4081. })();
  4082. var _get = function get(object, property, receiver) {
  4083. if (object === null) object = Function.prototype;
  4084. var desc = Object.getOwnPropertyDescriptor(object, property);
  4085. if (desc === void 0) {
  4086. var parent = Object.getPrototypeOf(object);
  4087. if (parent === null) {
  4088. return void 0;
  4089. } else {
  4090. return get(parent, property, receiver);
  4091. }
  4092. } else if ("value" in desc) {
  4093. return desc.value;
  4094. } else {
  4095. var getter = desc.get;
  4096. if (getter === void 0) {
  4097. return void 0;
  4098. }
  4099. return getter.call(receiver);
  4100. }
  4101. };
  4102. var _parchment = __webpack_require__(0);
  4103. var _parchment2 = _interopRequireDefault(_parchment);
  4104. var _emitter = __webpack_require__(8);
  4105. var _emitter2 = _interopRequireDefault(_emitter);
  4106. var _block = __webpack_require__(4);
  4107. var _block2 = _interopRequireDefault(_block);
  4108. var _break = __webpack_require__(16);
  4109. var _break2 = _interopRequireDefault(_break);
  4110. var _code = __webpack_require__(13);
  4111. var _code2 = _interopRequireDefault(_code);
  4112. var _container = __webpack_require__(25);
  4113. var _container2 = _interopRequireDefault(_container);
  4114. function _interopRequireDefault(obj) {
  4115. return obj && obj.__esModule ? obj : { default: obj };
  4116. }
  4117. function _classCallCheck(instance, Constructor) {
  4118. if (!(instance instanceof Constructor)) {
  4119. throw new TypeError("Cannot call a class as a function");
  4120. }
  4121. }
  4122. function _possibleConstructorReturn(self2, call) {
  4123. if (!self2) {
  4124. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  4125. }
  4126. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  4127. }
  4128. function _inherits(subClass, superClass) {
  4129. if (typeof superClass !== "function" && superClass !== null) {
  4130. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  4131. }
  4132. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  4133. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  4134. }
  4135. function isLine(blot) {
  4136. return blot instanceof _block2.default || blot instanceof _block.BlockEmbed;
  4137. }
  4138. var Scroll = (function(_Parchment$Scroll) {
  4139. _inherits(Scroll2, _Parchment$Scroll);
  4140. function Scroll2(domNode, config) {
  4141. _classCallCheck(this, Scroll2);
  4142. var _this = _possibleConstructorReturn(this, (Scroll2.__proto__ || Object.getPrototypeOf(Scroll2)).call(this, domNode));
  4143. _this.emitter = config.emitter;
  4144. if (Array.isArray(config.whitelist)) {
  4145. _this.whitelist = config.whitelist.reduce(function(whitelist, format) {
  4146. whitelist[format] = true;
  4147. return whitelist;
  4148. }, {});
  4149. }
  4150. _this.domNode.addEventListener("DOMNodeInserted", function() {
  4151. });
  4152. _this.optimize();
  4153. _this.enable();
  4154. return _this;
  4155. }
  4156. _createClass(Scroll2, [{
  4157. key: "batchStart",
  4158. value: function batchStart() {
  4159. this.batch = true;
  4160. }
  4161. }, {
  4162. key: "batchEnd",
  4163. value: function batchEnd() {
  4164. this.batch = false;
  4165. this.optimize();
  4166. }
  4167. }, {
  4168. key: "deleteAt",
  4169. value: function deleteAt(index, length) {
  4170. var _line = this.line(index), _line2 = _slicedToArray(_line, 2), first = _line2[0], offset = _line2[1];
  4171. var _line3 = this.line(index + length), _line4 = _slicedToArray(_line3, 1), last = _line4[0];
  4172. _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "deleteAt", this).call(this, index, length);
  4173. if (last != null && first !== last && offset > 0) {
  4174. if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) {
  4175. this.optimize();
  4176. return;
  4177. }
  4178. if (first instanceof _code2.default) {
  4179. var newlineIndex = first.newlineIndex(first.length(), true);
  4180. if (newlineIndex > -1) {
  4181. first = first.split(newlineIndex + 1);
  4182. if (first === last) {
  4183. this.optimize();
  4184. return;
  4185. }
  4186. }
  4187. } else if (last instanceof _code2.default) {
  4188. var _newlineIndex = last.newlineIndex(0);
  4189. if (_newlineIndex > -1) {
  4190. last.split(_newlineIndex + 1);
  4191. }
  4192. }
  4193. var ref2 = last.children.head instanceof _break2.default ? null : last.children.head;
  4194. first.moveChildren(last, ref2);
  4195. first.remove();
  4196. }
  4197. this.optimize();
  4198. }
  4199. }, {
  4200. key: "enable",
  4201. value: function enable() {
  4202. var enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
  4203. this.domNode.setAttribute("contenteditable", enabled);
  4204. }
  4205. }, {
  4206. key: "formatAt",
  4207. value: function formatAt(index, length, format, value) {
  4208. if (this.whitelist != null && !this.whitelist[format]) return;
  4209. _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "formatAt", this).call(this, index, length, format, value);
  4210. this.optimize();
  4211. }
  4212. }, {
  4213. key: "insertAt",
  4214. value: function insertAt(index, value, def) {
  4215. if (def != null && this.whitelist != null && !this.whitelist[value]) return;
  4216. if (index >= this.length()) {
  4217. if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) {
  4218. var blot = _parchment2.default.create(this.statics.defaultChild);
  4219. this.appendChild(blot);
  4220. if (def == null && value.endsWith("\n")) {
  4221. value = value.slice(0, -1);
  4222. }
  4223. blot.insertAt(0, value, def);
  4224. } else {
  4225. var embed = _parchment2.default.create(value, def);
  4226. this.appendChild(embed);
  4227. }
  4228. } else {
  4229. _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "insertAt", this).call(this, index, value, def);
  4230. }
  4231. this.optimize();
  4232. }
  4233. }, {
  4234. key: "insertBefore",
  4235. value: function insertBefore(blot, ref2) {
  4236. if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) {
  4237. var wrapper = _parchment2.default.create(this.statics.defaultChild);
  4238. wrapper.appendChild(blot);
  4239. blot = wrapper;
  4240. }
  4241. _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "insertBefore", this).call(this, blot, ref2);
  4242. }
  4243. }, {
  4244. key: "leaf",
  4245. value: function leaf(index) {
  4246. return this.path(index).pop() || [null, -1];
  4247. }
  4248. }, {
  4249. key: "line",
  4250. value: function line(index) {
  4251. if (index === this.length()) {
  4252. return this.line(index - 1);
  4253. }
  4254. return this.descendant(isLine, index);
  4255. }
  4256. }, {
  4257. key: "lines",
  4258. value: function lines() {
  4259. var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
  4260. var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Number.MAX_VALUE;
  4261. var getLines = function getLines2(blot, index2, length2) {
  4262. var lines2 = [], lengthLeft = length2;
  4263. blot.children.forEachAt(index2, length2, function(child, index3, length3) {
  4264. if (isLine(child)) {
  4265. lines2.push(child);
  4266. } else if (child instanceof _parchment2.default.Container) {
  4267. lines2 = lines2.concat(getLines2(child, index3, lengthLeft));
  4268. }
  4269. lengthLeft -= length3;
  4270. });
  4271. return lines2;
  4272. };
  4273. return getLines(this, index, length);
  4274. }
  4275. }, {
  4276. key: "optimize",
  4277. value: function optimize() {
  4278. var mutations = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
  4279. var context = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  4280. if (this.batch === true) return;
  4281. _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "optimize", this).call(this, mutations, context);
  4282. if (mutations.length > 0) {
  4283. this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context);
  4284. }
  4285. }
  4286. }, {
  4287. key: "path",
  4288. value: function path(index) {
  4289. return _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "path", this).call(this, index).slice(1);
  4290. }
  4291. }, {
  4292. key: "update",
  4293. value: function update(mutations) {
  4294. if (this.batch === true) return;
  4295. var source = _emitter2.default.sources.USER;
  4296. if (typeof mutations === "string") {
  4297. source = mutations;
  4298. }
  4299. if (!Array.isArray(mutations)) {
  4300. mutations = this.observer.takeRecords();
  4301. }
  4302. if (mutations.length > 0) {
  4303. this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations);
  4304. }
  4305. _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "update", this).call(this, mutations.concat([]));
  4306. if (mutations.length > 0) {
  4307. this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations);
  4308. }
  4309. }
  4310. }]);
  4311. return Scroll2;
  4312. })(_parchment2.default.Scroll);
  4313. Scroll.blotName = "scroll";
  4314. Scroll.className = "ql-editor";
  4315. Scroll.tagName = "DIV";
  4316. Scroll.defaultChild = "block";
  4317. Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default];
  4318. exports2.default = Scroll;
  4319. }),
  4320. /* 23 */
  4321. /***/
  4322. (function(module2, exports2, __webpack_require__) {
  4323. "use strict";
  4324. Object.defineProperty(exports2, "__esModule", {
  4325. value: true
  4326. });
  4327. exports2.SHORTKEY = exports2.default = void 0;
  4328. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
  4329. return typeof obj;
  4330. } : function(obj) {
  4331. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  4332. };
  4333. var _slicedToArray = /* @__PURE__ */ (function() {
  4334. function sliceIterator(arr, i) {
  4335. var _arr = [];
  4336. var _n = true;
  4337. var _d = false;
  4338. var _e = void 0;
  4339. try {
  4340. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  4341. _arr.push(_s.value);
  4342. if (i && _arr.length === i) break;
  4343. }
  4344. } catch (err) {
  4345. _d = true;
  4346. _e = err;
  4347. } finally {
  4348. try {
  4349. if (!_n && _i["return"]) _i["return"]();
  4350. } finally {
  4351. if (_d) throw _e;
  4352. }
  4353. }
  4354. return _arr;
  4355. }
  4356. return function(arr, i) {
  4357. if (Array.isArray(arr)) {
  4358. return arr;
  4359. } else if (Symbol.iterator in Object(arr)) {
  4360. return sliceIterator(arr, i);
  4361. } else {
  4362. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  4363. }
  4364. };
  4365. })();
  4366. var _createClass = /* @__PURE__ */ (function() {
  4367. function defineProperties(target, props) {
  4368. for (var i = 0; i < props.length; i++) {
  4369. var descriptor = props[i];
  4370. descriptor.enumerable = descriptor.enumerable || false;
  4371. descriptor.configurable = true;
  4372. if ("value" in descriptor) descriptor.writable = true;
  4373. Object.defineProperty(target, descriptor.key, descriptor);
  4374. }
  4375. }
  4376. return function(Constructor, protoProps, staticProps) {
  4377. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  4378. if (staticProps) defineProperties(Constructor, staticProps);
  4379. return Constructor;
  4380. };
  4381. })();
  4382. var _clone = __webpack_require__(21);
  4383. var _clone2 = _interopRequireDefault(_clone);
  4384. var _deepEqual = __webpack_require__(11);
  4385. var _deepEqual2 = _interopRequireDefault(_deepEqual);
  4386. var _extend = __webpack_require__(3);
  4387. var _extend2 = _interopRequireDefault(_extend);
  4388. var _quillDelta = __webpack_require__(2);
  4389. var _quillDelta2 = _interopRequireDefault(_quillDelta);
  4390. var _op = __webpack_require__(20);
  4391. var _op2 = _interopRequireDefault(_op);
  4392. var _parchment = __webpack_require__(0);
  4393. var _parchment2 = _interopRequireDefault(_parchment);
  4394. var _quill = __webpack_require__(5);
  4395. var _quill2 = _interopRequireDefault(_quill);
  4396. var _logger = __webpack_require__(10);
  4397. var _logger2 = _interopRequireDefault(_logger);
  4398. var _module = __webpack_require__(9);
  4399. var _module2 = _interopRequireDefault(_module);
  4400. function _interopRequireDefault(obj) {
  4401. return obj && obj.__esModule ? obj : { default: obj };
  4402. }
  4403. function _defineProperty(obj, key, value) {
  4404. if (key in obj) {
  4405. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  4406. } else {
  4407. obj[key] = value;
  4408. }
  4409. return obj;
  4410. }
  4411. function _classCallCheck(instance, Constructor) {
  4412. if (!(instance instanceof Constructor)) {
  4413. throw new TypeError("Cannot call a class as a function");
  4414. }
  4415. }
  4416. function _possibleConstructorReturn(self2, call) {
  4417. if (!self2) {
  4418. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  4419. }
  4420. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  4421. }
  4422. function _inherits(subClass, superClass) {
  4423. if (typeof superClass !== "function" && superClass !== null) {
  4424. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  4425. }
  4426. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  4427. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  4428. }
  4429. var debug = (0, _logger2.default)("quill:keyboard");
  4430. var SHORTKEY = /Mac/i.test(navigator.platform) ? "metaKey" : "ctrlKey";
  4431. var Keyboard = (function(_Module) {
  4432. _inherits(Keyboard2, _Module);
  4433. _createClass(Keyboard2, null, [{
  4434. key: "match",
  4435. value: function match(evt, binding) {
  4436. binding = normalize(binding);
  4437. if (["altKey", "ctrlKey", "metaKey", "shiftKey"].some(function(key) {
  4438. return !!binding[key] !== evt[key] && binding[key] !== null;
  4439. })) {
  4440. return false;
  4441. }
  4442. return binding.key === (evt.which || evt.keyCode);
  4443. }
  4444. }]);
  4445. function Keyboard2(quill, options) {
  4446. _classCallCheck(this, Keyboard2);
  4447. var _this = _possibleConstructorReturn(this, (Keyboard2.__proto__ || Object.getPrototypeOf(Keyboard2)).call(this, quill, options));
  4448. _this.bindings = {};
  4449. Object.keys(_this.options.bindings).forEach(function(name) {
  4450. if (name === "list autofill" && quill.scroll.whitelist != null && !quill.scroll.whitelist["list"]) {
  4451. return;
  4452. }
  4453. if (_this.options.bindings[name]) {
  4454. _this.addBinding(_this.options.bindings[name]);
  4455. }
  4456. });
  4457. _this.addBinding({ key: Keyboard2.keys.ENTER, shiftKey: null }, handleEnter);
  4458. _this.addBinding({ key: Keyboard2.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function() {
  4459. });
  4460. if (/Firefox/i.test(navigator.userAgent)) {
  4461. _this.addBinding({ key: Keyboard2.keys.BACKSPACE }, { collapsed: true }, handleBackspace);
  4462. _this.addBinding({ key: Keyboard2.keys.DELETE }, { collapsed: true }, handleDelete);
  4463. } else {
  4464. _this.addBinding({ key: Keyboard2.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace);
  4465. _this.addBinding({ key: Keyboard2.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete);
  4466. }
  4467. _this.addBinding({ key: Keyboard2.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange);
  4468. _this.addBinding({ key: Keyboard2.keys.DELETE }, { collapsed: false }, handleDeleteRange);
  4469. _this.addBinding({ key: Keyboard2.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace);
  4470. _this.listen();
  4471. return _this;
  4472. }
  4473. _createClass(Keyboard2, [{
  4474. key: "addBinding",
  4475. value: function addBinding(key) {
  4476. var context = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  4477. var handler = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  4478. var binding = normalize(key);
  4479. if (binding == null || binding.key == null) {
  4480. return debug.warn("Attempted to add invalid keyboard binding", binding);
  4481. }
  4482. if (typeof context === "function") {
  4483. context = { handler: context };
  4484. }
  4485. if (typeof handler === "function") {
  4486. handler = { handler };
  4487. }
  4488. binding = (0, _extend2.default)(binding, context, handler);
  4489. this.bindings[binding.key] = this.bindings[binding.key] || [];
  4490. this.bindings[binding.key].push(binding);
  4491. }
  4492. }, {
  4493. key: "listen",
  4494. value: function listen() {
  4495. var _this2 = this;
  4496. this.quill.root.addEventListener("keydown", function(evt) {
  4497. if (evt.defaultPrevented) return;
  4498. var which = evt.which || evt.keyCode;
  4499. var bindings = (_this2.bindings[which] || []).filter(function(binding) {
  4500. return Keyboard2.match(evt, binding);
  4501. });
  4502. if (bindings.length === 0) return;
  4503. var range = _this2.quill.getSelection();
  4504. if (range == null || !_this2.quill.hasFocus()) return;
  4505. var _quill$getLine = _this2.quill.getLine(range.index), _quill$getLine2 = _slicedToArray(_quill$getLine, 2), line = _quill$getLine2[0], offset = _quill$getLine2[1];
  4506. var _quill$getLeaf = _this2.quill.getLeaf(range.index), _quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2), leafStart = _quill$getLeaf2[0], offsetStart = _quill$getLeaf2[1];
  4507. var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length), _ref2 = _slicedToArray(_ref, 2), leafEnd = _ref2[0], offsetEnd = _ref2[1];
  4508. var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : "";
  4509. var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : "";
  4510. var curContext = {
  4511. collapsed: range.length === 0,
  4512. empty: range.length === 0 && line.length() <= 1,
  4513. format: _this2.quill.getFormat(range),
  4514. offset,
  4515. prefix: prefixText,
  4516. suffix: suffixText
  4517. };
  4518. var prevented = bindings.some(function(binding) {
  4519. if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false;
  4520. if (binding.empty != null && binding.empty !== curContext.empty) return false;
  4521. if (binding.offset != null && binding.offset !== curContext.offset) return false;
  4522. if (Array.isArray(binding.format)) {
  4523. if (binding.format.every(function(name) {
  4524. return curContext.format[name] == null;
  4525. })) {
  4526. return false;
  4527. }
  4528. } else if (_typeof(binding.format) === "object") {
  4529. if (!Object.keys(binding.format).every(function(name) {
  4530. if (binding.format[name] === true) return curContext.format[name] != null;
  4531. if (binding.format[name] === false) return curContext.format[name] == null;
  4532. return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]);
  4533. })) {
  4534. return false;
  4535. }
  4536. }
  4537. if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false;
  4538. if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false;
  4539. return binding.handler.call(_this2, range, curContext) !== true;
  4540. });
  4541. if (prevented) {
  4542. evt.preventDefault();
  4543. }
  4544. });
  4545. }
  4546. }]);
  4547. return Keyboard2;
  4548. })(_module2.default);
  4549. Keyboard.keys = {
  4550. BACKSPACE: 8,
  4551. TAB: 9,
  4552. ENTER: 13,
  4553. ESCAPE: 27,
  4554. LEFT: 37,
  4555. UP: 38,
  4556. RIGHT: 39,
  4557. DOWN: 40,
  4558. DELETE: 46
  4559. };
  4560. Keyboard.DEFAULTS = {
  4561. bindings: {
  4562. "bold": makeFormatHandler("bold"),
  4563. "italic": makeFormatHandler("italic"),
  4564. "underline": makeFormatHandler("underline"),
  4565. "indent": {
  4566. // highlight tab or tab at beginning of list, indent or blockquote
  4567. key: Keyboard.keys.TAB,
  4568. format: ["blockquote", "indent", "list"],
  4569. handler: function handler(range, context) {
  4570. if (context.collapsed && context.offset !== 0) return true;
  4571. this.quill.format("indent", "+1", _quill2.default.sources.USER);
  4572. }
  4573. },
  4574. "outdent": {
  4575. key: Keyboard.keys.TAB,
  4576. shiftKey: true,
  4577. format: ["blockquote", "indent", "list"],
  4578. // highlight tab or tab at beginning of list, indent or blockquote
  4579. handler: function handler(range, context) {
  4580. if (context.collapsed && context.offset !== 0) return true;
  4581. this.quill.format("indent", "-1", _quill2.default.sources.USER);
  4582. }
  4583. },
  4584. "outdent backspace": {
  4585. key: Keyboard.keys.BACKSPACE,
  4586. collapsed: true,
  4587. shiftKey: null,
  4588. metaKey: null,
  4589. ctrlKey: null,
  4590. altKey: null,
  4591. format: ["indent", "list"],
  4592. offset: 0,
  4593. handler: function handler(range, context) {
  4594. if (context.format.indent != null) {
  4595. this.quill.format("indent", "-1", _quill2.default.sources.USER);
  4596. } else if (context.format.list != null) {
  4597. this.quill.format("list", false, _quill2.default.sources.USER);
  4598. }
  4599. }
  4600. },
  4601. "indent code-block": makeCodeBlockHandler(true),
  4602. "outdent code-block": makeCodeBlockHandler(false),
  4603. "remove tab": {
  4604. key: Keyboard.keys.TAB,
  4605. shiftKey: true,
  4606. collapsed: true,
  4607. prefix: /\t$/,
  4608. handler: function handler(range) {
  4609. this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER);
  4610. }
  4611. },
  4612. "tab": {
  4613. key: Keyboard.keys.TAB,
  4614. handler: function handler(range) {
  4615. this.quill.history.cutoff();
  4616. var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert(" ");
  4617. this.quill.updateContents(delta, _quill2.default.sources.USER);
  4618. this.quill.history.cutoff();
  4619. this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
  4620. }
  4621. },
  4622. "list empty enter": {
  4623. key: Keyboard.keys.ENTER,
  4624. collapsed: true,
  4625. format: ["list"],
  4626. empty: true,
  4627. handler: function handler(range, context) {
  4628. this.quill.format("list", false, _quill2.default.sources.USER);
  4629. if (context.format.indent) {
  4630. this.quill.format("indent", false, _quill2.default.sources.USER);
  4631. }
  4632. }
  4633. },
  4634. "checklist enter": {
  4635. key: Keyboard.keys.ENTER,
  4636. collapsed: true,
  4637. format: { list: "checked" },
  4638. handler: function handler(range) {
  4639. var _quill$getLine3 = this.quill.getLine(range.index), _quill$getLine4 = _slicedToArray(_quill$getLine3, 2), line = _quill$getLine4[0], offset = _quill$getLine4[1];
  4640. var formats = (0, _extend2.default)({}, line.formats(), { list: "checked" });
  4641. var delta = new _quillDelta2.default().retain(range.index).insert("\n", formats).retain(line.length() - offset - 1).retain(1, { list: "unchecked" });
  4642. this.quill.updateContents(delta, _quill2.default.sources.USER);
  4643. this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
  4644. this.quill.scrollIntoView();
  4645. }
  4646. },
  4647. "header enter": {
  4648. key: Keyboard.keys.ENTER,
  4649. collapsed: true,
  4650. format: ["header"],
  4651. suffix: /^$/,
  4652. handler: function handler(range, context) {
  4653. var _quill$getLine5 = this.quill.getLine(range.index), _quill$getLine6 = _slicedToArray(_quill$getLine5, 2), line = _quill$getLine6[0], offset = _quill$getLine6[1];
  4654. var delta = new _quillDelta2.default().retain(range.index).insert("\n", context.format).retain(line.length() - offset - 1).retain(1, { header: null });
  4655. this.quill.updateContents(delta, _quill2.default.sources.USER);
  4656. this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
  4657. this.quill.scrollIntoView();
  4658. }
  4659. },
  4660. "list autofill": {
  4661. key: " ",
  4662. collapsed: true,
  4663. format: { list: false },
  4664. prefix: /^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,
  4665. handler: function handler(range, context) {
  4666. var length = context.prefix.length;
  4667. var _quill$getLine7 = this.quill.getLine(range.index), _quill$getLine8 = _slicedToArray(_quill$getLine7, 2), line = _quill$getLine8[0], offset = _quill$getLine8[1];
  4668. if (offset > length) return true;
  4669. var value = void 0;
  4670. switch (context.prefix.trim()) {
  4671. case "[]":
  4672. case "[ ]":
  4673. value = "unchecked";
  4674. break;
  4675. case "[x]":
  4676. value = "checked";
  4677. break;
  4678. case "-":
  4679. case "*":
  4680. value = "bullet";
  4681. break;
  4682. default:
  4683. value = "ordered";
  4684. }
  4685. this.quill.insertText(range.index, " ", _quill2.default.sources.USER);
  4686. this.quill.history.cutoff();
  4687. var delta = new _quillDelta2.default().retain(range.index - offset).delete(length + 1).retain(line.length() - 2 - offset).retain(1, { list: value });
  4688. this.quill.updateContents(delta, _quill2.default.sources.USER);
  4689. this.quill.history.cutoff();
  4690. this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT);
  4691. }
  4692. },
  4693. "code exit": {
  4694. key: Keyboard.keys.ENTER,
  4695. collapsed: true,
  4696. format: ["code-block"],
  4697. prefix: /\n\n$/,
  4698. suffix: /^\s+$/,
  4699. handler: function handler(range) {
  4700. var _quill$getLine9 = this.quill.getLine(range.index), _quill$getLine10 = _slicedToArray(_quill$getLine9, 2), line = _quill$getLine10[0], offset = _quill$getLine10[1];
  4701. var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { "code-block": null }).delete(1);
  4702. this.quill.updateContents(delta, _quill2.default.sources.USER);
  4703. }
  4704. },
  4705. "embed left": makeEmbedArrowHandler(Keyboard.keys.LEFT, false),
  4706. "embed left shift": makeEmbedArrowHandler(Keyboard.keys.LEFT, true),
  4707. "embed right": makeEmbedArrowHandler(Keyboard.keys.RIGHT, false),
  4708. "embed right shift": makeEmbedArrowHandler(Keyboard.keys.RIGHT, true)
  4709. }
  4710. };
  4711. function makeEmbedArrowHandler(key, shiftKey) {
  4712. var _ref3;
  4713. var where = key === Keyboard.keys.LEFT ? "prefix" : "suffix";
  4714. return _ref3 = {
  4715. key,
  4716. shiftKey,
  4717. altKey: null
  4718. }, _defineProperty(_ref3, where, /^$/), _defineProperty(_ref3, "handler", function handler(range) {
  4719. var index = range.index;
  4720. if (key === Keyboard.keys.RIGHT) {
  4721. index += range.length + 1;
  4722. }
  4723. var _quill$getLeaf3 = this.quill.getLeaf(index), _quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1), leaf = _quill$getLeaf4[0];
  4724. if (!(leaf instanceof _parchment2.default.Embed)) return true;
  4725. if (key === Keyboard.keys.LEFT) {
  4726. if (shiftKey) {
  4727. this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER);
  4728. } else {
  4729. this.quill.setSelection(range.index - 1, _quill2.default.sources.USER);
  4730. }
  4731. } else {
  4732. if (shiftKey) {
  4733. this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER);
  4734. } else {
  4735. this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER);
  4736. }
  4737. }
  4738. return false;
  4739. }), _ref3;
  4740. }
  4741. function handleBackspace(range, context) {
  4742. if (range.index === 0 || this.quill.getLength() <= 1) return;
  4743. var _quill$getLine11 = this.quill.getLine(range.index), _quill$getLine12 = _slicedToArray(_quill$getLine11, 1), line = _quill$getLine12[0];
  4744. var formats = {};
  4745. if (context.offset === 0) {
  4746. var _quill$getLine13 = this.quill.getLine(range.index - 1), _quill$getLine14 = _slicedToArray(_quill$getLine13, 1), prev = _quill$getLine14[0];
  4747. if (prev != null && prev.length() > 1) {
  4748. var curFormats = line.formats();
  4749. var prevFormats = this.quill.getFormat(range.index - 1, 1);
  4750. formats = _op2.default.attributes.diff(curFormats, prevFormats) || {};
  4751. }
  4752. }
  4753. var length = /[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(context.prefix) ? 2 : 1;
  4754. this.quill.deleteText(range.index - length, length, _quill2.default.sources.USER);
  4755. if (Object.keys(formats).length > 0) {
  4756. this.quill.formatLine(range.index - length, length, formats, _quill2.default.sources.USER);
  4757. }
  4758. this.quill.focus();
  4759. }
  4760. function handleDelete(range, context) {
  4761. var length = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix) ? 2 : 1;
  4762. if (range.index >= this.quill.getLength() - length) return;
  4763. var formats = {}, nextLength = 0;
  4764. var _quill$getLine15 = this.quill.getLine(range.index), _quill$getLine16 = _slicedToArray(_quill$getLine15, 1), line = _quill$getLine16[0];
  4765. if (context.offset >= line.length() - 1) {
  4766. var _quill$getLine17 = this.quill.getLine(range.index + 1), _quill$getLine18 = _slicedToArray(_quill$getLine17, 1), next = _quill$getLine18[0];
  4767. if (next) {
  4768. var curFormats = line.formats();
  4769. var nextFormats = this.quill.getFormat(range.index, 1);
  4770. formats = _op2.default.attributes.diff(curFormats, nextFormats) || {};
  4771. nextLength = next.length();
  4772. }
  4773. }
  4774. this.quill.deleteText(range.index, length, _quill2.default.sources.USER);
  4775. if (Object.keys(formats).length > 0) {
  4776. this.quill.formatLine(range.index + nextLength - 1, length, formats, _quill2.default.sources.USER);
  4777. }
  4778. }
  4779. function handleDeleteRange(range) {
  4780. var lines = this.quill.getLines(range);
  4781. var formats = {};
  4782. if (lines.length > 1) {
  4783. var firstFormats = lines[0].formats();
  4784. var lastFormats = lines[lines.length - 1].formats();
  4785. formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {};
  4786. }
  4787. this.quill.deleteText(range, _quill2.default.sources.USER);
  4788. if (Object.keys(formats).length > 0) {
  4789. this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER);
  4790. }
  4791. this.quill.setSelection(range.index, _quill2.default.sources.SILENT);
  4792. this.quill.focus();
  4793. }
  4794. function handleEnter(range, context) {
  4795. var _this3 = this;
  4796. if (range.length > 0) {
  4797. this.quill.scroll.deleteAt(range.index, range.length);
  4798. }
  4799. var lineFormats = Object.keys(context.format).reduce(function(lineFormats2, format) {
  4800. if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) {
  4801. lineFormats2[format] = context.format[format];
  4802. }
  4803. return lineFormats2;
  4804. }, {});
  4805. this.quill.insertText(range.index, "\n", lineFormats, _quill2.default.sources.USER);
  4806. this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
  4807. this.quill.focus();
  4808. Object.keys(context.format).forEach(function(name) {
  4809. if (lineFormats[name] != null) return;
  4810. if (Array.isArray(context.format[name])) return;
  4811. if (name === "link") return;
  4812. _this3.quill.format(name, context.format[name], _quill2.default.sources.USER);
  4813. });
  4814. }
  4815. function makeCodeBlockHandler(indent) {
  4816. return {
  4817. key: Keyboard.keys.TAB,
  4818. shiftKey: !indent,
  4819. format: { "code-block": true },
  4820. handler: function handler(range) {
  4821. var CodeBlock = _parchment2.default.query("code-block");
  4822. var index = range.index, length = range.length;
  4823. var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index), _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), block = _quill$scroll$descend2[0], offset = _quill$scroll$descend2[1];
  4824. if (block == null) return;
  4825. var scrollIndex = this.quill.getIndex(block);
  4826. var start = block.newlineIndex(offset, true) + 1;
  4827. var end = block.newlineIndex(scrollIndex + offset + length);
  4828. var lines = block.domNode.textContent.slice(start, end).split("\n");
  4829. offset = 0;
  4830. lines.forEach(function(line, i) {
  4831. if (indent) {
  4832. block.insertAt(start + offset, CodeBlock.TAB);
  4833. offset += CodeBlock.TAB.length;
  4834. if (i === 0) {
  4835. index += CodeBlock.TAB.length;
  4836. } else {
  4837. length += CodeBlock.TAB.length;
  4838. }
  4839. } else if (line.startsWith(CodeBlock.TAB)) {
  4840. block.deleteAt(start + offset, CodeBlock.TAB.length);
  4841. offset -= CodeBlock.TAB.length;
  4842. if (i === 0) {
  4843. index -= CodeBlock.TAB.length;
  4844. } else {
  4845. length -= CodeBlock.TAB.length;
  4846. }
  4847. }
  4848. offset += line.length + 1;
  4849. });
  4850. this.quill.update(_quill2.default.sources.USER);
  4851. this.quill.setSelection(index, length, _quill2.default.sources.SILENT);
  4852. }
  4853. };
  4854. }
  4855. function makeFormatHandler(format) {
  4856. return {
  4857. key: format[0].toUpperCase(),
  4858. shortKey: true,
  4859. handler: function handler(range, context) {
  4860. this.quill.format(format, !context.format[format], _quill2.default.sources.USER);
  4861. }
  4862. };
  4863. }
  4864. function normalize(binding) {
  4865. if (typeof binding === "string" || typeof binding === "number") {
  4866. return normalize({ key: binding });
  4867. }
  4868. if ((typeof binding === "undefined" ? "undefined" : _typeof(binding)) === "object") {
  4869. binding = (0, _clone2.default)(binding, false);
  4870. }
  4871. if (typeof binding.key === "string") {
  4872. if (Keyboard.keys[binding.key.toUpperCase()] != null) {
  4873. binding.key = Keyboard.keys[binding.key.toUpperCase()];
  4874. } else if (binding.key.length === 1) {
  4875. binding.key = binding.key.toUpperCase().charCodeAt(0);
  4876. } else {
  4877. return null;
  4878. }
  4879. }
  4880. if (binding.shortKey) {
  4881. binding[SHORTKEY] = binding.shortKey;
  4882. delete binding.shortKey;
  4883. }
  4884. return binding;
  4885. }
  4886. exports2.default = Keyboard;
  4887. exports2.SHORTKEY = SHORTKEY;
  4888. }),
  4889. /* 24 */
  4890. /***/
  4891. (function(module2, exports2, __webpack_require__) {
  4892. "use strict";
  4893. Object.defineProperty(exports2, "__esModule", {
  4894. value: true
  4895. });
  4896. var _slicedToArray = /* @__PURE__ */ (function() {
  4897. function sliceIterator(arr, i) {
  4898. var _arr = [];
  4899. var _n = true;
  4900. var _d = false;
  4901. var _e = void 0;
  4902. try {
  4903. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  4904. _arr.push(_s.value);
  4905. if (i && _arr.length === i) break;
  4906. }
  4907. } catch (err) {
  4908. _d = true;
  4909. _e = err;
  4910. } finally {
  4911. try {
  4912. if (!_n && _i["return"]) _i["return"]();
  4913. } finally {
  4914. if (_d) throw _e;
  4915. }
  4916. }
  4917. return _arr;
  4918. }
  4919. return function(arr, i) {
  4920. if (Array.isArray(arr)) {
  4921. return arr;
  4922. } else if (Symbol.iterator in Object(arr)) {
  4923. return sliceIterator(arr, i);
  4924. } else {
  4925. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  4926. }
  4927. };
  4928. })();
  4929. var _get = function get(object, property, receiver) {
  4930. if (object === null) object = Function.prototype;
  4931. var desc = Object.getOwnPropertyDescriptor(object, property);
  4932. if (desc === void 0) {
  4933. var parent = Object.getPrototypeOf(object);
  4934. if (parent === null) {
  4935. return void 0;
  4936. } else {
  4937. return get(parent, property, receiver);
  4938. }
  4939. } else if ("value" in desc) {
  4940. return desc.value;
  4941. } else {
  4942. var getter = desc.get;
  4943. if (getter === void 0) {
  4944. return void 0;
  4945. }
  4946. return getter.call(receiver);
  4947. }
  4948. };
  4949. var _createClass = /* @__PURE__ */ (function() {
  4950. function defineProperties(target, props) {
  4951. for (var i = 0; i < props.length; i++) {
  4952. var descriptor = props[i];
  4953. descriptor.enumerable = descriptor.enumerable || false;
  4954. descriptor.configurable = true;
  4955. if ("value" in descriptor) descriptor.writable = true;
  4956. Object.defineProperty(target, descriptor.key, descriptor);
  4957. }
  4958. }
  4959. return function(Constructor, protoProps, staticProps) {
  4960. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  4961. if (staticProps) defineProperties(Constructor, staticProps);
  4962. return Constructor;
  4963. };
  4964. })();
  4965. var _parchment = __webpack_require__(0);
  4966. var _parchment2 = _interopRequireDefault(_parchment);
  4967. var _text = __webpack_require__(7);
  4968. var _text2 = _interopRequireDefault(_text);
  4969. function _interopRequireDefault(obj) {
  4970. return obj && obj.__esModule ? obj : { default: obj };
  4971. }
  4972. function _classCallCheck(instance, Constructor) {
  4973. if (!(instance instanceof Constructor)) {
  4974. throw new TypeError("Cannot call a class as a function");
  4975. }
  4976. }
  4977. function _possibleConstructorReturn(self2, call) {
  4978. if (!self2) {
  4979. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  4980. }
  4981. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  4982. }
  4983. function _inherits(subClass, superClass) {
  4984. if (typeof superClass !== "function" && superClass !== null) {
  4985. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  4986. }
  4987. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  4988. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  4989. }
  4990. var Cursor = (function(_Parchment$Embed) {
  4991. _inherits(Cursor2, _Parchment$Embed);
  4992. _createClass(Cursor2, null, [{
  4993. key: "value",
  4994. value: function value() {
  4995. return void 0;
  4996. }
  4997. }]);
  4998. function Cursor2(domNode, selection) {
  4999. _classCallCheck(this, Cursor2);
  5000. var _this = _possibleConstructorReturn(this, (Cursor2.__proto__ || Object.getPrototypeOf(Cursor2)).call(this, domNode));
  5001. _this.selection = selection;
  5002. _this.textNode = document.createTextNode(Cursor2.CONTENTS);
  5003. _this.domNode.appendChild(_this.textNode);
  5004. _this._length = 0;
  5005. return _this;
  5006. }
  5007. _createClass(Cursor2, [{
  5008. key: "detach",
  5009. value: function detach() {
  5010. if (this.parent != null) this.parent.removeChild(this);
  5011. }
  5012. }, {
  5013. key: "format",
  5014. value: function format(name, value) {
  5015. if (this._length !== 0) {
  5016. return _get(Cursor2.prototype.__proto__ || Object.getPrototypeOf(Cursor2.prototype), "format", this).call(this, name, value);
  5017. }
  5018. var target = this, index = 0;
  5019. while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) {
  5020. index += target.offset(target.parent);
  5021. target = target.parent;
  5022. }
  5023. if (target != null) {
  5024. this._length = Cursor2.CONTENTS.length;
  5025. target.optimize();
  5026. target.formatAt(index, Cursor2.CONTENTS.length, name, value);
  5027. this._length = 0;
  5028. }
  5029. }
  5030. }, {
  5031. key: "index",
  5032. value: function index(node, offset) {
  5033. if (node === this.textNode) return 0;
  5034. return _get(Cursor2.prototype.__proto__ || Object.getPrototypeOf(Cursor2.prototype), "index", this).call(this, node, offset);
  5035. }
  5036. }, {
  5037. key: "length",
  5038. value: function length() {
  5039. return this._length;
  5040. }
  5041. }, {
  5042. key: "position",
  5043. value: function position() {
  5044. return [this.textNode, this.textNode.data.length];
  5045. }
  5046. }, {
  5047. key: "remove",
  5048. value: function remove() {
  5049. _get(Cursor2.prototype.__proto__ || Object.getPrototypeOf(Cursor2.prototype), "remove", this).call(this);
  5050. this.parent = null;
  5051. }
  5052. }, {
  5053. key: "restore",
  5054. value: function restore() {
  5055. if (this.selection.composing || this.parent == null) return;
  5056. var textNode = this.textNode;
  5057. var range = this.selection.getNativeRange();
  5058. var restoreText = void 0, start = void 0, end = void 0;
  5059. if (range != null && range.start.node === textNode && range.end.node === textNode) {
  5060. var _ref = [textNode, range.start.offset, range.end.offset];
  5061. restoreText = _ref[0];
  5062. start = _ref[1];
  5063. end = _ref[2];
  5064. }
  5065. while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {
  5066. this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);
  5067. }
  5068. if (this.textNode.data !== Cursor2.CONTENTS) {
  5069. var text = this.textNode.data.split(Cursor2.CONTENTS).join("");
  5070. if (this.next instanceof _text2.default) {
  5071. restoreText = this.next.domNode;
  5072. this.next.insertAt(0, text);
  5073. this.textNode.data = Cursor2.CONTENTS;
  5074. } else {
  5075. this.textNode.data = text;
  5076. this.parent.insertBefore(_parchment2.default.create(this.textNode), this);
  5077. this.textNode = document.createTextNode(Cursor2.CONTENTS);
  5078. this.domNode.appendChild(this.textNode);
  5079. }
  5080. }
  5081. this.remove();
  5082. if (start != null) {
  5083. var _map = [start, end].map(function(offset) {
  5084. return Math.max(0, Math.min(restoreText.data.length, offset - 1));
  5085. });
  5086. var _map2 = _slicedToArray(_map, 2);
  5087. start = _map2[0];
  5088. end = _map2[1];
  5089. return {
  5090. startNode: restoreText,
  5091. startOffset: start,
  5092. endNode: restoreText,
  5093. endOffset: end
  5094. };
  5095. }
  5096. }
  5097. }, {
  5098. key: "update",
  5099. value: function update(mutations, context) {
  5100. var _this2 = this;
  5101. if (mutations.some(function(mutation) {
  5102. return mutation.type === "characterData" && mutation.target === _this2.textNode;
  5103. })) {
  5104. var range = this.restore();
  5105. if (range) context.range = range;
  5106. }
  5107. }
  5108. }, {
  5109. key: "value",
  5110. value: function value() {
  5111. return "";
  5112. }
  5113. }]);
  5114. return Cursor2;
  5115. })(_parchment2.default.Embed);
  5116. Cursor.blotName = "cursor";
  5117. Cursor.className = "ql-cursor";
  5118. Cursor.tagName = "span";
  5119. Cursor.CONTENTS = "\uFEFF";
  5120. exports2.default = Cursor;
  5121. }),
  5122. /* 25 */
  5123. /***/
  5124. (function(module2, exports2, __webpack_require__) {
  5125. "use strict";
  5126. Object.defineProperty(exports2, "__esModule", {
  5127. value: true
  5128. });
  5129. var _parchment = __webpack_require__(0);
  5130. var _parchment2 = _interopRequireDefault(_parchment);
  5131. var _block = __webpack_require__(4);
  5132. var _block2 = _interopRequireDefault(_block);
  5133. function _interopRequireDefault(obj) {
  5134. return obj && obj.__esModule ? obj : { default: obj };
  5135. }
  5136. function _classCallCheck(instance, Constructor) {
  5137. if (!(instance instanceof Constructor)) {
  5138. throw new TypeError("Cannot call a class as a function");
  5139. }
  5140. }
  5141. function _possibleConstructorReturn(self2, call) {
  5142. if (!self2) {
  5143. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  5144. }
  5145. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  5146. }
  5147. function _inherits(subClass, superClass) {
  5148. if (typeof superClass !== "function" && superClass !== null) {
  5149. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  5150. }
  5151. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  5152. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  5153. }
  5154. var Container = (function(_Parchment$Container) {
  5155. _inherits(Container2, _Parchment$Container);
  5156. function Container2() {
  5157. _classCallCheck(this, Container2);
  5158. return _possibleConstructorReturn(this, (Container2.__proto__ || Object.getPrototypeOf(Container2)).apply(this, arguments));
  5159. }
  5160. return Container2;
  5161. })(_parchment2.default.Container);
  5162. Container.allowedChildren = [_block2.default, _block.BlockEmbed, Container];
  5163. exports2.default = Container;
  5164. }),
  5165. /* 26 */
  5166. /***/
  5167. (function(module2, exports2, __webpack_require__) {
  5168. "use strict";
  5169. Object.defineProperty(exports2, "__esModule", {
  5170. value: true
  5171. });
  5172. exports2.ColorStyle = exports2.ColorClass = exports2.ColorAttributor = void 0;
  5173. var _createClass = /* @__PURE__ */ (function() {
  5174. function defineProperties(target, props) {
  5175. for (var i = 0; i < props.length; i++) {
  5176. var descriptor = props[i];
  5177. descriptor.enumerable = descriptor.enumerable || false;
  5178. descriptor.configurable = true;
  5179. if ("value" in descriptor) descriptor.writable = true;
  5180. Object.defineProperty(target, descriptor.key, descriptor);
  5181. }
  5182. }
  5183. return function(Constructor, protoProps, staticProps) {
  5184. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  5185. if (staticProps) defineProperties(Constructor, staticProps);
  5186. return Constructor;
  5187. };
  5188. })();
  5189. var _get = function get(object, property, receiver) {
  5190. if (object === null) object = Function.prototype;
  5191. var desc = Object.getOwnPropertyDescriptor(object, property);
  5192. if (desc === void 0) {
  5193. var parent = Object.getPrototypeOf(object);
  5194. if (parent === null) {
  5195. return void 0;
  5196. } else {
  5197. return get(parent, property, receiver);
  5198. }
  5199. } else if ("value" in desc) {
  5200. return desc.value;
  5201. } else {
  5202. var getter = desc.get;
  5203. if (getter === void 0) {
  5204. return void 0;
  5205. }
  5206. return getter.call(receiver);
  5207. }
  5208. };
  5209. var _parchment = __webpack_require__(0);
  5210. var _parchment2 = _interopRequireDefault(_parchment);
  5211. function _interopRequireDefault(obj) {
  5212. return obj && obj.__esModule ? obj : { default: obj };
  5213. }
  5214. function _classCallCheck(instance, Constructor) {
  5215. if (!(instance instanceof Constructor)) {
  5216. throw new TypeError("Cannot call a class as a function");
  5217. }
  5218. }
  5219. function _possibleConstructorReturn(self2, call) {
  5220. if (!self2) {
  5221. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  5222. }
  5223. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  5224. }
  5225. function _inherits(subClass, superClass) {
  5226. if (typeof superClass !== "function" && superClass !== null) {
  5227. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  5228. }
  5229. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  5230. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  5231. }
  5232. var ColorAttributor = (function(_Parchment$Attributor) {
  5233. _inherits(ColorAttributor2, _Parchment$Attributor);
  5234. function ColorAttributor2() {
  5235. _classCallCheck(this, ColorAttributor2);
  5236. return _possibleConstructorReturn(this, (ColorAttributor2.__proto__ || Object.getPrototypeOf(ColorAttributor2)).apply(this, arguments));
  5237. }
  5238. _createClass(ColorAttributor2, [{
  5239. key: "value",
  5240. value: function value(domNode) {
  5241. var value2 = _get(ColorAttributor2.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor2.prototype), "value", this).call(this, domNode);
  5242. if (!value2.startsWith("rgb(")) return value2;
  5243. value2 = value2.replace(/^[^\d]+/, "").replace(/[^\d]+$/, "");
  5244. return "#" + value2.split(",").map(function(component) {
  5245. return ("00" + parseInt(component).toString(16)).slice(-2);
  5246. }).join("");
  5247. }
  5248. }]);
  5249. return ColorAttributor2;
  5250. })(_parchment2.default.Attributor.Style);
  5251. var ColorClass = new _parchment2.default.Attributor.Class("color", "ql-color", {
  5252. scope: _parchment2.default.Scope.INLINE
  5253. });
  5254. var ColorStyle = new ColorAttributor("color", "color", {
  5255. scope: _parchment2.default.Scope.INLINE
  5256. });
  5257. exports2.ColorAttributor = ColorAttributor;
  5258. exports2.ColorClass = ColorClass;
  5259. exports2.ColorStyle = ColorStyle;
  5260. }),
  5261. /* 27 */
  5262. /***/
  5263. (function(module2, exports2, __webpack_require__) {
  5264. "use strict";
  5265. Object.defineProperty(exports2, "__esModule", {
  5266. value: true
  5267. });
  5268. exports2.sanitize = exports2.default = void 0;
  5269. var _createClass = /* @__PURE__ */ (function() {
  5270. function defineProperties(target, props) {
  5271. for (var i = 0; i < props.length; i++) {
  5272. var descriptor = props[i];
  5273. descriptor.enumerable = descriptor.enumerable || false;
  5274. descriptor.configurable = true;
  5275. if ("value" in descriptor) descriptor.writable = true;
  5276. Object.defineProperty(target, descriptor.key, descriptor);
  5277. }
  5278. }
  5279. return function(Constructor, protoProps, staticProps) {
  5280. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  5281. if (staticProps) defineProperties(Constructor, staticProps);
  5282. return Constructor;
  5283. };
  5284. })();
  5285. var _get = function get(object, property, receiver) {
  5286. if (object === null) object = Function.prototype;
  5287. var desc = Object.getOwnPropertyDescriptor(object, property);
  5288. if (desc === void 0) {
  5289. var parent = Object.getPrototypeOf(object);
  5290. if (parent === null) {
  5291. return void 0;
  5292. } else {
  5293. return get(parent, property, receiver);
  5294. }
  5295. } else if ("value" in desc) {
  5296. return desc.value;
  5297. } else {
  5298. var getter = desc.get;
  5299. if (getter === void 0) {
  5300. return void 0;
  5301. }
  5302. return getter.call(receiver);
  5303. }
  5304. };
  5305. var _inline = __webpack_require__(6);
  5306. var _inline2 = _interopRequireDefault(_inline);
  5307. function _interopRequireDefault(obj) {
  5308. return obj && obj.__esModule ? obj : { default: obj };
  5309. }
  5310. function _classCallCheck(instance, Constructor) {
  5311. if (!(instance instanceof Constructor)) {
  5312. throw new TypeError("Cannot call a class as a function");
  5313. }
  5314. }
  5315. function _possibleConstructorReturn(self2, call) {
  5316. if (!self2) {
  5317. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  5318. }
  5319. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  5320. }
  5321. function _inherits(subClass, superClass) {
  5322. if (typeof superClass !== "function" && superClass !== null) {
  5323. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  5324. }
  5325. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  5326. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  5327. }
  5328. var Link = (function(_Inline) {
  5329. _inherits(Link2, _Inline);
  5330. function Link2() {
  5331. _classCallCheck(this, Link2);
  5332. return _possibleConstructorReturn(this, (Link2.__proto__ || Object.getPrototypeOf(Link2)).apply(this, arguments));
  5333. }
  5334. _createClass(Link2, [{
  5335. key: "format",
  5336. value: function format(name, value) {
  5337. if (name !== this.statics.blotName || !value) return _get(Link2.prototype.__proto__ || Object.getPrototypeOf(Link2.prototype), "format", this).call(this, name, value);
  5338. value = this.constructor.sanitize(value);
  5339. this.domNode.setAttribute("href", value);
  5340. }
  5341. }], [{
  5342. key: "create",
  5343. value: function create(value) {
  5344. var node = _get(Link2.__proto__ || Object.getPrototypeOf(Link2), "create", this).call(this, value);
  5345. value = this.sanitize(value);
  5346. node.setAttribute("href", value);
  5347. node.setAttribute("rel", "noopener noreferrer");
  5348. node.setAttribute("target", "_blank");
  5349. return node;
  5350. }
  5351. }, {
  5352. key: "formats",
  5353. value: function formats(domNode) {
  5354. return domNode.getAttribute("href");
  5355. }
  5356. }, {
  5357. key: "sanitize",
  5358. value: function sanitize(url) {
  5359. return _sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;
  5360. }
  5361. }]);
  5362. return Link2;
  5363. })(_inline2.default);
  5364. Link.blotName = "link";
  5365. Link.tagName = "A";
  5366. Link.SANITIZED_URL = "about:blank";
  5367. Link.PROTOCOL_WHITELIST = ["http", "https", "mailto", "tel"];
  5368. function _sanitize(url, protocols) {
  5369. var anchor = document.createElement("a");
  5370. anchor.href = url;
  5371. var protocol = anchor.href.slice(0, anchor.href.indexOf(":"));
  5372. return protocols.indexOf(protocol) > -1;
  5373. }
  5374. exports2.default = Link;
  5375. exports2.sanitize = _sanitize;
  5376. }),
  5377. /* 28 */
  5378. /***/
  5379. (function(module2, exports2, __webpack_require__) {
  5380. "use strict";
  5381. Object.defineProperty(exports2, "__esModule", {
  5382. value: true
  5383. });
  5384. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
  5385. return typeof obj;
  5386. } : function(obj) {
  5387. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  5388. };
  5389. var _createClass = /* @__PURE__ */ (function() {
  5390. function defineProperties(target, props) {
  5391. for (var i = 0; i < props.length; i++) {
  5392. var descriptor = props[i];
  5393. descriptor.enumerable = descriptor.enumerable || false;
  5394. descriptor.configurable = true;
  5395. if ("value" in descriptor) descriptor.writable = true;
  5396. Object.defineProperty(target, descriptor.key, descriptor);
  5397. }
  5398. }
  5399. return function(Constructor, protoProps, staticProps) {
  5400. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  5401. if (staticProps) defineProperties(Constructor, staticProps);
  5402. return Constructor;
  5403. };
  5404. })();
  5405. var _keyboard = __webpack_require__(23);
  5406. var _keyboard2 = _interopRequireDefault(_keyboard);
  5407. var _dropdown = __webpack_require__(107);
  5408. var _dropdown2 = _interopRequireDefault(_dropdown);
  5409. function _interopRequireDefault(obj) {
  5410. return obj && obj.__esModule ? obj : { default: obj };
  5411. }
  5412. function _classCallCheck(instance, Constructor) {
  5413. if (!(instance instanceof Constructor)) {
  5414. throw new TypeError("Cannot call a class as a function");
  5415. }
  5416. }
  5417. var optionsCounter = 0;
  5418. function toggleAriaAttribute(element, attribute) {
  5419. element.setAttribute(attribute, !(element.getAttribute(attribute) === "true"));
  5420. }
  5421. var Picker = (function() {
  5422. function Picker2(select) {
  5423. var _this = this;
  5424. _classCallCheck(this, Picker2);
  5425. this.select = select;
  5426. this.container = document.createElement("span");
  5427. this.buildPicker();
  5428. this.select.style.display = "none";
  5429. this.select.parentNode.insertBefore(this.container, this.select);
  5430. this.label.addEventListener("mousedown", function() {
  5431. _this.togglePicker();
  5432. });
  5433. this.label.addEventListener("keydown", function(event) {
  5434. switch (event.keyCode) {
  5435. // Allows the "Enter" key to open the picker
  5436. case _keyboard2.default.keys.ENTER:
  5437. _this.togglePicker();
  5438. break;
  5439. // Allows the "Escape" key to close the picker
  5440. case _keyboard2.default.keys.ESCAPE:
  5441. _this.escape();
  5442. event.preventDefault();
  5443. break;
  5444. default:
  5445. }
  5446. });
  5447. this.select.addEventListener("change", this.update.bind(this));
  5448. }
  5449. _createClass(Picker2, [{
  5450. key: "togglePicker",
  5451. value: function togglePicker() {
  5452. this.container.classList.toggle("ql-expanded");
  5453. toggleAriaAttribute(this.label, "aria-expanded");
  5454. toggleAriaAttribute(this.options, "aria-hidden");
  5455. }
  5456. }, {
  5457. key: "buildItem",
  5458. value: function buildItem(option) {
  5459. var _this2 = this;
  5460. var item = document.createElement("span");
  5461. item.tabIndex = "0";
  5462. item.setAttribute("role", "button");
  5463. item.classList.add("ql-picker-item");
  5464. if (option.hasAttribute("value")) {
  5465. item.setAttribute("data-value", option.getAttribute("value"));
  5466. }
  5467. if (option.textContent) {
  5468. item.setAttribute("data-label", option.textContent);
  5469. }
  5470. item.addEventListener("click", function() {
  5471. _this2.selectItem(item, true);
  5472. });
  5473. item.addEventListener("keydown", function(event) {
  5474. switch (event.keyCode) {
  5475. // Allows the "Enter" key to select an item
  5476. case _keyboard2.default.keys.ENTER:
  5477. _this2.selectItem(item, true);
  5478. event.preventDefault();
  5479. break;
  5480. // Allows the "Escape" key to close the picker
  5481. case _keyboard2.default.keys.ESCAPE:
  5482. _this2.escape();
  5483. event.preventDefault();
  5484. break;
  5485. default:
  5486. }
  5487. });
  5488. return item;
  5489. }
  5490. }, {
  5491. key: "buildLabel",
  5492. value: function buildLabel() {
  5493. var label = document.createElement("span");
  5494. label.classList.add("ql-picker-label");
  5495. label.innerHTML = _dropdown2.default;
  5496. label.tabIndex = "0";
  5497. label.setAttribute("role", "button");
  5498. label.setAttribute("aria-expanded", "false");
  5499. this.container.appendChild(label);
  5500. return label;
  5501. }
  5502. }, {
  5503. key: "buildOptions",
  5504. value: function buildOptions() {
  5505. var _this3 = this;
  5506. var options = document.createElement("span");
  5507. options.classList.add("ql-picker-options");
  5508. options.setAttribute("aria-hidden", "true");
  5509. options.tabIndex = "-1";
  5510. options.id = "ql-picker-options-" + optionsCounter;
  5511. optionsCounter += 1;
  5512. this.label.setAttribute("aria-controls", options.id);
  5513. this.options = options;
  5514. [].slice.call(this.select.options).forEach(function(option) {
  5515. var item = _this3.buildItem(option);
  5516. options.appendChild(item);
  5517. if (option.selected === true) {
  5518. _this3.selectItem(item);
  5519. }
  5520. });
  5521. this.container.appendChild(options);
  5522. }
  5523. }, {
  5524. key: "buildPicker",
  5525. value: function buildPicker() {
  5526. var _this4 = this;
  5527. [].slice.call(this.select.attributes).forEach(function(item) {
  5528. _this4.container.setAttribute(item.name, item.value);
  5529. });
  5530. this.container.classList.add("ql-picker");
  5531. this.label = this.buildLabel();
  5532. this.buildOptions();
  5533. }
  5534. }, {
  5535. key: "escape",
  5536. value: function escape() {
  5537. var _this5 = this;
  5538. this.close();
  5539. setTimeout(function() {
  5540. return _this5.label.focus();
  5541. }, 1);
  5542. }
  5543. }, {
  5544. key: "close",
  5545. value: function close() {
  5546. this.container.classList.remove("ql-expanded");
  5547. this.label.setAttribute("aria-expanded", "false");
  5548. this.options.setAttribute("aria-hidden", "true");
  5549. }
  5550. }, {
  5551. key: "selectItem",
  5552. value: function selectItem(item) {
  5553. var trigger = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
  5554. var selected = this.container.querySelector(".ql-selected");
  5555. if (item === selected) return;
  5556. if (selected != null) {
  5557. selected.classList.remove("ql-selected");
  5558. }
  5559. if (item == null) return;
  5560. item.classList.add("ql-selected");
  5561. this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item);
  5562. if (item.hasAttribute("data-value")) {
  5563. this.label.setAttribute("data-value", item.getAttribute("data-value"));
  5564. } else {
  5565. this.label.removeAttribute("data-value");
  5566. }
  5567. if (item.hasAttribute("data-label")) {
  5568. this.label.setAttribute("data-label", item.getAttribute("data-label"));
  5569. } else {
  5570. this.label.removeAttribute("data-label");
  5571. }
  5572. if (trigger) {
  5573. if (typeof Event === "function") {
  5574. this.select.dispatchEvent(new Event("change"));
  5575. } else if ((typeof Event === "undefined" ? "undefined" : _typeof(Event)) === "object") {
  5576. var event = document.createEvent("Event");
  5577. event.initEvent("change", true, true);
  5578. this.select.dispatchEvent(event);
  5579. }
  5580. this.close();
  5581. }
  5582. }
  5583. }, {
  5584. key: "update",
  5585. value: function update() {
  5586. var option = void 0;
  5587. if (this.select.selectedIndex > -1) {
  5588. var item = this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];
  5589. option = this.select.options[this.select.selectedIndex];
  5590. this.selectItem(item);
  5591. } else {
  5592. this.selectItem(null);
  5593. }
  5594. var isActive = option != null && option !== this.select.querySelector("option[selected]");
  5595. this.label.classList.toggle("ql-active", isActive);
  5596. }
  5597. }]);
  5598. return Picker2;
  5599. })();
  5600. exports2.default = Picker;
  5601. }),
  5602. /* 29 */
  5603. /***/
  5604. (function(module2, exports2, __webpack_require__) {
  5605. "use strict";
  5606. Object.defineProperty(exports2, "__esModule", {
  5607. value: true
  5608. });
  5609. var _parchment = __webpack_require__(0);
  5610. var _parchment2 = _interopRequireDefault(_parchment);
  5611. var _quill = __webpack_require__(5);
  5612. var _quill2 = _interopRequireDefault(_quill);
  5613. var _block = __webpack_require__(4);
  5614. var _block2 = _interopRequireDefault(_block);
  5615. var _break = __webpack_require__(16);
  5616. var _break2 = _interopRequireDefault(_break);
  5617. var _container = __webpack_require__(25);
  5618. var _container2 = _interopRequireDefault(_container);
  5619. var _cursor = __webpack_require__(24);
  5620. var _cursor2 = _interopRequireDefault(_cursor);
  5621. var _embed = __webpack_require__(35);
  5622. var _embed2 = _interopRequireDefault(_embed);
  5623. var _inline = __webpack_require__(6);
  5624. var _inline2 = _interopRequireDefault(_inline);
  5625. var _scroll = __webpack_require__(22);
  5626. var _scroll2 = _interopRequireDefault(_scroll);
  5627. var _text = __webpack_require__(7);
  5628. var _text2 = _interopRequireDefault(_text);
  5629. var _clipboard = __webpack_require__(55);
  5630. var _clipboard2 = _interopRequireDefault(_clipboard);
  5631. var _history = __webpack_require__(42);
  5632. var _history2 = _interopRequireDefault(_history);
  5633. var _keyboard = __webpack_require__(23);
  5634. var _keyboard2 = _interopRequireDefault(_keyboard);
  5635. function _interopRequireDefault(obj) {
  5636. return obj && obj.__esModule ? obj : { default: obj };
  5637. }
  5638. _quill2.default.register({
  5639. "blots/block": _block2.default,
  5640. "blots/block/embed": _block.BlockEmbed,
  5641. "blots/break": _break2.default,
  5642. "blots/container": _container2.default,
  5643. "blots/cursor": _cursor2.default,
  5644. "blots/embed": _embed2.default,
  5645. "blots/inline": _inline2.default,
  5646. "blots/scroll": _scroll2.default,
  5647. "blots/text": _text2.default,
  5648. "modules/clipboard": _clipboard2.default,
  5649. "modules/history": _history2.default,
  5650. "modules/keyboard": _keyboard2.default
  5651. });
  5652. _parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default);
  5653. exports2.default = _quill2.default;
  5654. }),
  5655. /* 30 */
  5656. /***/
  5657. (function(module2, exports2, __webpack_require__) {
  5658. "use strict";
  5659. Object.defineProperty(exports2, "__esModule", { value: true });
  5660. var Registry = __webpack_require__(1);
  5661. var ShadowBlot = (
  5662. /** @class */
  5663. (function() {
  5664. function ShadowBlot2(domNode) {
  5665. this.domNode = domNode;
  5666. this.domNode[Registry.DATA_KEY] = { blot: this };
  5667. }
  5668. Object.defineProperty(ShadowBlot2.prototype, "statics", {
  5669. // Hack for accessing inherited static methods
  5670. get: function() {
  5671. return this.constructor;
  5672. },
  5673. enumerable: true,
  5674. configurable: true
  5675. });
  5676. ShadowBlot2.create = function(value) {
  5677. if (this.tagName == null) {
  5678. throw new Registry.ParchmentError("Blot definition missing tagName");
  5679. }
  5680. var node;
  5681. if (Array.isArray(this.tagName)) {
  5682. if (typeof value === "string") {
  5683. value = value.toUpperCase();
  5684. if (parseInt(value).toString() === value) {
  5685. value = parseInt(value);
  5686. }
  5687. }
  5688. if (typeof value === "number") {
  5689. node = document.createElement(this.tagName[value - 1]);
  5690. } else if (this.tagName.indexOf(value) > -1) {
  5691. node = document.createElement(value);
  5692. } else {
  5693. node = document.createElement(this.tagName[0]);
  5694. }
  5695. } else {
  5696. node = document.createElement(this.tagName);
  5697. }
  5698. if (this.className) {
  5699. node.classList.add(this.className);
  5700. }
  5701. return node;
  5702. };
  5703. ShadowBlot2.prototype.attach = function() {
  5704. if (this.parent != null) {
  5705. this.scroll = this.parent.scroll;
  5706. }
  5707. };
  5708. ShadowBlot2.prototype.clone = function() {
  5709. var domNode = this.domNode.cloneNode(false);
  5710. return Registry.create(domNode);
  5711. };
  5712. ShadowBlot2.prototype.detach = function() {
  5713. if (this.parent != null)
  5714. this.parent.removeChild(this);
  5715. delete this.domNode[Registry.DATA_KEY];
  5716. };
  5717. ShadowBlot2.prototype.deleteAt = function(index, length) {
  5718. var blot = this.isolate(index, length);
  5719. blot.remove();
  5720. };
  5721. ShadowBlot2.prototype.formatAt = function(index, length, name, value) {
  5722. var blot = this.isolate(index, length);
  5723. if (Registry.query(name, Registry.Scope.BLOT) != null && value) {
  5724. blot.wrap(name, value);
  5725. } else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) {
  5726. var parent = Registry.create(this.statics.scope);
  5727. blot.wrap(parent);
  5728. parent.format(name, value);
  5729. }
  5730. };
  5731. ShadowBlot2.prototype.insertAt = function(index, value, def) {
  5732. var blot = def == null ? Registry.create("text", value) : Registry.create(value, def);
  5733. var ref2 = this.split(index);
  5734. this.parent.insertBefore(blot, ref2);
  5735. };
  5736. ShadowBlot2.prototype.insertInto = function(parentBlot, refBlot) {
  5737. if (refBlot === void 0) {
  5738. refBlot = null;
  5739. }
  5740. if (this.parent != null) {
  5741. this.parent.children.remove(this);
  5742. }
  5743. var refDomNode = null;
  5744. parentBlot.children.insertBefore(this, refBlot);
  5745. if (refBlot != null) {
  5746. refDomNode = refBlot.domNode;
  5747. }
  5748. if (this.domNode.parentNode != parentBlot.domNode || this.domNode.nextSibling != refDomNode) {
  5749. parentBlot.domNode.insertBefore(this.domNode, refDomNode);
  5750. }
  5751. this.parent = parentBlot;
  5752. this.attach();
  5753. };
  5754. ShadowBlot2.prototype.isolate = function(index, length) {
  5755. var target = this.split(index);
  5756. target.split(length);
  5757. return target;
  5758. };
  5759. ShadowBlot2.prototype.length = function() {
  5760. return 1;
  5761. };
  5762. ShadowBlot2.prototype.offset = function(root) {
  5763. if (root === void 0) {
  5764. root = this.parent;
  5765. }
  5766. if (this.parent == null || this == root)
  5767. return 0;
  5768. return this.parent.children.offset(this) + this.parent.offset(root);
  5769. };
  5770. ShadowBlot2.prototype.optimize = function(context) {
  5771. if (this.domNode[Registry.DATA_KEY] != null) {
  5772. delete this.domNode[Registry.DATA_KEY].mutations;
  5773. }
  5774. };
  5775. ShadowBlot2.prototype.remove = function() {
  5776. if (this.domNode.parentNode != null) {
  5777. this.domNode.parentNode.removeChild(this.domNode);
  5778. }
  5779. this.detach();
  5780. };
  5781. ShadowBlot2.prototype.replace = function(target) {
  5782. if (target.parent == null)
  5783. return;
  5784. target.parent.insertBefore(this, target.next);
  5785. target.remove();
  5786. };
  5787. ShadowBlot2.prototype.replaceWith = function(name, value) {
  5788. var replacement = typeof name === "string" ? Registry.create(name, value) : name;
  5789. replacement.replace(this);
  5790. return replacement;
  5791. };
  5792. ShadowBlot2.prototype.split = function(index, force) {
  5793. return index === 0 ? this : this.next;
  5794. };
  5795. ShadowBlot2.prototype.update = function(mutations, context) {
  5796. };
  5797. ShadowBlot2.prototype.wrap = function(name, value) {
  5798. var wrapper = typeof name === "string" ? Registry.create(name, value) : name;
  5799. if (this.parent != null) {
  5800. this.parent.insertBefore(wrapper, this.next);
  5801. }
  5802. wrapper.appendChild(this);
  5803. return wrapper;
  5804. };
  5805. ShadowBlot2.blotName = "abstract";
  5806. return ShadowBlot2;
  5807. })()
  5808. );
  5809. exports2.default = ShadowBlot;
  5810. }),
  5811. /* 31 */
  5812. /***/
  5813. (function(module2, exports2, __webpack_require__) {
  5814. "use strict";
  5815. Object.defineProperty(exports2, "__esModule", { value: true });
  5816. var attributor_1 = __webpack_require__(12);
  5817. var class_1 = __webpack_require__(32);
  5818. var style_1 = __webpack_require__(33);
  5819. var Registry = __webpack_require__(1);
  5820. var AttributorStore = (
  5821. /** @class */
  5822. (function() {
  5823. function AttributorStore2(domNode) {
  5824. this.attributes = {};
  5825. this.domNode = domNode;
  5826. this.build();
  5827. }
  5828. AttributorStore2.prototype.attribute = function(attribute, value) {
  5829. if (value) {
  5830. if (attribute.add(this.domNode, value)) {
  5831. if (attribute.value(this.domNode) != null) {
  5832. this.attributes[attribute.attrName] = attribute;
  5833. } else {
  5834. delete this.attributes[attribute.attrName];
  5835. }
  5836. }
  5837. } else {
  5838. attribute.remove(this.domNode);
  5839. delete this.attributes[attribute.attrName];
  5840. }
  5841. };
  5842. AttributorStore2.prototype.build = function() {
  5843. var _this = this;
  5844. this.attributes = {};
  5845. var attributes = attributor_1.default.keys(this.domNode);
  5846. var classes = class_1.default.keys(this.domNode);
  5847. var styles = style_1.default.keys(this.domNode);
  5848. attributes.concat(classes).concat(styles).forEach(function(name) {
  5849. var attr = Registry.query(name, Registry.Scope.ATTRIBUTE);
  5850. if (attr instanceof attributor_1.default) {
  5851. _this.attributes[attr.attrName] = attr;
  5852. }
  5853. });
  5854. };
  5855. AttributorStore2.prototype.copy = function(target) {
  5856. var _this = this;
  5857. Object.keys(this.attributes).forEach(function(key) {
  5858. var value = _this.attributes[key].value(_this.domNode);
  5859. target.format(key, value);
  5860. });
  5861. };
  5862. AttributorStore2.prototype.move = function(target) {
  5863. var _this = this;
  5864. this.copy(target);
  5865. Object.keys(this.attributes).forEach(function(key) {
  5866. _this.attributes[key].remove(_this.domNode);
  5867. });
  5868. this.attributes = {};
  5869. };
  5870. AttributorStore2.prototype.values = function() {
  5871. var _this = this;
  5872. return Object.keys(this.attributes).reduce(function(attributes, name) {
  5873. attributes[name] = _this.attributes[name].value(_this.domNode);
  5874. return attributes;
  5875. }, {});
  5876. };
  5877. return AttributorStore2;
  5878. })()
  5879. );
  5880. exports2.default = AttributorStore;
  5881. }),
  5882. /* 32 */
  5883. /***/
  5884. (function(module2, exports2, __webpack_require__) {
  5885. "use strict";
  5886. var __extends = this && this.__extends || (function() {
  5887. var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
  5888. d.__proto__ = b;
  5889. } || function(d, b) {
  5890. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  5891. };
  5892. return function(d, b) {
  5893. extendStatics(d, b);
  5894. function __() {
  5895. this.constructor = d;
  5896. }
  5897. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5898. };
  5899. })();
  5900. Object.defineProperty(exports2, "__esModule", { value: true });
  5901. var attributor_1 = __webpack_require__(12);
  5902. function match(node, prefix) {
  5903. var className = node.getAttribute("class") || "";
  5904. return className.split(/\s+/).filter(function(name) {
  5905. return name.indexOf(prefix + "-") === 0;
  5906. });
  5907. }
  5908. var ClassAttributor = (
  5909. /** @class */
  5910. (function(_super) {
  5911. __extends(ClassAttributor2, _super);
  5912. function ClassAttributor2() {
  5913. return _super !== null && _super.apply(this, arguments) || this;
  5914. }
  5915. ClassAttributor2.keys = function(node) {
  5916. return (node.getAttribute("class") || "").split(/\s+/).map(function(name) {
  5917. return name.split("-").slice(0, -1).join("-");
  5918. });
  5919. };
  5920. ClassAttributor2.prototype.add = function(node, value) {
  5921. if (!this.canAdd(node, value))
  5922. return false;
  5923. this.remove(node);
  5924. node.classList.add(this.keyName + "-" + value);
  5925. return true;
  5926. };
  5927. ClassAttributor2.prototype.remove = function(node) {
  5928. var matches = match(node, this.keyName);
  5929. matches.forEach(function(name) {
  5930. node.classList.remove(name);
  5931. });
  5932. if (node.classList.length === 0) {
  5933. node.removeAttribute("class");
  5934. }
  5935. };
  5936. ClassAttributor2.prototype.value = function(node) {
  5937. var result = match(node, this.keyName)[0] || "";
  5938. var value = result.slice(this.keyName.length + 1);
  5939. return this.canAdd(node, value) ? value : "";
  5940. };
  5941. return ClassAttributor2;
  5942. })(attributor_1.default)
  5943. );
  5944. exports2.default = ClassAttributor;
  5945. }),
  5946. /* 33 */
  5947. /***/
  5948. (function(module2, exports2, __webpack_require__) {
  5949. "use strict";
  5950. var __extends = this && this.__extends || (function() {
  5951. var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
  5952. d.__proto__ = b;
  5953. } || function(d, b) {
  5954. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  5955. };
  5956. return function(d, b) {
  5957. extendStatics(d, b);
  5958. function __() {
  5959. this.constructor = d;
  5960. }
  5961. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5962. };
  5963. })();
  5964. Object.defineProperty(exports2, "__esModule", { value: true });
  5965. var attributor_1 = __webpack_require__(12);
  5966. function camelize(name) {
  5967. var parts = name.split("-");
  5968. var rest = parts.slice(1).map(function(part) {
  5969. return part[0].toUpperCase() + part.slice(1);
  5970. }).join("");
  5971. return parts[0] + rest;
  5972. }
  5973. var StyleAttributor = (
  5974. /** @class */
  5975. (function(_super) {
  5976. __extends(StyleAttributor2, _super);
  5977. function StyleAttributor2() {
  5978. return _super !== null && _super.apply(this, arguments) || this;
  5979. }
  5980. StyleAttributor2.keys = function(node) {
  5981. return (node.getAttribute("style") || "").split(";").map(function(value) {
  5982. var arr = value.split(":");
  5983. return arr[0].trim();
  5984. });
  5985. };
  5986. StyleAttributor2.prototype.add = function(node, value) {
  5987. if (!this.canAdd(node, value))
  5988. return false;
  5989. node.style[camelize(this.keyName)] = value;
  5990. return true;
  5991. };
  5992. StyleAttributor2.prototype.remove = function(node) {
  5993. node.style[camelize(this.keyName)] = "";
  5994. if (!node.getAttribute("style")) {
  5995. node.removeAttribute("style");
  5996. }
  5997. };
  5998. StyleAttributor2.prototype.value = function(node) {
  5999. var value = node.style[camelize(this.keyName)];
  6000. return this.canAdd(node, value) ? value : "";
  6001. };
  6002. return StyleAttributor2;
  6003. })(attributor_1.default)
  6004. );
  6005. exports2.default = StyleAttributor;
  6006. }),
  6007. /* 34 */
  6008. /***/
  6009. (function(module2, exports2, __webpack_require__) {
  6010. "use strict";
  6011. Object.defineProperty(exports2, "__esModule", {
  6012. value: true
  6013. });
  6014. var _createClass = /* @__PURE__ */ (function() {
  6015. function defineProperties(target, props) {
  6016. for (var i = 0; i < props.length; i++) {
  6017. var descriptor = props[i];
  6018. descriptor.enumerable = descriptor.enumerable || false;
  6019. descriptor.configurable = true;
  6020. if ("value" in descriptor) descriptor.writable = true;
  6021. Object.defineProperty(target, descriptor.key, descriptor);
  6022. }
  6023. }
  6024. return function(Constructor, protoProps, staticProps) {
  6025. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  6026. if (staticProps) defineProperties(Constructor, staticProps);
  6027. return Constructor;
  6028. };
  6029. })();
  6030. function _classCallCheck(instance, Constructor) {
  6031. if (!(instance instanceof Constructor)) {
  6032. throw new TypeError("Cannot call a class as a function");
  6033. }
  6034. }
  6035. var Theme = (function() {
  6036. function Theme2(quill, options) {
  6037. _classCallCheck(this, Theme2);
  6038. this.quill = quill;
  6039. this.options = options;
  6040. this.modules = {};
  6041. }
  6042. _createClass(Theme2, [{
  6043. key: "init",
  6044. value: function init() {
  6045. var _this = this;
  6046. Object.keys(this.options.modules).forEach(function(name) {
  6047. if (_this.modules[name] == null) {
  6048. _this.addModule(name);
  6049. }
  6050. });
  6051. }
  6052. }, {
  6053. key: "addModule",
  6054. value: function addModule(name) {
  6055. var moduleClass = this.quill.constructor.import("modules/" + name);
  6056. this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {});
  6057. return this.modules[name];
  6058. }
  6059. }]);
  6060. return Theme2;
  6061. })();
  6062. Theme.DEFAULTS = {
  6063. modules: {}
  6064. };
  6065. Theme.themes = {
  6066. "default": Theme
  6067. };
  6068. exports2.default = Theme;
  6069. }),
  6070. /* 35 */
  6071. /***/
  6072. (function(module2, exports2, __webpack_require__) {
  6073. "use strict";
  6074. Object.defineProperty(exports2, "__esModule", {
  6075. value: true
  6076. });
  6077. var _createClass = /* @__PURE__ */ (function() {
  6078. function defineProperties(target, props) {
  6079. for (var i = 0; i < props.length; i++) {
  6080. var descriptor = props[i];
  6081. descriptor.enumerable = descriptor.enumerable || false;
  6082. descriptor.configurable = true;
  6083. if ("value" in descriptor) descriptor.writable = true;
  6084. Object.defineProperty(target, descriptor.key, descriptor);
  6085. }
  6086. }
  6087. return function(Constructor, protoProps, staticProps) {
  6088. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  6089. if (staticProps) defineProperties(Constructor, staticProps);
  6090. return Constructor;
  6091. };
  6092. })();
  6093. var _get = function get(object, property, receiver) {
  6094. if (object === null) object = Function.prototype;
  6095. var desc = Object.getOwnPropertyDescriptor(object, property);
  6096. if (desc === void 0) {
  6097. var parent = Object.getPrototypeOf(object);
  6098. if (parent === null) {
  6099. return void 0;
  6100. } else {
  6101. return get(parent, property, receiver);
  6102. }
  6103. } else if ("value" in desc) {
  6104. return desc.value;
  6105. } else {
  6106. var getter = desc.get;
  6107. if (getter === void 0) {
  6108. return void 0;
  6109. }
  6110. return getter.call(receiver);
  6111. }
  6112. };
  6113. var _parchment = __webpack_require__(0);
  6114. var _parchment2 = _interopRequireDefault(_parchment);
  6115. var _text = __webpack_require__(7);
  6116. var _text2 = _interopRequireDefault(_text);
  6117. function _interopRequireDefault(obj) {
  6118. return obj && obj.__esModule ? obj : { default: obj };
  6119. }
  6120. function _classCallCheck(instance, Constructor) {
  6121. if (!(instance instanceof Constructor)) {
  6122. throw new TypeError("Cannot call a class as a function");
  6123. }
  6124. }
  6125. function _possibleConstructorReturn(self2, call) {
  6126. if (!self2) {
  6127. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  6128. }
  6129. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  6130. }
  6131. function _inherits(subClass, superClass) {
  6132. if (typeof superClass !== "function" && superClass !== null) {
  6133. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  6134. }
  6135. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  6136. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  6137. }
  6138. var GUARD_TEXT = "\uFEFF";
  6139. var Embed = (function(_Parchment$Embed) {
  6140. _inherits(Embed2, _Parchment$Embed);
  6141. function Embed2(node) {
  6142. _classCallCheck(this, Embed2);
  6143. var _this = _possibleConstructorReturn(this, (Embed2.__proto__ || Object.getPrototypeOf(Embed2)).call(this, node));
  6144. _this.contentNode = document.createElement("span");
  6145. _this.contentNode.setAttribute("contenteditable", false);
  6146. [].slice.call(_this.domNode.childNodes).forEach(function(childNode) {
  6147. _this.contentNode.appendChild(childNode);
  6148. });
  6149. _this.leftGuard = document.createTextNode(GUARD_TEXT);
  6150. _this.rightGuard = document.createTextNode(GUARD_TEXT);
  6151. _this.domNode.appendChild(_this.leftGuard);
  6152. _this.domNode.appendChild(_this.contentNode);
  6153. _this.domNode.appendChild(_this.rightGuard);
  6154. return _this;
  6155. }
  6156. _createClass(Embed2, [{
  6157. key: "index",
  6158. value: function index(node, offset) {
  6159. if (node === this.leftGuard) return 0;
  6160. if (node === this.rightGuard) return 1;
  6161. return _get(Embed2.prototype.__proto__ || Object.getPrototypeOf(Embed2.prototype), "index", this).call(this, node, offset);
  6162. }
  6163. }, {
  6164. key: "restore",
  6165. value: function restore(node) {
  6166. var range = void 0, textNode = void 0;
  6167. var text = node.data.split(GUARD_TEXT).join("");
  6168. if (node === this.leftGuard) {
  6169. if (this.prev instanceof _text2.default) {
  6170. var prevLength = this.prev.length();
  6171. this.prev.insertAt(prevLength, text);
  6172. range = {
  6173. startNode: this.prev.domNode,
  6174. startOffset: prevLength + text.length
  6175. };
  6176. } else {
  6177. textNode = document.createTextNode(text);
  6178. this.parent.insertBefore(_parchment2.default.create(textNode), this);
  6179. range = {
  6180. startNode: textNode,
  6181. startOffset: text.length
  6182. };
  6183. }
  6184. } else if (node === this.rightGuard) {
  6185. if (this.next instanceof _text2.default) {
  6186. this.next.insertAt(0, text);
  6187. range = {
  6188. startNode: this.next.domNode,
  6189. startOffset: text.length
  6190. };
  6191. } else {
  6192. textNode = document.createTextNode(text);
  6193. this.parent.insertBefore(_parchment2.default.create(textNode), this.next);
  6194. range = {
  6195. startNode: textNode,
  6196. startOffset: text.length
  6197. };
  6198. }
  6199. }
  6200. node.data = GUARD_TEXT;
  6201. return range;
  6202. }
  6203. }, {
  6204. key: "update",
  6205. value: function update(mutations, context) {
  6206. var _this2 = this;
  6207. mutations.forEach(function(mutation) {
  6208. if (mutation.type === "characterData" && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) {
  6209. var range = _this2.restore(mutation.target);
  6210. if (range) context.range = range;
  6211. }
  6212. });
  6213. }
  6214. }]);
  6215. return Embed2;
  6216. })(_parchment2.default.Embed);
  6217. exports2.default = Embed;
  6218. }),
  6219. /* 36 */
  6220. /***/
  6221. (function(module2, exports2, __webpack_require__) {
  6222. "use strict";
  6223. Object.defineProperty(exports2, "__esModule", {
  6224. value: true
  6225. });
  6226. exports2.AlignStyle = exports2.AlignClass = exports2.AlignAttribute = void 0;
  6227. var _parchment = __webpack_require__(0);
  6228. var _parchment2 = _interopRequireDefault(_parchment);
  6229. function _interopRequireDefault(obj) {
  6230. return obj && obj.__esModule ? obj : { default: obj };
  6231. }
  6232. var config = {
  6233. scope: _parchment2.default.Scope.BLOCK,
  6234. whitelist: ["right", "center", "justify"]
  6235. };
  6236. var AlignAttribute = new _parchment2.default.Attributor.Attribute("align", "align", config);
  6237. var AlignClass = new _parchment2.default.Attributor.Class("align", "ql-align", config);
  6238. var AlignStyle = new _parchment2.default.Attributor.Style("align", "text-align", config);
  6239. exports2.AlignAttribute = AlignAttribute;
  6240. exports2.AlignClass = AlignClass;
  6241. exports2.AlignStyle = AlignStyle;
  6242. }),
  6243. /* 37 */
  6244. /***/
  6245. (function(module2, exports2, __webpack_require__) {
  6246. "use strict";
  6247. Object.defineProperty(exports2, "__esModule", {
  6248. value: true
  6249. });
  6250. exports2.BackgroundStyle = exports2.BackgroundClass = void 0;
  6251. var _parchment = __webpack_require__(0);
  6252. var _parchment2 = _interopRequireDefault(_parchment);
  6253. var _color = __webpack_require__(26);
  6254. function _interopRequireDefault(obj) {
  6255. return obj && obj.__esModule ? obj : { default: obj };
  6256. }
  6257. var BackgroundClass = new _parchment2.default.Attributor.Class("background", "ql-bg", {
  6258. scope: _parchment2.default.Scope.INLINE
  6259. });
  6260. var BackgroundStyle = new _color.ColorAttributor("background", "background-color", {
  6261. scope: _parchment2.default.Scope.INLINE
  6262. });
  6263. exports2.BackgroundClass = BackgroundClass;
  6264. exports2.BackgroundStyle = BackgroundStyle;
  6265. }),
  6266. /* 38 */
  6267. /***/
  6268. (function(module2, exports2, __webpack_require__) {
  6269. "use strict";
  6270. Object.defineProperty(exports2, "__esModule", {
  6271. value: true
  6272. });
  6273. exports2.DirectionStyle = exports2.DirectionClass = exports2.DirectionAttribute = void 0;
  6274. var _parchment = __webpack_require__(0);
  6275. var _parchment2 = _interopRequireDefault(_parchment);
  6276. function _interopRequireDefault(obj) {
  6277. return obj && obj.__esModule ? obj : { default: obj };
  6278. }
  6279. var config = {
  6280. scope: _parchment2.default.Scope.BLOCK,
  6281. whitelist: ["rtl"]
  6282. };
  6283. var DirectionAttribute = new _parchment2.default.Attributor.Attribute("direction", "dir", config);
  6284. var DirectionClass = new _parchment2.default.Attributor.Class("direction", "ql-direction", config);
  6285. var DirectionStyle = new _parchment2.default.Attributor.Style("direction", "direction", config);
  6286. exports2.DirectionAttribute = DirectionAttribute;
  6287. exports2.DirectionClass = DirectionClass;
  6288. exports2.DirectionStyle = DirectionStyle;
  6289. }),
  6290. /* 39 */
  6291. /***/
  6292. (function(module2, exports2, __webpack_require__) {
  6293. "use strict";
  6294. Object.defineProperty(exports2, "__esModule", {
  6295. value: true
  6296. });
  6297. exports2.FontClass = exports2.FontStyle = void 0;
  6298. var _createClass = /* @__PURE__ */ (function() {
  6299. function defineProperties(target, props) {
  6300. for (var i = 0; i < props.length; i++) {
  6301. var descriptor = props[i];
  6302. descriptor.enumerable = descriptor.enumerable || false;
  6303. descriptor.configurable = true;
  6304. if ("value" in descriptor) descriptor.writable = true;
  6305. Object.defineProperty(target, descriptor.key, descriptor);
  6306. }
  6307. }
  6308. return function(Constructor, protoProps, staticProps) {
  6309. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  6310. if (staticProps) defineProperties(Constructor, staticProps);
  6311. return Constructor;
  6312. };
  6313. })();
  6314. var _get = function get(object, property, receiver) {
  6315. if (object === null) object = Function.prototype;
  6316. var desc = Object.getOwnPropertyDescriptor(object, property);
  6317. if (desc === void 0) {
  6318. var parent = Object.getPrototypeOf(object);
  6319. if (parent === null) {
  6320. return void 0;
  6321. } else {
  6322. return get(parent, property, receiver);
  6323. }
  6324. } else if ("value" in desc) {
  6325. return desc.value;
  6326. } else {
  6327. var getter = desc.get;
  6328. if (getter === void 0) {
  6329. return void 0;
  6330. }
  6331. return getter.call(receiver);
  6332. }
  6333. };
  6334. var _parchment = __webpack_require__(0);
  6335. var _parchment2 = _interopRequireDefault(_parchment);
  6336. function _interopRequireDefault(obj) {
  6337. return obj && obj.__esModule ? obj : { default: obj };
  6338. }
  6339. function _classCallCheck(instance, Constructor) {
  6340. if (!(instance instanceof Constructor)) {
  6341. throw new TypeError("Cannot call a class as a function");
  6342. }
  6343. }
  6344. function _possibleConstructorReturn(self2, call) {
  6345. if (!self2) {
  6346. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  6347. }
  6348. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  6349. }
  6350. function _inherits(subClass, superClass) {
  6351. if (typeof superClass !== "function" && superClass !== null) {
  6352. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  6353. }
  6354. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  6355. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  6356. }
  6357. var config = {
  6358. scope: _parchment2.default.Scope.INLINE,
  6359. whitelist: ["serif", "monospace"]
  6360. };
  6361. var FontClass = new _parchment2.default.Attributor.Class("font", "ql-font", config);
  6362. var FontStyleAttributor = (function(_Parchment$Attributor) {
  6363. _inherits(FontStyleAttributor2, _Parchment$Attributor);
  6364. function FontStyleAttributor2() {
  6365. _classCallCheck(this, FontStyleAttributor2);
  6366. return _possibleConstructorReturn(this, (FontStyleAttributor2.__proto__ || Object.getPrototypeOf(FontStyleAttributor2)).apply(this, arguments));
  6367. }
  6368. _createClass(FontStyleAttributor2, [{
  6369. key: "value",
  6370. value: function value(node) {
  6371. return _get(FontStyleAttributor2.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor2.prototype), "value", this).call(this, node).replace(/["']/g, "");
  6372. }
  6373. }]);
  6374. return FontStyleAttributor2;
  6375. })(_parchment2.default.Attributor.Style);
  6376. var FontStyle = new FontStyleAttributor("font", "font-family", config);
  6377. exports2.FontStyle = FontStyle;
  6378. exports2.FontClass = FontClass;
  6379. }),
  6380. /* 40 */
  6381. /***/
  6382. (function(module2, exports2, __webpack_require__) {
  6383. "use strict";
  6384. Object.defineProperty(exports2, "__esModule", {
  6385. value: true
  6386. });
  6387. exports2.SizeStyle = exports2.SizeClass = void 0;
  6388. var _parchment = __webpack_require__(0);
  6389. var _parchment2 = _interopRequireDefault(_parchment);
  6390. function _interopRequireDefault(obj) {
  6391. return obj && obj.__esModule ? obj : { default: obj };
  6392. }
  6393. var SizeClass = new _parchment2.default.Attributor.Class("size", "ql-size", {
  6394. scope: _parchment2.default.Scope.INLINE,
  6395. whitelist: ["small", "large", "huge"]
  6396. });
  6397. var SizeStyle = new _parchment2.default.Attributor.Style("size", "font-size", {
  6398. scope: _parchment2.default.Scope.INLINE,
  6399. whitelist: ["10px", "18px", "32px"]
  6400. });
  6401. exports2.SizeClass = SizeClass;
  6402. exports2.SizeStyle = SizeStyle;
  6403. }),
  6404. /* 41 */
  6405. /***/
  6406. (function(module2, exports2, __webpack_require__) {
  6407. "use strict";
  6408. module2.exports = {
  6409. "align": {
  6410. "": __webpack_require__(76),
  6411. "center": __webpack_require__(77),
  6412. "right": __webpack_require__(78),
  6413. "justify": __webpack_require__(79)
  6414. },
  6415. "background": __webpack_require__(80),
  6416. "blockquote": __webpack_require__(81),
  6417. "bold": __webpack_require__(82),
  6418. "clean": __webpack_require__(83),
  6419. "code": __webpack_require__(58),
  6420. "code-block": __webpack_require__(58),
  6421. "color": __webpack_require__(84),
  6422. "direction": {
  6423. "": __webpack_require__(85),
  6424. "rtl": __webpack_require__(86)
  6425. },
  6426. "float": {
  6427. "center": __webpack_require__(87),
  6428. "full": __webpack_require__(88),
  6429. "left": __webpack_require__(89),
  6430. "right": __webpack_require__(90)
  6431. },
  6432. "formula": __webpack_require__(91),
  6433. "header": {
  6434. "1": __webpack_require__(92),
  6435. "2": __webpack_require__(93)
  6436. },
  6437. "italic": __webpack_require__(94),
  6438. "image": __webpack_require__(95),
  6439. "indent": {
  6440. "+1": __webpack_require__(96),
  6441. "-1": __webpack_require__(97)
  6442. },
  6443. "link": __webpack_require__(98),
  6444. "list": {
  6445. "ordered": __webpack_require__(99),
  6446. "bullet": __webpack_require__(100),
  6447. "check": __webpack_require__(101)
  6448. },
  6449. "script": {
  6450. "sub": __webpack_require__(102),
  6451. "super": __webpack_require__(103)
  6452. },
  6453. "strike": __webpack_require__(104),
  6454. "underline": __webpack_require__(105),
  6455. "video": __webpack_require__(106)
  6456. };
  6457. }),
  6458. /* 42 */
  6459. /***/
  6460. (function(module2, exports2, __webpack_require__) {
  6461. "use strict";
  6462. Object.defineProperty(exports2, "__esModule", {
  6463. value: true
  6464. });
  6465. exports2.getLastChangeIndex = exports2.default = void 0;
  6466. var _createClass = /* @__PURE__ */ (function() {
  6467. function defineProperties(target, props) {
  6468. for (var i = 0; i < props.length; i++) {
  6469. var descriptor = props[i];
  6470. descriptor.enumerable = descriptor.enumerable || false;
  6471. descriptor.configurable = true;
  6472. if ("value" in descriptor) descriptor.writable = true;
  6473. Object.defineProperty(target, descriptor.key, descriptor);
  6474. }
  6475. }
  6476. return function(Constructor, protoProps, staticProps) {
  6477. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  6478. if (staticProps) defineProperties(Constructor, staticProps);
  6479. return Constructor;
  6480. };
  6481. })();
  6482. var _parchment = __webpack_require__(0);
  6483. var _parchment2 = _interopRequireDefault(_parchment);
  6484. var _quill = __webpack_require__(5);
  6485. var _quill2 = _interopRequireDefault(_quill);
  6486. var _module = __webpack_require__(9);
  6487. var _module2 = _interopRequireDefault(_module);
  6488. function _interopRequireDefault(obj) {
  6489. return obj && obj.__esModule ? obj : { default: obj };
  6490. }
  6491. function _classCallCheck(instance, Constructor) {
  6492. if (!(instance instanceof Constructor)) {
  6493. throw new TypeError("Cannot call a class as a function");
  6494. }
  6495. }
  6496. function _possibleConstructorReturn(self2, call) {
  6497. if (!self2) {
  6498. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  6499. }
  6500. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  6501. }
  6502. function _inherits(subClass, superClass) {
  6503. if (typeof superClass !== "function" && superClass !== null) {
  6504. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  6505. }
  6506. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  6507. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  6508. }
  6509. var History = (function(_Module) {
  6510. _inherits(History2, _Module);
  6511. function History2(quill, options) {
  6512. _classCallCheck(this, History2);
  6513. var _this = _possibleConstructorReturn(this, (History2.__proto__ || Object.getPrototypeOf(History2)).call(this, quill, options));
  6514. _this.lastRecorded = 0;
  6515. _this.ignoreChange = false;
  6516. _this.clear();
  6517. _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function(eventName, delta, oldDelta, source) {
  6518. if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return;
  6519. if (!_this.options.userOnly || source === _quill2.default.sources.USER) {
  6520. _this.record(delta, oldDelta);
  6521. } else {
  6522. _this.transform(delta);
  6523. }
  6524. });
  6525. _this.quill.keyboard.addBinding({ key: "Z", shortKey: true }, _this.undo.bind(_this));
  6526. _this.quill.keyboard.addBinding({ key: "Z", shortKey: true, shiftKey: true }, _this.redo.bind(_this));
  6527. if (/Win/i.test(navigator.platform)) {
  6528. _this.quill.keyboard.addBinding({ key: "Y", shortKey: true }, _this.redo.bind(_this));
  6529. }
  6530. return _this;
  6531. }
  6532. _createClass(History2, [{
  6533. key: "change",
  6534. value: function change(source, dest) {
  6535. if (this.stack[source].length === 0) return;
  6536. var delta = this.stack[source].pop();
  6537. this.stack[dest].push(delta);
  6538. this.lastRecorded = 0;
  6539. this.ignoreChange = true;
  6540. this.quill.updateContents(delta[source], _quill2.default.sources.USER);
  6541. this.ignoreChange = false;
  6542. var index = getLastChangeIndex(delta[source]);
  6543. this.quill.setSelection(index);
  6544. }
  6545. }, {
  6546. key: "clear",
  6547. value: function clear() {
  6548. this.stack = { undo: [], redo: [] };
  6549. }
  6550. }, {
  6551. key: "cutoff",
  6552. value: function cutoff() {
  6553. this.lastRecorded = 0;
  6554. }
  6555. }, {
  6556. key: "record",
  6557. value: function record(changeDelta, oldDelta) {
  6558. if (changeDelta.ops.length === 0) return;
  6559. this.stack.redo = [];
  6560. var undoDelta = this.quill.getContents().diff(oldDelta);
  6561. var timestamp = Date.now();
  6562. if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {
  6563. var delta = this.stack.undo.pop();
  6564. undoDelta = undoDelta.compose(delta.undo);
  6565. changeDelta = delta.redo.compose(changeDelta);
  6566. } else {
  6567. this.lastRecorded = timestamp;
  6568. }
  6569. this.stack.undo.push({
  6570. redo: changeDelta,
  6571. undo: undoDelta
  6572. });
  6573. if (this.stack.undo.length > this.options.maxStack) {
  6574. this.stack.undo.shift();
  6575. }
  6576. }
  6577. }, {
  6578. key: "redo",
  6579. value: function redo() {
  6580. this.change("redo", "undo");
  6581. }
  6582. }, {
  6583. key: "transform",
  6584. value: function transform(delta) {
  6585. this.stack.undo.forEach(function(change) {
  6586. change.undo = delta.transform(change.undo, true);
  6587. change.redo = delta.transform(change.redo, true);
  6588. });
  6589. this.stack.redo.forEach(function(change) {
  6590. change.undo = delta.transform(change.undo, true);
  6591. change.redo = delta.transform(change.redo, true);
  6592. });
  6593. }
  6594. }, {
  6595. key: "undo",
  6596. value: function undo() {
  6597. this.change("undo", "redo");
  6598. }
  6599. }]);
  6600. return History2;
  6601. })(_module2.default);
  6602. History.DEFAULTS = {
  6603. delay: 1e3,
  6604. maxStack: 100,
  6605. userOnly: false
  6606. };
  6607. function endsWithNewlineChange(delta) {
  6608. var lastOp = delta.ops[delta.ops.length - 1];
  6609. if (lastOp == null) return false;
  6610. if (lastOp.insert != null) {
  6611. return typeof lastOp.insert === "string" && lastOp.insert.endsWith("\n");
  6612. }
  6613. if (lastOp.attributes != null) {
  6614. return Object.keys(lastOp.attributes).some(function(attr) {
  6615. return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null;
  6616. });
  6617. }
  6618. return false;
  6619. }
  6620. function getLastChangeIndex(delta) {
  6621. var deleteLength = delta.reduce(function(length, op) {
  6622. length += op.delete || 0;
  6623. return length;
  6624. }, 0);
  6625. var changeIndex = delta.length() - deleteLength;
  6626. if (endsWithNewlineChange(delta)) {
  6627. changeIndex -= 1;
  6628. }
  6629. return changeIndex;
  6630. }
  6631. exports2.default = History;
  6632. exports2.getLastChangeIndex = getLastChangeIndex;
  6633. }),
  6634. /* 43 */
  6635. /***/
  6636. (function(module2, exports2, __webpack_require__) {
  6637. "use strict";
  6638. Object.defineProperty(exports2, "__esModule", {
  6639. value: true
  6640. });
  6641. exports2.default = exports2.BaseTooltip = void 0;
  6642. var _createClass = /* @__PURE__ */ (function() {
  6643. function defineProperties(target, props) {
  6644. for (var i = 0; i < props.length; i++) {
  6645. var descriptor = props[i];
  6646. descriptor.enumerable = descriptor.enumerable || false;
  6647. descriptor.configurable = true;
  6648. if ("value" in descriptor) descriptor.writable = true;
  6649. Object.defineProperty(target, descriptor.key, descriptor);
  6650. }
  6651. }
  6652. return function(Constructor, protoProps, staticProps) {
  6653. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  6654. if (staticProps) defineProperties(Constructor, staticProps);
  6655. return Constructor;
  6656. };
  6657. })();
  6658. var _get = function get(object, property, receiver) {
  6659. if (object === null) object = Function.prototype;
  6660. var desc = Object.getOwnPropertyDescriptor(object, property);
  6661. if (desc === void 0) {
  6662. var parent = Object.getPrototypeOf(object);
  6663. if (parent === null) {
  6664. return void 0;
  6665. } else {
  6666. return get(parent, property, receiver);
  6667. }
  6668. } else if ("value" in desc) {
  6669. return desc.value;
  6670. } else {
  6671. var getter = desc.get;
  6672. if (getter === void 0) {
  6673. return void 0;
  6674. }
  6675. return getter.call(receiver);
  6676. }
  6677. };
  6678. var _extend = __webpack_require__(3);
  6679. var _extend2 = _interopRequireDefault(_extend);
  6680. var _quillDelta = __webpack_require__(2);
  6681. var _quillDelta2 = _interopRequireDefault(_quillDelta);
  6682. var _emitter = __webpack_require__(8);
  6683. var _emitter2 = _interopRequireDefault(_emitter);
  6684. var _keyboard = __webpack_require__(23);
  6685. var _keyboard2 = _interopRequireDefault(_keyboard);
  6686. var _theme = __webpack_require__(34);
  6687. var _theme2 = _interopRequireDefault(_theme);
  6688. var _colorPicker = __webpack_require__(59);
  6689. var _colorPicker2 = _interopRequireDefault(_colorPicker);
  6690. var _iconPicker = __webpack_require__(60);
  6691. var _iconPicker2 = _interopRequireDefault(_iconPicker);
  6692. var _picker = __webpack_require__(28);
  6693. var _picker2 = _interopRequireDefault(_picker);
  6694. var _tooltip = __webpack_require__(61);
  6695. var _tooltip2 = _interopRequireDefault(_tooltip);
  6696. function _interopRequireDefault(obj) {
  6697. return obj && obj.__esModule ? obj : { default: obj };
  6698. }
  6699. function _classCallCheck(instance, Constructor) {
  6700. if (!(instance instanceof Constructor)) {
  6701. throw new TypeError("Cannot call a class as a function");
  6702. }
  6703. }
  6704. function _possibleConstructorReturn(self2, call) {
  6705. if (!self2) {
  6706. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  6707. }
  6708. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  6709. }
  6710. function _inherits(subClass, superClass) {
  6711. if (typeof superClass !== "function" && superClass !== null) {
  6712. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  6713. }
  6714. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  6715. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  6716. }
  6717. var ALIGNS = [false, "center", "right", "justify"];
  6718. var COLORS = ["#000000", "#e60000", "#ff9900", "#ffff00", "#008a00", "#0066cc", "#9933ff", "#ffffff", "#facccc", "#ffebcc", "#ffffcc", "#cce8cc", "#cce0f5", "#ebd6ff", "#bbbbbb", "#f06666", "#ffc266", "#ffff66", "#66b966", "#66a3e0", "#c285ff", "#888888", "#a10000", "#b26b00", "#b2b200", "#006100", "#0047b2", "#6b24b2", "#444444", "#5c0000", "#663d00", "#666600", "#003700", "#002966", "#3d1466"];
  6719. var FONTS = [false, "serif", "monospace"];
  6720. var HEADERS = ["1", "2", "3", false];
  6721. var SIZES = ["small", false, "large", "huge"];
  6722. var BaseTheme = (function(_Theme) {
  6723. _inherits(BaseTheme2, _Theme);
  6724. function BaseTheme2(quill, options) {
  6725. _classCallCheck(this, BaseTheme2);
  6726. var _this = _possibleConstructorReturn(this, (BaseTheme2.__proto__ || Object.getPrototypeOf(BaseTheme2)).call(this, quill, options));
  6727. var listener = function listener2(e) {
  6728. if (!document.body.contains(quill.root)) {
  6729. return document.body.removeEventListener("click", listener2);
  6730. }
  6731. if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) {
  6732. _this.tooltip.hide();
  6733. }
  6734. if (_this.pickers != null) {
  6735. _this.pickers.forEach(function(picker) {
  6736. if (!picker.container.contains(e.target)) {
  6737. picker.close();
  6738. }
  6739. });
  6740. }
  6741. };
  6742. quill.emitter.listenDOM("click", document.body, listener);
  6743. return _this;
  6744. }
  6745. _createClass(BaseTheme2, [{
  6746. key: "addModule",
  6747. value: function addModule(name) {
  6748. var module3 = _get(BaseTheme2.prototype.__proto__ || Object.getPrototypeOf(BaseTheme2.prototype), "addModule", this).call(this, name);
  6749. if (name === "toolbar") {
  6750. this.extendToolbar(module3);
  6751. }
  6752. return module3;
  6753. }
  6754. }, {
  6755. key: "buildButtons",
  6756. value: function buildButtons(buttons, icons) {
  6757. buttons.forEach(function(button) {
  6758. var className = button.getAttribute("class") || "";
  6759. className.split(/\s+/).forEach(function(name) {
  6760. if (!name.startsWith("ql-")) return;
  6761. name = name.slice("ql-".length);
  6762. if (icons[name] == null) return;
  6763. if (name === "direction") {
  6764. button.innerHTML = icons[name][""] + icons[name]["rtl"];
  6765. } else if (typeof icons[name] === "string") {
  6766. button.innerHTML = icons[name];
  6767. } else {
  6768. var value = button.value || "";
  6769. if (value != null && icons[name][value]) {
  6770. button.innerHTML = icons[name][value];
  6771. }
  6772. }
  6773. });
  6774. });
  6775. }
  6776. }, {
  6777. key: "buildPickers",
  6778. value: function buildPickers(selects, icons) {
  6779. var _this2 = this;
  6780. this.pickers = selects.map(function(select) {
  6781. if (select.classList.contains("ql-align")) {
  6782. if (select.querySelector("option") == null) {
  6783. fillSelect(select, ALIGNS);
  6784. }
  6785. return new _iconPicker2.default(select, icons.align);
  6786. } else if (select.classList.contains("ql-background") || select.classList.contains("ql-color")) {
  6787. var format = select.classList.contains("ql-background") ? "background" : "color";
  6788. if (select.querySelector("option") == null) {
  6789. fillSelect(select, COLORS, format === "background" ? "#ffffff" : "#000000");
  6790. }
  6791. return new _colorPicker2.default(select, icons[format]);
  6792. } else {
  6793. if (select.querySelector("option") == null) {
  6794. if (select.classList.contains("ql-font")) {
  6795. fillSelect(select, FONTS);
  6796. } else if (select.classList.contains("ql-header")) {
  6797. fillSelect(select, HEADERS);
  6798. } else if (select.classList.contains("ql-size")) {
  6799. fillSelect(select, SIZES);
  6800. }
  6801. }
  6802. return new _picker2.default(select);
  6803. }
  6804. });
  6805. var update = function update2() {
  6806. _this2.pickers.forEach(function(picker) {
  6807. picker.update();
  6808. });
  6809. };
  6810. this.quill.on(_emitter2.default.events.EDITOR_CHANGE, update);
  6811. }
  6812. }]);
  6813. return BaseTheme2;
  6814. })(_theme2.default);
  6815. BaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, {
  6816. modules: {
  6817. toolbar: {
  6818. handlers: {
  6819. formula: function formula() {
  6820. this.quill.theme.tooltip.edit("formula");
  6821. },
  6822. image: function image() {
  6823. var _this3 = this;
  6824. var fileInput = this.container.querySelector("input.ql-image[type=file]");
  6825. if (fileInput == null) {
  6826. fileInput = document.createElement("input");
  6827. fileInput.setAttribute("type", "file");
  6828. fileInput.setAttribute("accept", "image/png, image/gif, image/jpeg, image/bmp, image/x-icon");
  6829. fileInput.classList.add("ql-image");
  6830. fileInput.addEventListener("change", function() {
  6831. if (fileInput.files != null && fileInput.files[0] != null) {
  6832. var reader = new FileReader();
  6833. reader.onload = function(e) {
  6834. var range = _this3.quill.getSelection(true);
  6835. _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER);
  6836. _this3.quill.setSelection(range.index + 1, _emitter2.default.sources.SILENT);
  6837. fileInput.value = "";
  6838. };
  6839. reader.readAsDataURL(fileInput.files[0]);
  6840. }
  6841. });
  6842. this.container.appendChild(fileInput);
  6843. }
  6844. fileInput.click();
  6845. },
  6846. video: function video() {
  6847. this.quill.theme.tooltip.edit("video");
  6848. }
  6849. }
  6850. }
  6851. }
  6852. });
  6853. var BaseTooltip = (function(_Tooltip) {
  6854. _inherits(BaseTooltip2, _Tooltip);
  6855. function BaseTooltip2(quill, boundsContainer) {
  6856. _classCallCheck(this, BaseTooltip2);
  6857. var _this4 = _possibleConstructorReturn(this, (BaseTooltip2.__proto__ || Object.getPrototypeOf(BaseTooltip2)).call(this, quill, boundsContainer));
  6858. _this4.textbox = _this4.root.querySelector('input[type="text"]');
  6859. _this4.listen();
  6860. return _this4;
  6861. }
  6862. _createClass(BaseTooltip2, [{
  6863. key: "listen",
  6864. value: function listen() {
  6865. var _this5 = this;
  6866. this.textbox.addEventListener("keydown", function(event) {
  6867. if (_keyboard2.default.match(event, "enter")) {
  6868. _this5.save();
  6869. event.preventDefault();
  6870. } else if (_keyboard2.default.match(event, "escape")) {
  6871. _this5.cancel();
  6872. event.preventDefault();
  6873. }
  6874. });
  6875. }
  6876. }, {
  6877. key: "cancel",
  6878. value: function cancel() {
  6879. this.hide();
  6880. }
  6881. }, {
  6882. key: "edit",
  6883. value: function edit() {
  6884. var mode = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "link";
  6885. var preview = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
  6886. this.root.classList.remove("ql-hidden");
  6887. this.root.classList.add("ql-editing");
  6888. if (preview != null) {
  6889. this.textbox.value = preview;
  6890. } else if (mode !== this.root.getAttribute("data-mode")) {
  6891. this.textbox.value = "";
  6892. }
  6893. this.position(this.quill.getBounds(this.quill.selection.savedRange));
  6894. this.textbox.select();
  6895. this.textbox.setAttribute("placeholder", this.textbox.getAttribute("data-" + mode) || "");
  6896. this.root.setAttribute("data-mode", mode);
  6897. }
  6898. }, {
  6899. key: "restoreFocus",
  6900. value: function restoreFocus() {
  6901. var scrollTop = this.quill.scrollingContainer.scrollTop;
  6902. this.quill.focus();
  6903. this.quill.scrollingContainer.scrollTop = scrollTop;
  6904. }
  6905. }, {
  6906. key: "save",
  6907. value: function save() {
  6908. var value = this.textbox.value;
  6909. switch (this.root.getAttribute("data-mode")) {
  6910. case "link": {
  6911. var scrollTop = this.quill.root.scrollTop;
  6912. if (this.linkRange) {
  6913. this.quill.formatText(this.linkRange, "link", value, _emitter2.default.sources.USER);
  6914. delete this.linkRange;
  6915. } else {
  6916. this.restoreFocus();
  6917. this.quill.format("link", value, _emitter2.default.sources.USER);
  6918. }
  6919. this.quill.root.scrollTop = scrollTop;
  6920. break;
  6921. }
  6922. case "video": {
  6923. value = extractVideoUrl(value);
  6924. }
  6925. // eslint-disable-next-line no-fallthrough
  6926. case "formula": {
  6927. if (!value) break;
  6928. var range = this.quill.getSelection(true);
  6929. if (range != null) {
  6930. var index = range.index + range.length;
  6931. this.quill.insertEmbed(index, this.root.getAttribute("data-mode"), value, _emitter2.default.sources.USER);
  6932. if (this.root.getAttribute("data-mode") === "formula") {
  6933. this.quill.insertText(index + 1, " ", _emitter2.default.sources.USER);
  6934. }
  6935. this.quill.setSelection(index + 2, _emitter2.default.sources.USER);
  6936. }
  6937. break;
  6938. }
  6939. default:
  6940. }
  6941. this.textbox.value = "";
  6942. this.hide();
  6943. }
  6944. }]);
  6945. return BaseTooltip2;
  6946. })(_tooltip2.default);
  6947. function extractVideoUrl(url) {
  6948. var match = url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/) || url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);
  6949. if (match) {
  6950. return (match[1] || "https") + "://www.youtube.com/embed/" + match[2] + "?showinfo=0";
  6951. }
  6952. if (match = url.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/)) {
  6953. return (match[1] || "https") + "://player.vimeo.com/video/" + match[2] + "/";
  6954. }
  6955. return url;
  6956. }
  6957. function fillSelect(select, values) {
  6958. var defaultValue = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
  6959. values.forEach(function(value) {
  6960. var option = document.createElement("option");
  6961. if (value === defaultValue) {
  6962. option.setAttribute("selected", "selected");
  6963. } else {
  6964. option.setAttribute("value", value);
  6965. }
  6966. select.appendChild(option);
  6967. });
  6968. }
  6969. exports2.BaseTooltip = BaseTooltip;
  6970. exports2.default = BaseTheme;
  6971. }),
  6972. /* 44 */
  6973. /***/
  6974. (function(module2, exports2, __webpack_require__) {
  6975. "use strict";
  6976. Object.defineProperty(exports2, "__esModule", { value: true });
  6977. var LinkedList = (
  6978. /** @class */
  6979. (function() {
  6980. function LinkedList2() {
  6981. this.head = this.tail = null;
  6982. this.length = 0;
  6983. }
  6984. LinkedList2.prototype.append = function() {
  6985. var nodes = [];
  6986. for (var _i = 0; _i < arguments.length; _i++) {
  6987. nodes[_i] = arguments[_i];
  6988. }
  6989. this.insertBefore(nodes[0], null);
  6990. if (nodes.length > 1) {
  6991. this.append.apply(this, nodes.slice(1));
  6992. }
  6993. };
  6994. LinkedList2.prototype.contains = function(node) {
  6995. var cur, next = this.iterator();
  6996. while (cur = next()) {
  6997. if (cur === node)
  6998. return true;
  6999. }
  7000. return false;
  7001. };
  7002. LinkedList2.prototype.insertBefore = function(node, refNode) {
  7003. if (!node)
  7004. return;
  7005. node.next = refNode;
  7006. if (refNode != null) {
  7007. node.prev = refNode.prev;
  7008. if (refNode.prev != null) {
  7009. refNode.prev.next = node;
  7010. }
  7011. refNode.prev = node;
  7012. if (refNode === this.head) {
  7013. this.head = node;
  7014. }
  7015. } else if (this.tail != null) {
  7016. this.tail.next = node;
  7017. node.prev = this.tail;
  7018. this.tail = node;
  7019. } else {
  7020. node.prev = null;
  7021. this.head = this.tail = node;
  7022. }
  7023. this.length += 1;
  7024. };
  7025. LinkedList2.prototype.offset = function(target) {
  7026. var index = 0, cur = this.head;
  7027. while (cur != null) {
  7028. if (cur === target)
  7029. return index;
  7030. index += cur.length();
  7031. cur = cur.next;
  7032. }
  7033. return -1;
  7034. };
  7035. LinkedList2.prototype.remove = function(node) {
  7036. if (!this.contains(node))
  7037. return;
  7038. if (node.prev != null)
  7039. node.prev.next = node.next;
  7040. if (node.next != null)
  7041. node.next.prev = node.prev;
  7042. if (node === this.head)
  7043. this.head = node.next;
  7044. if (node === this.tail)
  7045. this.tail = node.prev;
  7046. this.length -= 1;
  7047. };
  7048. LinkedList2.prototype.iterator = function(curNode) {
  7049. if (curNode === void 0) {
  7050. curNode = this.head;
  7051. }
  7052. return function() {
  7053. var ret = curNode;
  7054. if (curNode != null)
  7055. curNode = curNode.next;
  7056. return ret;
  7057. };
  7058. };
  7059. LinkedList2.prototype.find = function(index, inclusive) {
  7060. if (inclusive === void 0) {
  7061. inclusive = false;
  7062. }
  7063. var cur, next = this.iterator();
  7064. while (cur = next()) {
  7065. var length = cur.length();
  7066. if (index < length || inclusive && index === length && (cur.next == null || cur.next.length() !== 0)) {
  7067. return [cur, index];
  7068. }
  7069. index -= length;
  7070. }
  7071. return [null, 0];
  7072. };
  7073. LinkedList2.prototype.forEach = function(callback) {
  7074. var cur, next = this.iterator();
  7075. while (cur = next()) {
  7076. callback(cur);
  7077. }
  7078. };
  7079. LinkedList2.prototype.forEachAt = function(index, length, callback) {
  7080. if (length <= 0)
  7081. return;
  7082. var _a = this.find(index), startNode = _a[0], offset = _a[1];
  7083. var cur, curIndex = index - offset, next = this.iterator(startNode);
  7084. while ((cur = next()) && curIndex < index + length) {
  7085. var curLength = cur.length();
  7086. if (index > curIndex) {
  7087. callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index));
  7088. } else {
  7089. callback(cur, 0, Math.min(curLength, index + length - curIndex));
  7090. }
  7091. curIndex += curLength;
  7092. }
  7093. };
  7094. LinkedList2.prototype.map = function(callback) {
  7095. return this.reduce(function(memo, cur) {
  7096. memo.push(callback(cur));
  7097. return memo;
  7098. }, []);
  7099. };
  7100. LinkedList2.prototype.reduce = function(callback, memo) {
  7101. var cur, next = this.iterator();
  7102. while (cur = next()) {
  7103. memo = callback(memo, cur);
  7104. }
  7105. return memo;
  7106. };
  7107. return LinkedList2;
  7108. })()
  7109. );
  7110. exports2.default = LinkedList;
  7111. }),
  7112. /* 45 */
  7113. /***/
  7114. (function(module2, exports2, __webpack_require__) {
  7115. "use strict";
  7116. var __extends = this && this.__extends || (function() {
  7117. var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
  7118. d.__proto__ = b;
  7119. } || function(d, b) {
  7120. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  7121. };
  7122. return function(d, b) {
  7123. extendStatics(d, b);
  7124. function __() {
  7125. this.constructor = d;
  7126. }
  7127. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  7128. };
  7129. })();
  7130. Object.defineProperty(exports2, "__esModule", { value: true });
  7131. var container_1 = __webpack_require__(17);
  7132. var Registry = __webpack_require__(1);
  7133. var OBSERVER_CONFIG = {
  7134. attributes: true,
  7135. characterData: true,
  7136. characterDataOldValue: true,
  7137. childList: true,
  7138. subtree: true
  7139. };
  7140. var MAX_OPTIMIZE_ITERATIONS = 100;
  7141. var ScrollBlot = (
  7142. /** @class */
  7143. (function(_super) {
  7144. __extends(ScrollBlot2, _super);
  7145. function ScrollBlot2(node) {
  7146. var _this = _super.call(this, node) || this;
  7147. _this.scroll = _this;
  7148. _this.observer = new MutationObserver(function(mutations) {
  7149. _this.update(mutations);
  7150. });
  7151. _this.observer.observe(_this.domNode, OBSERVER_CONFIG);
  7152. _this.attach();
  7153. return _this;
  7154. }
  7155. ScrollBlot2.prototype.detach = function() {
  7156. _super.prototype.detach.call(this);
  7157. this.observer.disconnect();
  7158. };
  7159. ScrollBlot2.prototype.deleteAt = function(index, length) {
  7160. this.update();
  7161. if (index === 0 && length === this.length()) {
  7162. this.children.forEach(function(child) {
  7163. child.remove();
  7164. });
  7165. } else {
  7166. _super.prototype.deleteAt.call(this, index, length);
  7167. }
  7168. };
  7169. ScrollBlot2.prototype.formatAt = function(index, length, name, value) {
  7170. this.update();
  7171. _super.prototype.formatAt.call(this, index, length, name, value);
  7172. };
  7173. ScrollBlot2.prototype.insertAt = function(index, value, def) {
  7174. this.update();
  7175. _super.prototype.insertAt.call(this, index, value, def);
  7176. };
  7177. ScrollBlot2.prototype.optimize = function(mutations, context) {
  7178. var _this = this;
  7179. if (mutations === void 0) {
  7180. mutations = [];
  7181. }
  7182. if (context === void 0) {
  7183. context = {};
  7184. }
  7185. _super.prototype.optimize.call(this, context);
  7186. var records = [].slice.call(this.observer.takeRecords());
  7187. while (records.length > 0)
  7188. mutations.push(records.pop());
  7189. var mark = function(blot, markParent) {
  7190. if (markParent === void 0) {
  7191. markParent = true;
  7192. }
  7193. if (blot == null || blot === _this)
  7194. return;
  7195. if (blot.domNode.parentNode == null)
  7196. return;
  7197. if (blot.domNode[Registry.DATA_KEY].mutations == null) {
  7198. blot.domNode[Registry.DATA_KEY].mutations = [];
  7199. }
  7200. if (markParent)
  7201. mark(blot.parent);
  7202. };
  7203. var optimize = function(blot) {
  7204. if (
  7205. // @ts-ignore
  7206. blot.domNode[Registry.DATA_KEY] == null || // @ts-ignore
  7207. blot.domNode[Registry.DATA_KEY].mutations == null
  7208. ) {
  7209. return;
  7210. }
  7211. if (blot instanceof container_1.default) {
  7212. blot.children.forEach(optimize);
  7213. }
  7214. blot.optimize(context);
  7215. };
  7216. var remaining = mutations;
  7217. for (var i = 0; remaining.length > 0; i += 1) {
  7218. if (i >= MAX_OPTIMIZE_ITERATIONS) {
  7219. throw new Error("[Parchment] Maximum optimize iterations reached");
  7220. }
  7221. remaining.forEach(function(mutation) {
  7222. var blot = Registry.find(mutation.target, true);
  7223. if (blot == null)
  7224. return;
  7225. if (blot.domNode === mutation.target) {
  7226. if (mutation.type === "childList") {
  7227. mark(Registry.find(mutation.previousSibling, false));
  7228. [].forEach.call(mutation.addedNodes, function(node) {
  7229. var child = Registry.find(node, false);
  7230. mark(child, false);
  7231. if (child instanceof container_1.default) {
  7232. child.children.forEach(function(grandChild) {
  7233. mark(grandChild, false);
  7234. });
  7235. }
  7236. });
  7237. } else if (mutation.type === "attributes") {
  7238. mark(blot.prev);
  7239. }
  7240. }
  7241. mark(blot);
  7242. });
  7243. this.children.forEach(optimize);
  7244. remaining = [].slice.call(this.observer.takeRecords());
  7245. records = remaining.slice();
  7246. while (records.length > 0)
  7247. mutations.push(records.pop());
  7248. }
  7249. };
  7250. ScrollBlot2.prototype.update = function(mutations, context) {
  7251. var _this = this;
  7252. if (context === void 0) {
  7253. context = {};
  7254. }
  7255. mutations = mutations || this.observer.takeRecords();
  7256. mutations.map(function(mutation) {
  7257. var blot = Registry.find(mutation.target, true);
  7258. if (blot == null)
  7259. return null;
  7260. if (blot.domNode[Registry.DATA_KEY].mutations == null) {
  7261. blot.domNode[Registry.DATA_KEY].mutations = [mutation];
  7262. return blot;
  7263. } else {
  7264. blot.domNode[Registry.DATA_KEY].mutations.push(mutation);
  7265. return null;
  7266. }
  7267. }).forEach(function(blot) {
  7268. if (blot == null || blot === _this || //@ts-ignore
  7269. blot.domNode[Registry.DATA_KEY] == null)
  7270. return;
  7271. blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context);
  7272. });
  7273. if (this.domNode[Registry.DATA_KEY].mutations != null) {
  7274. _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context);
  7275. }
  7276. this.optimize(mutations, context);
  7277. };
  7278. ScrollBlot2.blotName = "scroll";
  7279. ScrollBlot2.defaultChild = "block";
  7280. ScrollBlot2.scope = Registry.Scope.BLOCK_BLOT;
  7281. ScrollBlot2.tagName = "DIV";
  7282. return ScrollBlot2;
  7283. })(container_1.default)
  7284. );
  7285. exports2.default = ScrollBlot;
  7286. }),
  7287. /* 46 */
  7288. /***/
  7289. (function(module2, exports2, __webpack_require__) {
  7290. "use strict";
  7291. var __extends = this && this.__extends || (function() {
  7292. var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
  7293. d.__proto__ = b;
  7294. } || function(d, b) {
  7295. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  7296. };
  7297. return function(d, b) {
  7298. extendStatics(d, b);
  7299. function __() {
  7300. this.constructor = d;
  7301. }
  7302. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  7303. };
  7304. })();
  7305. Object.defineProperty(exports2, "__esModule", { value: true });
  7306. var format_1 = __webpack_require__(18);
  7307. var Registry = __webpack_require__(1);
  7308. function isEqual(obj1, obj2) {
  7309. if (Object.keys(obj1).length !== Object.keys(obj2).length)
  7310. return false;
  7311. for (var prop in obj1) {
  7312. if (obj1[prop] !== obj2[prop])
  7313. return false;
  7314. }
  7315. return true;
  7316. }
  7317. var InlineBlot = (
  7318. /** @class */
  7319. (function(_super) {
  7320. __extends(InlineBlot2, _super);
  7321. function InlineBlot2() {
  7322. return _super !== null && _super.apply(this, arguments) || this;
  7323. }
  7324. InlineBlot2.formats = function(domNode) {
  7325. if (domNode.tagName === InlineBlot2.tagName)
  7326. return void 0;
  7327. return _super.formats.call(this, domNode);
  7328. };
  7329. InlineBlot2.prototype.format = function(name, value) {
  7330. var _this = this;
  7331. if (name === this.statics.blotName && !value) {
  7332. this.children.forEach(function(child) {
  7333. if (!(child instanceof format_1.default)) {
  7334. child = child.wrap(InlineBlot2.blotName, true);
  7335. }
  7336. _this.attributes.copy(child);
  7337. });
  7338. this.unwrap();
  7339. } else {
  7340. _super.prototype.format.call(this, name, value);
  7341. }
  7342. };
  7343. InlineBlot2.prototype.formatAt = function(index, length, name, value) {
  7344. if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) {
  7345. var blot = this.isolate(index, length);
  7346. blot.format(name, value);
  7347. } else {
  7348. _super.prototype.formatAt.call(this, index, length, name, value);
  7349. }
  7350. };
  7351. InlineBlot2.prototype.optimize = function(context) {
  7352. _super.prototype.optimize.call(this, context);
  7353. var formats = this.formats();
  7354. if (Object.keys(formats).length === 0) {
  7355. return this.unwrap();
  7356. }
  7357. var next = this.next;
  7358. if (next instanceof InlineBlot2 && next.prev === this && isEqual(formats, next.formats())) {
  7359. next.moveChildren(this);
  7360. next.remove();
  7361. }
  7362. };
  7363. InlineBlot2.blotName = "inline";
  7364. InlineBlot2.scope = Registry.Scope.INLINE_BLOT;
  7365. InlineBlot2.tagName = "SPAN";
  7366. return InlineBlot2;
  7367. })(format_1.default)
  7368. );
  7369. exports2.default = InlineBlot;
  7370. }),
  7371. /* 47 */
  7372. /***/
  7373. (function(module2, exports2, __webpack_require__) {
  7374. "use strict";
  7375. var __extends = this && this.__extends || (function() {
  7376. var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
  7377. d.__proto__ = b;
  7378. } || function(d, b) {
  7379. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  7380. };
  7381. return function(d, b) {
  7382. extendStatics(d, b);
  7383. function __() {
  7384. this.constructor = d;
  7385. }
  7386. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  7387. };
  7388. })();
  7389. Object.defineProperty(exports2, "__esModule", { value: true });
  7390. var format_1 = __webpack_require__(18);
  7391. var Registry = __webpack_require__(1);
  7392. var BlockBlot = (
  7393. /** @class */
  7394. (function(_super) {
  7395. __extends(BlockBlot2, _super);
  7396. function BlockBlot2() {
  7397. return _super !== null && _super.apply(this, arguments) || this;
  7398. }
  7399. BlockBlot2.formats = function(domNode) {
  7400. var tagName = Registry.query(BlockBlot2.blotName).tagName;
  7401. if (domNode.tagName === tagName)
  7402. return void 0;
  7403. return _super.formats.call(this, domNode);
  7404. };
  7405. BlockBlot2.prototype.format = function(name, value) {
  7406. if (Registry.query(name, Registry.Scope.BLOCK) == null) {
  7407. return;
  7408. } else if (name === this.statics.blotName && !value) {
  7409. this.replaceWith(BlockBlot2.blotName);
  7410. } else {
  7411. _super.prototype.format.call(this, name, value);
  7412. }
  7413. };
  7414. BlockBlot2.prototype.formatAt = function(index, length, name, value) {
  7415. if (Registry.query(name, Registry.Scope.BLOCK) != null) {
  7416. this.format(name, value);
  7417. } else {
  7418. _super.prototype.formatAt.call(this, index, length, name, value);
  7419. }
  7420. };
  7421. BlockBlot2.prototype.insertAt = function(index, value, def) {
  7422. if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) {
  7423. _super.prototype.insertAt.call(this, index, value, def);
  7424. } else {
  7425. var after = this.split(index);
  7426. var blot = Registry.create(value, def);
  7427. after.parent.insertBefore(blot, after);
  7428. }
  7429. };
  7430. BlockBlot2.prototype.update = function(mutations, context) {
  7431. if (navigator.userAgent.match(/Trident/)) {
  7432. this.build();
  7433. } else {
  7434. _super.prototype.update.call(this, mutations, context);
  7435. }
  7436. };
  7437. BlockBlot2.blotName = "block";
  7438. BlockBlot2.scope = Registry.Scope.BLOCK_BLOT;
  7439. BlockBlot2.tagName = "P";
  7440. return BlockBlot2;
  7441. })(format_1.default)
  7442. );
  7443. exports2.default = BlockBlot;
  7444. }),
  7445. /* 48 */
  7446. /***/
  7447. (function(module2, exports2, __webpack_require__) {
  7448. "use strict";
  7449. var __extends = this && this.__extends || (function() {
  7450. var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
  7451. d.__proto__ = b;
  7452. } || function(d, b) {
  7453. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  7454. };
  7455. return function(d, b) {
  7456. extendStatics(d, b);
  7457. function __() {
  7458. this.constructor = d;
  7459. }
  7460. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  7461. };
  7462. })();
  7463. Object.defineProperty(exports2, "__esModule", { value: true });
  7464. var leaf_1 = __webpack_require__(19);
  7465. var EmbedBlot = (
  7466. /** @class */
  7467. (function(_super) {
  7468. __extends(EmbedBlot2, _super);
  7469. function EmbedBlot2() {
  7470. return _super !== null && _super.apply(this, arguments) || this;
  7471. }
  7472. EmbedBlot2.formats = function(domNode) {
  7473. return void 0;
  7474. };
  7475. EmbedBlot2.prototype.format = function(name, value) {
  7476. _super.prototype.formatAt.call(this, 0, this.length(), name, value);
  7477. };
  7478. EmbedBlot2.prototype.formatAt = function(index, length, name, value) {
  7479. if (index === 0 && length === this.length()) {
  7480. this.format(name, value);
  7481. } else {
  7482. _super.prototype.formatAt.call(this, index, length, name, value);
  7483. }
  7484. };
  7485. EmbedBlot2.prototype.formats = function() {
  7486. return this.statics.formats(this.domNode);
  7487. };
  7488. return EmbedBlot2;
  7489. })(leaf_1.default)
  7490. );
  7491. exports2.default = EmbedBlot;
  7492. }),
  7493. /* 49 */
  7494. /***/
  7495. (function(module2, exports2, __webpack_require__) {
  7496. "use strict";
  7497. var __extends = this && this.__extends || (function() {
  7498. var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
  7499. d.__proto__ = b;
  7500. } || function(d, b) {
  7501. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  7502. };
  7503. return function(d, b) {
  7504. extendStatics(d, b);
  7505. function __() {
  7506. this.constructor = d;
  7507. }
  7508. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  7509. };
  7510. })();
  7511. Object.defineProperty(exports2, "__esModule", { value: true });
  7512. var leaf_1 = __webpack_require__(19);
  7513. var Registry = __webpack_require__(1);
  7514. var TextBlot = (
  7515. /** @class */
  7516. (function(_super) {
  7517. __extends(TextBlot2, _super);
  7518. function TextBlot2(node) {
  7519. var _this = _super.call(this, node) || this;
  7520. _this.text = _this.statics.value(_this.domNode);
  7521. return _this;
  7522. }
  7523. TextBlot2.create = function(value) {
  7524. return document.createTextNode(value);
  7525. };
  7526. TextBlot2.value = function(domNode) {
  7527. var text = domNode.data;
  7528. if (text["normalize"])
  7529. text = text["normalize"]();
  7530. return text;
  7531. };
  7532. TextBlot2.prototype.deleteAt = function(index, length) {
  7533. this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length);
  7534. };
  7535. TextBlot2.prototype.index = function(node, offset) {
  7536. if (this.domNode === node) {
  7537. return offset;
  7538. }
  7539. return -1;
  7540. };
  7541. TextBlot2.prototype.insertAt = function(index, value, def) {
  7542. if (def == null) {
  7543. this.text = this.text.slice(0, index) + value + this.text.slice(index);
  7544. this.domNode.data = this.text;
  7545. } else {
  7546. _super.prototype.insertAt.call(this, index, value, def);
  7547. }
  7548. };
  7549. TextBlot2.prototype.length = function() {
  7550. return this.text.length;
  7551. };
  7552. TextBlot2.prototype.optimize = function(context) {
  7553. _super.prototype.optimize.call(this, context);
  7554. this.text = this.statics.value(this.domNode);
  7555. if (this.text.length === 0) {
  7556. this.remove();
  7557. } else if (this.next instanceof TextBlot2 && this.next.prev === this) {
  7558. this.insertAt(this.length(), this.next.value());
  7559. this.next.remove();
  7560. }
  7561. };
  7562. TextBlot2.prototype.position = function(index, inclusive) {
  7563. if (inclusive === void 0) {
  7564. inclusive = false;
  7565. }
  7566. return [this.domNode, index];
  7567. };
  7568. TextBlot2.prototype.split = function(index, force) {
  7569. if (force === void 0) {
  7570. force = false;
  7571. }
  7572. if (!force) {
  7573. if (index === 0)
  7574. return this;
  7575. if (index === this.length())
  7576. return this.next;
  7577. }
  7578. var after = Registry.create(this.domNode.splitText(index));
  7579. this.parent.insertBefore(after, this.next);
  7580. this.text = this.statics.value(this.domNode);
  7581. return after;
  7582. };
  7583. TextBlot2.prototype.update = function(mutations, context) {
  7584. var _this = this;
  7585. if (mutations.some(function(mutation) {
  7586. return mutation.type === "characterData" && mutation.target === _this.domNode;
  7587. })) {
  7588. this.text = this.statics.value(this.domNode);
  7589. }
  7590. };
  7591. TextBlot2.prototype.value = function() {
  7592. return this.text;
  7593. };
  7594. TextBlot2.blotName = "text";
  7595. TextBlot2.scope = Registry.Scope.INLINE_BLOT;
  7596. return TextBlot2;
  7597. })(leaf_1.default)
  7598. );
  7599. exports2.default = TextBlot;
  7600. }),
  7601. /* 50 */
  7602. /***/
  7603. (function(module2, exports2, __webpack_require__) {
  7604. "use strict";
  7605. var elem = document.createElement("div");
  7606. elem.classList.toggle("test-class", false);
  7607. if (elem.classList.contains("test-class")) {
  7608. var _toggle = DOMTokenList.prototype.toggle;
  7609. DOMTokenList.prototype.toggle = function(token, force) {
  7610. if (arguments.length > 1 && !this.contains(token) === !force) {
  7611. return force;
  7612. } else {
  7613. return _toggle.call(this, token);
  7614. }
  7615. };
  7616. }
  7617. if (!String.prototype.startsWith) {
  7618. String.prototype.startsWith = function(searchString, position) {
  7619. position = position || 0;
  7620. return this.substr(position, searchString.length) === searchString;
  7621. };
  7622. }
  7623. if (!String.prototype.endsWith) {
  7624. String.prototype.endsWith = function(searchString, position) {
  7625. var subjectString = this.toString();
  7626. if (typeof position !== "number" || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {
  7627. position = subjectString.length;
  7628. }
  7629. position -= searchString.length;
  7630. var lastIndex = subjectString.indexOf(searchString, position);
  7631. return lastIndex !== -1 && lastIndex === position;
  7632. };
  7633. }
  7634. if (!Array.prototype.find) {
  7635. Object.defineProperty(Array.prototype, "find", {
  7636. value: function value(predicate) {
  7637. if (this === null) {
  7638. throw new TypeError("Array.prototype.find called on null or undefined");
  7639. }
  7640. if (typeof predicate !== "function") {
  7641. throw new TypeError("predicate must be a function");
  7642. }
  7643. var list = Object(this);
  7644. var length = list.length >>> 0;
  7645. var thisArg = arguments[1];
  7646. var value2;
  7647. for (var i = 0; i < length; i++) {
  7648. value2 = list[i];
  7649. if (predicate.call(thisArg, value2, i, list)) {
  7650. return value2;
  7651. }
  7652. }
  7653. return void 0;
  7654. }
  7655. });
  7656. }
  7657. document.addEventListener("DOMContentLoaded", function() {
  7658. document.execCommand("enableObjectResizing", false, false);
  7659. document.execCommand("autoUrlDetect", false, false);
  7660. });
  7661. }),
  7662. /* 51 */
  7663. /***/
  7664. (function(module2, exports2) {
  7665. var DIFF_DELETE = -1;
  7666. var DIFF_INSERT = 1;
  7667. var DIFF_EQUAL = 0;
  7668. function diff_main(text1, text2, cursor_pos) {
  7669. if (text1 == text2) {
  7670. if (text1) {
  7671. return [[DIFF_EQUAL, text1]];
  7672. }
  7673. return [];
  7674. }
  7675. if (cursor_pos < 0 || text1.length < cursor_pos) {
  7676. cursor_pos = null;
  7677. }
  7678. var commonlength = diff_commonPrefix(text1, text2);
  7679. var commonprefix = text1.substring(0, commonlength);
  7680. text1 = text1.substring(commonlength);
  7681. text2 = text2.substring(commonlength);
  7682. commonlength = diff_commonSuffix(text1, text2);
  7683. var commonsuffix = text1.substring(text1.length - commonlength);
  7684. text1 = text1.substring(0, text1.length - commonlength);
  7685. text2 = text2.substring(0, text2.length - commonlength);
  7686. var diffs = diff_compute_(text1, text2);
  7687. if (commonprefix) {
  7688. diffs.unshift([DIFF_EQUAL, commonprefix]);
  7689. }
  7690. if (commonsuffix) {
  7691. diffs.push([DIFF_EQUAL, commonsuffix]);
  7692. }
  7693. diff_cleanupMerge(diffs);
  7694. if (cursor_pos != null) {
  7695. diffs = fix_cursor(diffs, cursor_pos);
  7696. }
  7697. diffs = fix_emoji(diffs);
  7698. return diffs;
  7699. }
  7700. ;
  7701. function diff_compute_(text1, text2) {
  7702. var diffs;
  7703. if (!text1) {
  7704. return [[DIFF_INSERT, text2]];
  7705. }
  7706. if (!text2) {
  7707. return [[DIFF_DELETE, text1]];
  7708. }
  7709. var longtext = text1.length > text2.length ? text1 : text2;
  7710. var shorttext = text1.length > text2.length ? text2 : text1;
  7711. var i = longtext.indexOf(shorttext);
  7712. if (i != -1) {
  7713. diffs = [
  7714. [DIFF_INSERT, longtext.substring(0, i)],
  7715. [DIFF_EQUAL, shorttext],
  7716. [DIFF_INSERT, longtext.substring(i + shorttext.length)]
  7717. ];
  7718. if (text1.length > text2.length) {
  7719. diffs[0][0] = diffs[2][0] = DIFF_DELETE;
  7720. }
  7721. return diffs;
  7722. }
  7723. if (shorttext.length == 1) {
  7724. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
  7725. }
  7726. var hm = diff_halfMatch_(text1, text2);
  7727. if (hm) {
  7728. var text1_a = hm[0];
  7729. var text1_b = hm[1];
  7730. var text2_a = hm[2];
  7731. var text2_b = hm[3];
  7732. var mid_common = hm[4];
  7733. var diffs_a = diff_main(text1_a, text2_a);
  7734. var diffs_b = diff_main(text1_b, text2_b);
  7735. return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);
  7736. }
  7737. return diff_bisect_(text1, text2);
  7738. }
  7739. ;
  7740. function diff_bisect_(text1, text2) {
  7741. var text1_length = text1.length;
  7742. var text2_length = text2.length;
  7743. var max_d = Math.ceil((text1_length + text2_length) / 2);
  7744. var v_offset = max_d;
  7745. var v_length = 2 * max_d;
  7746. var v1 = new Array(v_length);
  7747. var v2 = new Array(v_length);
  7748. for (var x = 0; x < v_length; x++) {
  7749. v1[x] = -1;
  7750. v2[x] = -1;
  7751. }
  7752. v1[v_offset + 1] = 0;
  7753. v2[v_offset + 1] = 0;
  7754. var delta = text1_length - text2_length;
  7755. var front = delta % 2 != 0;
  7756. var k1start = 0;
  7757. var k1end = 0;
  7758. var k2start = 0;
  7759. var k2end = 0;
  7760. for (var d = 0; d < max_d; d++) {
  7761. for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
  7762. var k1_offset = v_offset + k1;
  7763. var x1;
  7764. if (k1 == -d || k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1]) {
  7765. x1 = v1[k1_offset + 1];
  7766. } else {
  7767. x1 = v1[k1_offset - 1] + 1;
  7768. }
  7769. var y1 = x1 - k1;
  7770. while (x1 < text1_length && y1 < text2_length && text1.charAt(x1) == text2.charAt(y1)) {
  7771. x1++;
  7772. y1++;
  7773. }
  7774. v1[k1_offset] = x1;
  7775. if (x1 > text1_length) {
  7776. k1end += 2;
  7777. } else if (y1 > text2_length) {
  7778. k1start += 2;
  7779. } else if (front) {
  7780. var k2_offset = v_offset + delta - k1;
  7781. if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {
  7782. var x2 = text1_length - v2[k2_offset];
  7783. if (x1 >= x2) {
  7784. return diff_bisectSplit_(text1, text2, x1, y1);
  7785. }
  7786. }
  7787. }
  7788. }
  7789. for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
  7790. var k2_offset = v_offset + k2;
  7791. var x2;
  7792. if (k2 == -d || k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1]) {
  7793. x2 = v2[k2_offset + 1];
  7794. } else {
  7795. x2 = v2[k2_offset - 1] + 1;
  7796. }
  7797. var y2 = x2 - k2;
  7798. while (x2 < text1_length && y2 < text2_length && text1.charAt(text1_length - x2 - 1) == text2.charAt(text2_length - y2 - 1)) {
  7799. x2++;
  7800. y2++;
  7801. }
  7802. v2[k2_offset] = x2;
  7803. if (x2 > text1_length) {
  7804. k2end += 2;
  7805. } else if (y2 > text2_length) {
  7806. k2start += 2;
  7807. } else if (!front) {
  7808. var k1_offset = v_offset + delta - k2;
  7809. if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {
  7810. var x1 = v1[k1_offset];
  7811. var y1 = v_offset + x1 - k1_offset;
  7812. x2 = text1_length - x2;
  7813. if (x1 >= x2) {
  7814. return diff_bisectSplit_(text1, text2, x1, y1);
  7815. }
  7816. }
  7817. }
  7818. }
  7819. }
  7820. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
  7821. }
  7822. ;
  7823. function diff_bisectSplit_(text1, text2, x, y) {
  7824. var text1a = text1.substring(0, x);
  7825. var text2a = text2.substring(0, y);
  7826. var text1b = text1.substring(x);
  7827. var text2b = text2.substring(y);
  7828. var diffs = diff_main(text1a, text2a);
  7829. var diffsb = diff_main(text1b, text2b);
  7830. return diffs.concat(diffsb);
  7831. }
  7832. ;
  7833. function diff_commonPrefix(text1, text2) {
  7834. if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {
  7835. return 0;
  7836. }
  7837. var pointermin = 0;
  7838. var pointermax = Math.min(text1.length, text2.length);
  7839. var pointermid = pointermax;
  7840. var pointerstart = 0;
  7841. while (pointermin < pointermid) {
  7842. if (text1.substring(pointerstart, pointermid) == text2.substring(pointerstart, pointermid)) {
  7843. pointermin = pointermid;
  7844. pointerstart = pointermin;
  7845. } else {
  7846. pointermax = pointermid;
  7847. }
  7848. pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
  7849. }
  7850. return pointermid;
  7851. }
  7852. ;
  7853. function diff_commonSuffix(text1, text2) {
  7854. if (!text1 || !text2 || text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {
  7855. return 0;
  7856. }
  7857. var pointermin = 0;
  7858. var pointermax = Math.min(text1.length, text2.length);
  7859. var pointermid = pointermax;
  7860. var pointerend = 0;
  7861. while (pointermin < pointermid) {
  7862. if (text1.substring(text1.length - pointermid, text1.length - pointerend) == text2.substring(text2.length - pointermid, text2.length - pointerend)) {
  7863. pointermin = pointermid;
  7864. pointerend = pointermin;
  7865. } else {
  7866. pointermax = pointermid;
  7867. }
  7868. pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
  7869. }
  7870. return pointermid;
  7871. }
  7872. ;
  7873. function diff_halfMatch_(text1, text2) {
  7874. var longtext = text1.length > text2.length ? text1 : text2;
  7875. var shorttext = text1.length > text2.length ? text2 : text1;
  7876. if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
  7877. return null;
  7878. }
  7879. function diff_halfMatchI_(longtext2, shorttext2, i) {
  7880. var seed = longtext2.substring(i, i + Math.floor(longtext2.length / 4));
  7881. var j = -1;
  7882. var best_common = "";
  7883. var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
  7884. while ((j = shorttext2.indexOf(seed, j + 1)) != -1) {
  7885. var prefixLength = diff_commonPrefix(
  7886. longtext2.substring(i),
  7887. shorttext2.substring(j)
  7888. );
  7889. var suffixLength = diff_commonSuffix(
  7890. longtext2.substring(0, i),
  7891. shorttext2.substring(0, j)
  7892. );
  7893. if (best_common.length < suffixLength + prefixLength) {
  7894. best_common = shorttext2.substring(j - suffixLength, j) + shorttext2.substring(j, j + prefixLength);
  7895. best_longtext_a = longtext2.substring(0, i - suffixLength);
  7896. best_longtext_b = longtext2.substring(i + prefixLength);
  7897. best_shorttext_a = shorttext2.substring(0, j - suffixLength);
  7898. best_shorttext_b = shorttext2.substring(j + prefixLength);
  7899. }
  7900. }
  7901. if (best_common.length * 2 >= longtext2.length) {
  7902. return [
  7903. best_longtext_a,
  7904. best_longtext_b,
  7905. best_shorttext_a,
  7906. best_shorttext_b,
  7907. best_common
  7908. ];
  7909. } else {
  7910. return null;
  7911. }
  7912. }
  7913. var hm1 = diff_halfMatchI_(
  7914. longtext,
  7915. shorttext,
  7916. Math.ceil(longtext.length / 4)
  7917. );
  7918. var hm2 = diff_halfMatchI_(
  7919. longtext,
  7920. shorttext,
  7921. Math.ceil(longtext.length / 2)
  7922. );
  7923. var hm;
  7924. if (!hm1 && !hm2) {
  7925. return null;
  7926. } else if (!hm2) {
  7927. hm = hm1;
  7928. } else if (!hm1) {
  7929. hm = hm2;
  7930. } else {
  7931. hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
  7932. }
  7933. var text1_a, text1_b, text2_a, text2_b;
  7934. if (text1.length > text2.length) {
  7935. text1_a = hm[0];
  7936. text1_b = hm[1];
  7937. text2_a = hm[2];
  7938. text2_b = hm[3];
  7939. } else {
  7940. text2_a = hm[0];
  7941. text2_b = hm[1];
  7942. text1_a = hm[2];
  7943. text1_b = hm[3];
  7944. }
  7945. var mid_common = hm[4];
  7946. return [text1_a, text1_b, text2_a, text2_b, mid_common];
  7947. }
  7948. ;
  7949. function diff_cleanupMerge(diffs) {
  7950. diffs.push([DIFF_EQUAL, ""]);
  7951. var pointer = 0;
  7952. var count_delete = 0;
  7953. var count_insert = 0;
  7954. var text_delete = "";
  7955. var text_insert = "";
  7956. var commonlength;
  7957. while (pointer < diffs.length) {
  7958. switch (diffs[pointer][0]) {
  7959. case DIFF_INSERT:
  7960. count_insert++;
  7961. text_insert += diffs[pointer][1];
  7962. pointer++;
  7963. break;
  7964. case DIFF_DELETE:
  7965. count_delete++;
  7966. text_delete += diffs[pointer][1];
  7967. pointer++;
  7968. break;
  7969. case DIFF_EQUAL:
  7970. if (count_delete + count_insert > 1) {
  7971. if (count_delete !== 0 && count_insert !== 0) {
  7972. commonlength = diff_commonPrefix(text_insert, text_delete);
  7973. if (commonlength !== 0) {
  7974. if (pointer - count_delete - count_insert > 0 && diffs[pointer - count_delete - count_insert - 1][0] == DIFF_EQUAL) {
  7975. diffs[pointer - count_delete - count_insert - 1][1] += text_insert.substring(0, commonlength);
  7976. } else {
  7977. diffs.splice(0, 0, [
  7978. DIFF_EQUAL,
  7979. text_insert.substring(0, commonlength)
  7980. ]);
  7981. pointer++;
  7982. }
  7983. text_insert = text_insert.substring(commonlength);
  7984. text_delete = text_delete.substring(commonlength);
  7985. }
  7986. commonlength = diff_commonSuffix(text_insert, text_delete);
  7987. if (commonlength !== 0) {
  7988. diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
  7989. text_insert = text_insert.substring(0, text_insert.length - commonlength);
  7990. text_delete = text_delete.substring(0, text_delete.length - commonlength);
  7991. }
  7992. }
  7993. if (count_delete === 0) {
  7994. diffs.splice(
  7995. pointer - count_insert,
  7996. count_delete + count_insert,
  7997. [DIFF_INSERT, text_insert]
  7998. );
  7999. } else if (count_insert === 0) {
  8000. diffs.splice(
  8001. pointer - count_delete,
  8002. count_delete + count_insert,
  8003. [DIFF_DELETE, text_delete]
  8004. );
  8005. } else {
  8006. diffs.splice(
  8007. pointer - count_delete - count_insert,
  8008. count_delete + count_insert,
  8009. [DIFF_DELETE, text_delete],
  8010. [DIFF_INSERT, text_insert]
  8011. );
  8012. }
  8013. pointer = pointer - count_delete - count_insert + (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;
  8014. } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {
  8015. diffs[pointer - 1][1] += diffs[pointer][1];
  8016. diffs.splice(pointer, 1);
  8017. } else {
  8018. pointer++;
  8019. }
  8020. count_insert = 0;
  8021. count_delete = 0;
  8022. text_delete = "";
  8023. text_insert = "";
  8024. break;
  8025. }
  8026. }
  8027. if (diffs[diffs.length - 1][1] === "") {
  8028. diffs.pop();
  8029. }
  8030. var changes = false;
  8031. pointer = 1;
  8032. while (pointer < diffs.length - 1) {
  8033. if (diffs[pointer - 1][0] == DIFF_EQUAL && diffs[pointer + 1][0] == DIFF_EQUAL) {
  8034. if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {
  8035. diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length);
  8036. diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
  8037. diffs.splice(pointer - 1, 1);
  8038. changes = true;
  8039. } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == diffs[pointer + 1][1]) {
  8040. diffs[pointer - 1][1] += diffs[pointer + 1][1];
  8041. diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1];
  8042. diffs.splice(pointer + 1, 1);
  8043. changes = true;
  8044. }
  8045. }
  8046. pointer++;
  8047. }
  8048. if (changes) {
  8049. diff_cleanupMerge(diffs);
  8050. }
  8051. }
  8052. ;
  8053. var diff = diff_main;
  8054. diff.INSERT = DIFF_INSERT;
  8055. diff.DELETE = DIFF_DELETE;
  8056. diff.EQUAL = DIFF_EQUAL;
  8057. module2.exports = diff;
  8058. function cursor_normalize_diff(diffs, cursor_pos) {
  8059. if (cursor_pos === 0) {
  8060. return [DIFF_EQUAL, diffs];
  8061. }
  8062. for (var current_pos = 0, i = 0; i < diffs.length; i++) {
  8063. var d = diffs[i];
  8064. if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) {
  8065. var next_pos = current_pos + d[1].length;
  8066. if (cursor_pos === next_pos) {
  8067. return [i + 1, diffs];
  8068. } else if (cursor_pos < next_pos) {
  8069. diffs = diffs.slice();
  8070. var split_pos = cursor_pos - current_pos;
  8071. var d_left = [d[0], d[1].slice(0, split_pos)];
  8072. var d_right = [d[0], d[1].slice(split_pos)];
  8073. diffs.splice(i, 1, d_left, d_right);
  8074. return [i + 1, diffs];
  8075. } else {
  8076. current_pos = next_pos;
  8077. }
  8078. }
  8079. }
  8080. throw new Error("cursor_pos is out of bounds!");
  8081. }
  8082. function fix_cursor(diffs, cursor_pos) {
  8083. var norm = cursor_normalize_diff(diffs, cursor_pos);
  8084. var ndiffs = norm[1];
  8085. var cursor_pointer = norm[0];
  8086. var d = ndiffs[cursor_pointer];
  8087. var d_next = ndiffs[cursor_pointer + 1];
  8088. if (d == null) {
  8089. return diffs;
  8090. } else if (d[0] !== DIFF_EQUAL) {
  8091. return diffs;
  8092. } else {
  8093. if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) {
  8094. ndiffs.splice(cursor_pointer, 2, d_next, d);
  8095. return merge_tuples(ndiffs, cursor_pointer, 2);
  8096. } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) {
  8097. ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]);
  8098. var suffix = d_next[1].slice(d[1].length);
  8099. if (suffix.length > 0) {
  8100. ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]);
  8101. }
  8102. return merge_tuples(ndiffs, cursor_pointer, 3);
  8103. } else {
  8104. return diffs;
  8105. }
  8106. }
  8107. }
  8108. function fix_emoji(diffs) {
  8109. var compact = false;
  8110. var starts_with_pair_end = function(str) {
  8111. return str.charCodeAt(0) >= 56320 && str.charCodeAt(0) <= 57343;
  8112. };
  8113. var ends_with_pair_start = function(str) {
  8114. return str.charCodeAt(str.length - 1) >= 55296 && str.charCodeAt(str.length - 1) <= 56319;
  8115. };
  8116. for (var i = 2; i < diffs.length; i += 1) {
  8117. if (diffs[i - 2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i - 2][1]) && diffs[i - 1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i - 1][1]) && diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) {
  8118. compact = true;
  8119. diffs[i - 1][1] = diffs[i - 2][1].slice(-1) + diffs[i - 1][1];
  8120. diffs[i][1] = diffs[i - 2][1].slice(-1) + diffs[i][1];
  8121. diffs[i - 2][1] = diffs[i - 2][1].slice(0, -1);
  8122. }
  8123. }
  8124. if (!compact) {
  8125. return diffs;
  8126. }
  8127. var fixed_diffs = [];
  8128. for (var i = 0; i < diffs.length; i += 1) {
  8129. if (diffs[i][1].length > 0) {
  8130. fixed_diffs.push(diffs[i]);
  8131. }
  8132. }
  8133. return fixed_diffs;
  8134. }
  8135. function merge_tuples(diffs, start, length) {
  8136. for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) {
  8137. if (i + 1 < diffs.length) {
  8138. var left_d = diffs[i];
  8139. var right_d = diffs[i + 1];
  8140. if (left_d[0] === right_d[1]) {
  8141. diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]);
  8142. }
  8143. }
  8144. }
  8145. return diffs;
  8146. }
  8147. }),
  8148. /* 52 */
  8149. /***/
  8150. (function(module2, exports2) {
  8151. exports2 = module2.exports = typeof Object.keys === "function" ? Object.keys : shim;
  8152. exports2.shim = shim;
  8153. function shim(obj) {
  8154. var keys = [];
  8155. for (var key in obj) keys.push(key);
  8156. return keys;
  8157. }
  8158. }),
  8159. /* 53 */
  8160. /***/
  8161. (function(module2, exports2) {
  8162. var supportsArgumentsClass = (function() {
  8163. return Object.prototype.toString.call(arguments);
  8164. })() == "[object Arguments]";
  8165. exports2 = module2.exports = supportsArgumentsClass ? supported : unsupported;
  8166. exports2.supported = supported;
  8167. function supported(object) {
  8168. return Object.prototype.toString.call(object) == "[object Arguments]";
  8169. }
  8170. ;
  8171. exports2.unsupported = unsupported;
  8172. function unsupported(object) {
  8173. return object && typeof object == "object" && typeof object.length == "number" && Object.prototype.hasOwnProperty.call(object, "callee") && !Object.prototype.propertyIsEnumerable.call(object, "callee") || false;
  8174. }
  8175. ;
  8176. }),
  8177. /* 54 */
  8178. /***/
  8179. (function(module2, exports2) {
  8180. "use strict";
  8181. var has = Object.prototype.hasOwnProperty, prefix = "~";
  8182. function Events() {
  8183. }
  8184. if (Object.create) {
  8185. Events.prototype = /* @__PURE__ */ Object.create(null);
  8186. if (!new Events().__proto__) prefix = false;
  8187. }
  8188. function EE(fn, context, once) {
  8189. this.fn = fn;
  8190. this.context = context;
  8191. this.once = once || false;
  8192. }
  8193. function EventEmitter() {
  8194. this._events = new Events();
  8195. this._eventsCount = 0;
  8196. }
  8197. EventEmitter.prototype.eventNames = function eventNames() {
  8198. var names = [], events, name;
  8199. if (this._eventsCount === 0) return names;
  8200. for (name in events = this._events) {
  8201. if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
  8202. }
  8203. if (Object.getOwnPropertySymbols) {
  8204. return names.concat(Object.getOwnPropertySymbols(events));
  8205. }
  8206. return names;
  8207. };
  8208. EventEmitter.prototype.listeners = function listeners(event, exists) {
  8209. var evt = prefix ? prefix + event : event, available = this._events[evt];
  8210. if (exists) return !!available;
  8211. if (!available) return [];
  8212. if (available.fn) return [available.fn];
  8213. for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {
  8214. ee[i] = available[i].fn;
  8215. }
  8216. return ee;
  8217. };
  8218. EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
  8219. var evt = prefix ? prefix + event : event;
  8220. if (!this._events[evt]) return false;
  8221. var listeners = this._events[evt], len = arguments.length, args, i;
  8222. if (listeners.fn) {
  8223. if (listeners.once) this.removeListener(event, listeners.fn, void 0, true);
  8224. switch (len) {
  8225. case 1:
  8226. return listeners.fn.call(listeners.context), true;
  8227. case 2:
  8228. return listeners.fn.call(listeners.context, a1), true;
  8229. case 3:
  8230. return listeners.fn.call(listeners.context, a1, a2), true;
  8231. case 4:
  8232. return listeners.fn.call(listeners.context, a1, a2, a3), true;
  8233. case 5:
  8234. return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
  8235. case 6:
  8236. return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
  8237. }
  8238. for (i = 1, args = new Array(len - 1); i < len; i++) {
  8239. args[i - 1] = arguments[i];
  8240. }
  8241. listeners.fn.apply(listeners.context, args);
  8242. } else {
  8243. var length = listeners.length, j;
  8244. for (i = 0; i < length; i++) {
  8245. if (listeners[i].once) this.removeListener(event, listeners[i].fn, void 0, true);
  8246. switch (len) {
  8247. case 1:
  8248. listeners[i].fn.call(listeners[i].context);
  8249. break;
  8250. case 2:
  8251. listeners[i].fn.call(listeners[i].context, a1);
  8252. break;
  8253. case 3:
  8254. listeners[i].fn.call(listeners[i].context, a1, a2);
  8255. break;
  8256. case 4:
  8257. listeners[i].fn.call(listeners[i].context, a1, a2, a3);
  8258. break;
  8259. default:
  8260. if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) {
  8261. args[j - 1] = arguments[j];
  8262. }
  8263. listeners[i].fn.apply(listeners[i].context, args);
  8264. }
  8265. }
  8266. }
  8267. return true;
  8268. };
  8269. EventEmitter.prototype.on = function on(event, fn, context) {
  8270. var listener = new EE(fn, context || this), evt = prefix ? prefix + event : event;
  8271. if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
  8272. else if (!this._events[evt].fn) this._events[evt].push(listener);
  8273. else this._events[evt] = [this._events[evt], listener];
  8274. return this;
  8275. };
  8276. EventEmitter.prototype.once = function once(event, fn, context) {
  8277. var listener = new EE(fn, context || this, true), evt = prefix ? prefix + event : event;
  8278. if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
  8279. else if (!this._events[evt].fn) this._events[evt].push(listener);
  8280. else this._events[evt] = [this._events[evt], listener];
  8281. return this;
  8282. };
  8283. EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
  8284. var evt = prefix ? prefix + event : event;
  8285. if (!this._events[evt]) return this;
  8286. if (!fn) {
  8287. if (--this._eventsCount === 0) this._events = new Events();
  8288. else delete this._events[evt];
  8289. return this;
  8290. }
  8291. var listeners = this._events[evt];
  8292. if (listeners.fn) {
  8293. if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
  8294. if (--this._eventsCount === 0) this._events = new Events();
  8295. else delete this._events[evt];
  8296. }
  8297. } else {
  8298. for (var i = 0, events = [], length = listeners.length; i < length; i++) {
  8299. if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
  8300. events.push(listeners[i]);
  8301. }
  8302. }
  8303. if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
  8304. else if (--this._eventsCount === 0) this._events = new Events();
  8305. else delete this._events[evt];
  8306. }
  8307. return this;
  8308. };
  8309. EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
  8310. var evt;
  8311. if (event) {
  8312. evt = prefix ? prefix + event : event;
  8313. if (this._events[evt]) {
  8314. if (--this._eventsCount === 0) this._events = new Events();
  8315. else delete this._events[evt];
  8316. }
  8317. } else {
  8318. this._events = new Events();
  8319. this._eventsCount = 0;
  8320. }
  8321. return this;
  8322. };
  8323. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  8324. EventEmitter.prototype.addListener = EventEmitter.prototype.on;
  8325. EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
  8326. return this;
  8327. };
  8328. EventEmitter.prefixed = prefix;
  8329. EventEmitter.EventEmitter = EventEmitter;
  8330. if ("undefined" !== typeof module2) {
  8331. module2.exports = EventEmitter;
  8332. }
  8333. }),
  8334. /* 55 */
  8335. /***/
  8336. (function(module2, exports2, __webpack_require__) {
  8337. "use strict";
  8338. Object.defineProperty(exports2, "__esModule", {
  8339. value: true
  8340. });
  8341. exports2.matchText = exports2.matchSpacing = exports2.matchNewline = exports2.matchBlot = exports2.matchAttributor = exports2.default = void 0;
  8342. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
  8343. return typeof obj;
  8344. } : function(obj) {
  8345. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  8346. };
  8347. var _slicedToArray = /* @__PURE__ */ (function() {
  8348. function sliceIterator(arr, i) {
  8349. var _arr = [];
  8350. var _n = true;
  8351. var _d = false;
  8352. var _e = void 0;
  8353. try {
  8354. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  8355. _arr.push(_s.value);
  8356. if (i && _arr.length === i) break;
  8357. }
  8358. } catch (err) {
  8359. _d = true;
  8360. _e = err;
  8361. } finally {
  8362. try {
  8363. if (!_n && _i["return"]) _i["return"]();
  8364. } finally {
  8365. if (_d) throw _e;
  8366. }
  8367. }
  8368. return _arr;
  8369. }
  8370. return function(arr, i) {
  8371. if (Array.isArray(arr)) {
  8372. return arr;
  8373. } else if (Symbol.iterator in Object(arr)) {
  8374. return sliceIterator(arr, i);
  8375. } else {
  8376. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  8377. }
  8378. };
  8379. })();
  8380. var _createClass = /* @__PURE__ */ (function() {
  8381. function defineProperties(target, props) {
  8382. for (var i = 0; i < props.length; i++) {
  8383. var descriptor = props[i];
  8384. descriptor.enumerable = descriptor.enumerable || false;
  8385. descriptor.configurable = true;
  8386. if ("value" in descriptor) descriptor.writable = true;
  8387. Object.defineProperty(target, descriptor.key, descriptor);
  8388. }
  8389. }
  8390. return function(Constructor, protoProps, staticProps) {
  8391. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  8392. if (staticProps) defineProperties(Constructor, staticProps);
  8393. return Constructor;
  8394. };
  8395. })();
  8396. var _extend2 = __webpack_require__(3);
  8397. var _extend3 = _interopRequireDefault(_extend2);
  8398. var _quillDelta = __webpack_require__(2);
  8399. var _quillDelta2 = _interopRequireDefault(_quillDelta);
  8400. var _parchment = __webpack_require__(0);
  8401. var _parchment2 = _interopRequireDefault(_parchment);
  8402. var _quill = __webpack_require__(5);
  8403. var _quill2 = _interopRequireDefault(_quill);
  8404. var _logger = __webpack_require__(10);
  8405. var _logger2 = _interopRequireDefault(_logger);
  8406. var _module = __webpack_require__(9);
  8407. var _module2 = _interopRequireDefault(_module);
  8408. var _align = __webpack_require__(36);
  8409. var _background = __webpack_require__(37);
  8410. var _code = __webpack_require__(13);
  8411. var _code2 = _interopRequireDefault(_code);
  8412. var _color = __webpack_require__(26);
  8413. var _direction = __webpack_require__(38);
  8414. var _font = __webpack_require__(39);
  8415. var _size = __webpack_require__(40);
  8416. function _interopRequireDefault(obj) {
  8417. return obj && obj.__esModule ? obj : { default: obj };
  8418. }
  8419. function _defineProperty(obj, key, value) {
  8420. if (key in obj) {
  8421. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  8422. } else {
  8423. obj[key] = value;
  8424. }
  8425. return obj;
  8426. }
  8427. function _classCallCheck(instance, Constructor) {
  8428. if (!(instance instanceof Constructor)) {
  8429. throw new TypeError("Cannot call a class as a function");
  8430. }
  8431. }
  8432. function _possibleConstructorReturn(self2, call) {
  8433. if (!self2) {
  8434. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  8435. }
  8436. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  8437. }
  8438. function _inherits(subClass, superClass) {
  8439. if (typeof superClass !== "function" && superClass !== null) {
  8440. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  8441. }
  8442. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  8443. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  8444. }
  8445. var debug = (0, _logger2.default)("quill:clipboard");
  8446. var DOM_KEY = "__ql-matcher";
  8447. var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ["br", matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ["li", matchIndent], ["b", matchAlias.bind(matchAlias, "bold")], ["i", matchAlias.bind(matchAlias, "italic")], ["style", matchIgnore]];
  8448. var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function(memo, attr) {
  8449. memo[attr.keyName] = attr;
  8450. return memo;
  8451. }, {});
  8452. var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function(memo, attr) {
  8453. memo[attr.keyName] = attr;
  8454. return memo;
  8455. }, {});
  8456. var Clipboard = (function(_Module) {
  8457. _inherits(Clipboard2, _Module);
  8458. function Clipboard2(quill, options) {
  8459. _classCallCheck(this, Clipboard2);
  8460. var _this = _possibleConstructorReturn(this, (Clipboard2.__proto__ || Object.getPrototypeOf(Clipboard2)).call(this, quill, options));
  8461. _this.quill.root.addEventListener("paste", _this.onPaste.bind(_this));
  8462. _this.container = _this.quill.addContainer("ql-clipboard");
  8463. _this.container.setAttribute("contenteditable", true);
  8464. _this.container.setAttribute("tabindex", -1);
  8465. _this.matchers = [];
  8466. CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function(_ref) {
  8467. var _ref2 = _slicedToArray(_ref, 2), selector = _ref2[0], matcher = _ref2[1];
  8468. if (!options.matchVisual && matcher === matchSpacing) return;
  8469. _this.addMatcher(selector, matcher);
  8470. });
  8471. return _this;
  8472. }
  8473. _createClass(Clipboard2, [{
  8474. key: "addMatcher",
  8475. value: function addMatcher(selector, matcher) {
  8476. this.matchers.push([selector, matcher]);
  8477. }
  8478. }, {
  8479. key: "convert",
  8480. value: function convert(html) {
  8481. if (typeof html === "string") {
  8482. this.container.innerHTML = html.replace(/\>\r?\n +\</g, "><");
  8483. return this.convert();
  8484. }
  8485. var formats = this.quill.getFormat(this.quill.selection.savedRange.index);
  8486. if (formats[_code2.default.blotName]) {
  8487. var text = this.container.innerText;
  8488. this.container.innerHTML = "";
  8489. return new _quillDelta2.default().insert(text, _defineProperty({}, _code2.default.blotName, formats[_code2.default.blotName]));
  8490. }
  8491. var _prepareMatching = this.prepareMatching(), _prepareMatching2 = _slicedToArray(_prepareMatching, 2), elementMatchers = _prepareMatching2[0], textMatchers = _prepareMatching2[1];
  8492. var delta = traverse(this.container, elementMatchers, textMatchers);
  8493. if (deltaEndsWith(delta, "\n") && delta.ops[delta.ops.length - 1].attributes == null) {
  8494. delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1));
  8495. }
  8496. debug.log("convert", this.container.innerHTML, delta);
  8497. this.container.innerHTML = "";
  8498. return delta;
  8499. }
  8500. }, {
  8501. key: "dangerouslyPasteHTML",
  8502. value: function dangerouslyPasteHTML(index, html) {
  8503. var source = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _quill2.default.sources.API;
  8504. if (typeof index === "string") {
  8505. this.quill.setContents(this.convert(index), html);
  8506. this.quill.setSelection(0, _quill2.default.sources.SILENT);
  8507. } else {
  8508. var paste = this.convert(html);
  8509. this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source);
  8510. this.quill.setSelection(index + paste.length(), _quill2.default.sources.SILENT);
  8511. }
  8512. }
  8513. }, {
  8514. key: "onPaste",
  8515. value: function onPaste(e) {
  8516. var _this2 = this;
  8517. if (e.defaultPrevented || !this.quill.isEnabled()) return;
  8518. var range = this.quill.getSelection();
  8519. var delta = new _quillDelta2.default().retain(range.index);
  8520. var scrollTop = this.quill.scrollingContainer.scrollTop;
  8521. this.container.focus();
  8522. this.quill.selection.update(_quill2.default.sources.SILENT);
  8523. setTimeout(function() {
  8524. delta = delta.concat(_this2.convert()).delete(range.length);
  8525. _this2.quill.updateContents(delta, _quill2.default.sources.USER);
  8526. _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT);
  8527. _this2.quill.scrollingContainer.scrollTop = scrollTop;
  8528. _this2.quill.focus();
  8529. }, 1);
  8530. }
  8531. }, {
  8532. key: "prepareMatching",
  8533. value: function prepareMatching() {
  8534. var _this3 = this;
  8535. var elementMatchers = [], textMatchers = [];
  8536. this.matchers.forEach(function(pair) {
  8537. var _pair = _slicedToArray(pair, 2), selector = _pair[0], matcher = _pair[1];
  8538. switch (selector) {
  8539. case Node.TEXT_NODE:
  8540. textMatchers.push(matcher);
  8541. break;
  8542. case Node.ELEMENT_NODE:
  8543. elementMatchers.push(matcher);
  8544. break;
  8545. default:
  8546. [].forEach.call(_this3.container.querySelectorAll(selector), function(node) {
  8547. node[DOM_KEY] = node[DOM_KEY] || [];
  8548. node[DOM_KEY].push(matcher);
  8549. });
  8550. break;
  8551. }
  8552. });
  8553. return [elementMatchers, textMatchers];
  8554. }
  8555. }]);
  8556. return Clipboard2;
  8557. })(_module2.default);
  8558. Clipboard.DEFAULTS = {
  8559. matchers: [],
  8560. matchVisual: true
  8561. };
  8562. function applyFormat(delta, format, value) {
  8563. if ((typeof format === "undefined" ? "undefined" : _typeof(format)) === "object") {
  8564. return Object.keys(format).reduce(function(delta2, key) {
  8565. return applyFormat(delta2, key, format[key]);
  8566. }, delta);
  8567. } else {
  8568. return delta.reduce(function(delta2, op) {
  8569. if (op.attributes && op.attributes[format]) {
  8570. return delta2.push(op);
  8571. } else {
  8572. return delta2.insert(op.insert, (0, _extend3.default)({}, _defineProperty({}, format, value), op.attributes));
  8573. }
  8574. }, new _quillDelta2.default());
  8575. }
  8576. }
  8577. function computeStyle(node) {
  8578. if (node.nodeType !== Node.ELEMENT_NODE) return {};
  8579. var DOM_KEY2 = "__ql-computed-style";
  8580. return node[DOM_KEY2] || (node[DOM_KEY2] = window.getComputedStyle(node));
  8581. }
  8582. function deltaEndsWith(delta, text) {
  8583. var endText = "";
  8584. for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) {
  8585. var op = delta.ops[i];
  8586. if (typeof op.insert !== "string") break;
  8587. endText = op.insert + endText;
  8588. }
  8589. return endText.slice(-1 * text.length) === text;
  8590. }
  8591. function isLine(node) {
  8592. if (node.childNodes.length === 0) return false;
  8593. var style = computeStyle(node);
  8594. return ["block", "list-item"].indexOf(style.display) > -1;
  8595. }
  8596. function traverse(node, elementMatchers, textMatchers) {
  8597. if (node.nodeType === node.TEXT_NODE) {
  8598. return textMatchers.reduce(function(delta, matcher) {
  8599. return matcher(node, delta);
  8600. }, new _quillDelta2.default());
  8601. } else if (node.nodeType === node.ELEMENT_NODE) {
  8602. return [].reduce.call(node.childNodes || [], function(delta, childNode) {
  8603. var childrenDelta = traverse(childNode, elementMatchers, textMatchers);
  8604. if (childNode.nodeType === node.ELEMENT_NODE) {
  8605. childrenDelta = elementMatchers.reduce(function(childrenDelta2, matcher) {
  8606. return matcher(childNode, childrenDelta2);
  8607. }, childrenDelta);
  8608. childrenDelta = (childNode[DOM_KEY] || []).reduce(function(childrenDelta2, matcher) {
  8609. return matcher(childNode, childrenDelta2);
  8610. }, childrenDelta);
  8611. }
  8612. return delta.concat(childrenDelta);
  8613. }, new _quillDelta2.default());
  8614. } else {
  8615. return new _quillDelta2.default();
  8616. }
  8617. }
  8618. function matchAlias(format, node, delta) {
  8619. return applyFormat(delta, format, true);
  8620. }
  8621. function matchAttributor(node, delta) {
  8622. var attributes = _parchment2.default.Attributor.Attribute.keys(node);
  8623. var classes = _parchment2.default.Attributor.Class.keys(node);
  8624. var styles = _parchment2.default.Attributor.Style.keys(node);
  8625. var formats = {};
  8626. attributes.concat(classes).concat(styles).forEach(function(name) {
  8627. var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE);
  8628. if (attr != null) {
  8629. formats[attr.attrName] = attr.value(node);
  8630. if (formats[attr.attrName]) return;
  8631. }
  8632. attr = ATTRIBUTE_ATTRIBUTORS[name];
  8633. if (attr != null && (attr.attrName === name || attr.keyName === name)) {
  8634. formats[attr.attrName] = attr.value(node) || void 0;
  8635. }
  8636. attr = STYLE_ATTRIBUTORS[name];
  8637. if (attr != null && (attr.attrName === name || attr.keyName === name)) {
  8638. attr = STYLE_ATTRIBUTORS[name];
  8639. formats[attr.attrName] = attr.value(node) || void 0;
  8640. }
  8641. });
  8642. if (Object.keys(formats).length > 0) {
  8643. delta = applyFormat(delta, formats);
  8644. }
  8645. return delta;
  8646. }
  8647. function matchBlot(node, delta) {
  8648. var match = _parchment2.default.query(node);
  8649. if (match == null) return delta;
  8650. if (match.prototype instanceof _parchment2.default.Embed) {
  8651. var embed = {};
  8652. var value = match.value(node);
  8653. if (value != null) {
  8654. embed[match.blotName] = value;
  8655. delta = new _quillDelta2.default().insert(embed, match.formats(node));
  8656. }
  8657. } else if (typeof match.formats === "function") {
  8658. delta = applyFormat(delta, match.blotName, match.formats(node));
  8659. }
  8660. return delta;
  8661. }
  8662. function matchBreak(node, delta) {
  8663. if (!deltaEndsWith(delta, "\n")) {
  8664. delta.insert("\n");
  8665. }
  8666. return delta;
  8667. }
  8668. function matchIgnore() {
  8669. return new _quillDelta2.default();
  8670. }
  8671. function matchIndent(node, delta) {
  8672. var match = _parchment2.default.query(node);
  8673. if (match == null || match.blotName !== "list-item" || !deltaEndsWith(delta, "\n")) {
  8674. return delta;
  8675. }
  8676. var indent = -1, parent = node.parentNode;
  8677. while (!parent.classList.contains("ql-clipboard")) {
  8678. if ((_parchment2.default.query(parent) || {}).blotName === "list") {
  8679. indent += 1;
  8680. }
  8681. parent = parent.parentNode;
  8682. }
  8683. if (indent <= 0) return delta;
  8684. return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent }));
  8685. }
  8686. function matchNewline(node, delta) {
  8687. if (!deltaEndsWith(delta, "\n")) {
  8688. if (isLine(node) || delta.length() > 0 && node.nextSibling && isLine(node.nextSibling)) {
  8689. delta.insert("\n");
  8690. }
  8691. }
  8692. return delta;
  8693. }
  8694. function matchSpacing(node, delta) {
  8695. if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, "\n\n")) {
  8696. var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom);
  8697. if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) {
  8698. delta.insert("\n");
  8699. }
  8700. }
  8701. return delta;
  8702. }
  8703. function matchStyles(node, delta) {
  8704. var formats = {};
  8705. var style = node.style || {};
  8706. if (style.fontStyle && computeStyle(node).fontStyle === "italic") {
  8707. formats.italic = true;
  8708. }
  8709. if (style.fontWeight && (computeStyle(node).fontWeight.startsWith("bold") || parseInt(computeStyle(node).fontWeight) >= 700)) {
  8710. formats.bold = true;
  8711. }
  8712. if (Object.keys(formats).length > 0) {
  8713. delta = applyFormat(delta, formats);
  8714. }
  8715. if (parseFloat(style.textIndent || 0) > 0) {
  8716. delta = new _quillDelta2.default().insert(" ").concat(delta);
  8717. }
  8718. return delta;
  8719. }
  8720. function matchText(node, delta) {
  8721. var text = node.data;
  8722. if (node.parentNode.tagName === "O:P") {
  8723. return delta.insert(text.trim());
  8724. }
  8725. if (text.trim().length === 0 && node.parentNode.classList.contains("ql-clipboard")) {
  8726. return delta;
  8727. }
  8728. if (!computeStyle(node.parentNode).whiteSpace.startsWith("pre")) {
  8729. var replacer = function replacer2(collapse, match) {
  8730. match = match.replace(/[^\u00a0]/g, "");
  8731. return match.length < 1 && collapse ? " " : match;
  8732. };
  8733. text = text.replace(/\r\n/g, " ").replace(/\n/g, " ");
  8734. text = text.replace(/\s\s+/g, replacer.bind(replacer, true));
  8735. if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) {
  8736. text = text.replace(/^\s+/, replacer.bind(replacer, false));
  8737. }
  8738. if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) {
  8739. text = text.replace(/\s+$/, replacer.bind(replacer, false));
  8740. }
  8741. }
  8742. return delta.insert(text);
  8743. }
  8744. exports2.default = Clipboard;
  8745. exports2.matchAttributor = matchAttributor;
  8746. exports2.matchBlot = matchBlot;
  8747. exports2.matchNewline = matchNewline;
  8748. exports2.matchSpacing = matchSpacing;
  8749. exports2.matchText = matchText;
  8750. }),
  8751. /* 56 */
  8752. /***/
  8753. (function(module2, exports2, __webpack_require__) {
  8754. "use strict";
  8755. Object.defineProperty(exports2, "__esModule", {
  8756. value: true
  8757. });
  8758. var _createClass = /* @__PURE__ */ (function() {
  8759. function defineProperties(target, props) {
  8760. for (var i = 0; i < props.length; i++) {
  8761. var descriptor = props[i];
  8762. descriptor.enumerable = descriptor.enumerable || false;
  8763. descriptor.configurable = true;
  8764. if ("value" in descriptor) descriptor.writable = true;
  8765. Object.defineProperty(target, descriptor.key, descriptor);
  8766. }
  8767. }
  8768. return function(Constructor, protoProps, staticProps) {
  8769. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  8770. if (staticProps) defineProperties(Constructor, staticProps);
  8771. return Constructor;
  8772. };
  8773. })();
  8774. var _get = function get(object, property, receiver) {
  8775. if (object === null) object = Function.prototype;
  8776. var desc = Object.getOwnPropertyDescriptor(object, property);
  8777. if (desc === void 0) {
  8778. var parent = Object.getPrototypeOf(object);
  8779. if (parent === null) {
  8780. return void 0;
  8781. } else {
  8782. return get(parent, property, receiver);
  8783. }
  8784. } else if ("value" in desc) {
  8785. return desc.value;
  8786. } else {
  8787. var getter = desc.get;
  8788. if (getter === void 0) {
  8789. return void 0;
  8790. }
  8791. return getter.call(receiver);
  8792. }
  8793. };
  8794. var _inline = __webpack_require__(6);
  8795. var _inline2 = _interopRequireDefault(_inline);
  8796. function _interopRequireDefault(obj) {
  8797. return obj && obj.__esModule ? obj : { default: obj };
  8798. }
  8799. function _classCallCheck(instance, Constructor) {
  8800. if (!(instance instanceof Constructor)) {
  8801. throw new TypeError("Cannot call a class as a function");
  8802. }
  8803. }
  8804. function _possibleConstructorReturn(self2, call) {
  8805. if (!self2) {
  8806. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  8807. }
  8808. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  8809. }
  8810. function _inherits(subClass, superClass) {
  8811. if (typeof superClass !== "function" && superClass !== null) {
  8812. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  8813. }
  8814. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  8815. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  8816. }
  8817. var Bold = (function(_Inline) {
  8818. _inherits(Bold2, _Inline);
  8819. function Bold2() {
  8820. _classCallCheck(this, Bold2);
  8821. return _possibleConstructorReturn(this, (Bold2.__proto__ || Object.getPrototypeOf(Bold2)).apply(this, arguments));
  8822. }
  8823. _createClass(Bold2, [{
  8824. key: "optimize",
  8825. value: function optimize(context) {
  8826. _get(Bold2.prototype.__proto__ || Object.getPrototypeOf(Bold2.prototype), "optimize", this).call(this, context);
  8827. if (this.domNode.tagName !== this.statics.tagName[0]) {
  8828. this.replaceWith(this.statics.blotName);
  8829. }
  8830. }
  8831. }], [{
  8832. key: "create",
  8833. value: function create() {
  8834. return _get(Bold2.__proto__ || Object.getPrototypeOf(Bold2), "create", this).call(this);
  8835. }
  8836. }, {
  8837. key: "formats",
  8838. value: function formats() {
  8839. return true;
  8840. }
  8841. }]);
  8842. return Bold2;
  8843. })(_inline2.default);
  8844. Bold.blotName = "bold";
  8845. Bold.tagName = ["STRONG", "B"];
  8846. exports2.default = Bold;
  8847. }),
  8848. /* 57 */
  8849. /***/
  8850. (function(module2, exports2, __webpack_require__) {
  8851. "use strict";
  8852. Object.defineProperty(exports2, "__esModule", {
  8853. value: true
  8854. });
  8855. exports2.addControls = exports2.default = void 0;
  8856. var _slicedToArray = /* @__PURE__ */ (function() {
  8857. function sliceIterator(arr, i) {
  8858. var _arr = [];
  8859. var _n = true;
  8860. var _d = false;
  8861. var _e = void 0;
  8862. try {
  8863. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  8864. _arr.push(_s.value);
  8865. if (i && _arr.length === i) break;
  8866. }
  8867. } catch (err) {
  8868. _d = true;
  8869. _e = err;
  8870. } finally {
  8871. try {
  8872. if (!_n && _i["return"]) _i["return"]();
  8873. } finally {
  8874. if (_d) throw _e;
  8875. }
  8876. }
  8877. return _arr;
  8878. }
  8879. return function(arr, i) {
  8880. if (Array.isArray(arr)) {
  8881. return arr;
  8882. } else if (Symbol.iterator in Object(arr)) {
  8883. return sliceIterator(arr, i);
  8884. } else {
  8885. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  8886. }
  8887. };
  8888. })();
  8889. var _createClass = /* @__PURE__ */ (function() {
  8890. function defineProperties(target, props) {
  8891. for (var i = 0; i < props.length; i++) {
  8892. var descriptor = props[i];
  8893. descriptor.enumerable = descriptor.enumerable || false;
  8894. descriptor.configurable = true;
  8895. if ("value" in descriptor) descriptor.writable = true;
  8896. Object.defineProperty(target, descriptor.key, descriptor);
  8897. }
  8898. }
  8899. return function(Constructor, protoProps, staticProps) {
  8900. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  8901. if (staticProps) defineProperties(Constructor, staticProps);
  8902. return Constructor;
  8903. };
  8904. })();
  8905. var _quillDelta = __webpack_require__(2);
  8906. var _quillDelta2 = _interopRequireDefault(_quillDelta);
  8907. var _parchment = __webpack_require__(0);
  8908. var _parchment2 = _interopRequireDefault(_parchment);
  8909. var _quill = __webpack_require__(5);
  8910. var _quill2 = _interopRequireDefault(_quill);
  8911. var _logger = __webpack_require__(10);
  8912. var _logger2 = _interopRequireDefault(_logger);
  8913. var _module = __webpack_require__(9);
  8914. var _module2 = _interopRequireDefault(_module);
  8915. function _interopRequireDefault(obj) {
  8916. return obj && obj.__esModule ? obj : { default: obj };
  8917. }
  8918. function _defineProperty(obj, key, value) {
  8919. if (key in obj) {
  8920. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  8921. } else {
  8922. obj[key] = value;
  8923. }
  8924. return obj;
  8925. }
  8926. function _classCallCheck(instance, Constructor) {
  8927. if (!(instance instanceof Constructor)) {
  8928. throw new TypeError("Cannot call a class as a function");
  8929. }
  8930. }
  8931. function _possibleConstructorReturn(self2, call) {
  8932. if (!self2) {
  8933. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  8934. }
  8935. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  8936. }
  8937. function _inherits(subClass, superClass) {
  8938. if (typeof superClass !== "function" && superClass !== null) {
  8939. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  8940. }
  8941. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  8942. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  8943. }
  8944. var debug = (0, _logger2.default)("quill:toolbar");
  8945. var Toolbar = (function(_Module) {
  8946. _inherits(Toolbar2, _Module);
  8947. function Toolbar2(quill, options) {
  8948. _classCallCheck(this, Toolbar2);
  8949. var _this = _possibleConstructorReturn(this, (Toolbar2.__proto__ || Object.getPrototypeOf(Toolbar2)).call(this, quill, options));
  8950. if (Array.isArray(_this.options.container)) {
  8951. var container = document.createElement("div");
  8952. addControls(container, _this.options.container);
  8953. quill.container.parentNode.insertBefore(container, quill.container);
  8954. _this.container = container;
  8955. } else if (typeof _this.options.container === "string") {
  8956. _this.container = document.querySelector(_this.options.container);
  8957. } else {
  8958. _this.container = _this.options.container;
  8959. }
  8960. if (!(_this.container instanceof HTMLElement)) {
  8961. var _ret;
  8962. return _ret = debug.error("Container required for toolbar", _this.options), _possibleConstructorReturn(_this, _ret);
  8963. }
  8964. _this.container.classList.add("ql-toolbar");
  8965. _this.controls = [];
  8966. _this.handlers = {};
  8967. Object.keys(_this.options.handlers).forEach(function(format) {
  8968. _this.addHandler(format, _this.options.handlers[format]);
  8969. });
  8970. [].forEach.call(_this.container.querySelectorAll("button, select"), function(input) {
  8971. _this.attach(input);
  8972. });
  8973. _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function(type, range) {
  8974. if (type === _quill2.default.events.SELECTION_CHANGE) {
  8975. _this.update(range);
  8976. }
  8977. });
  8978. _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function() {
  8979. var _this$quill$selection = _this.quill.selection.getRange(), _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1), range = _this$quill$selection2[0];
  8980. _this.update(range);
  8981. });
  8982. return _this;
  8983. }
  8984. _createClass(Toolbar2, [{
  8985. key: "addHandler",
  8986. value: function addHandler(format, handler) {
  8987. this.handlers[format] = handler;
  8988. }
  8989. }, {
  8990. key: "attach",
  8991. value: function attach(input) {
  8992. var _this2 = this;
  8993. var format = [].find.call(input.classList, function(className) {
  8994. return className.indexOf("ql-") === 0;
  8995. });
  8996. if (!format) return;
  8997. format = format.slice("ql-".length);
  8998. if (input.tagName === "BUTTON") {
  8999. input.setAttribute("type", "button");
  9000. }
  9001. if (this.handlers[format] == null) {
  9002. if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) {
  9003. debug.warn("ignoring attaching to disabled format", format, input);
  9004. return;
  9005. }
  9006. if (_parchment2.default.query(format) == null) {
  9007. debug.warn("ignoring attaching to nonexistent format", format, input);
  9008. return;
  9009. }
  9010. }
  9011. var eventName = input.tagName === "SELECT" ? "change" : "click";
  9012. input.addEventListener(eventName, function(e) {
  9013. var value = void 0;
  9014. if (input.tagName === "SELECT") {
  9015. if (input.selectedIndex < 0) return;
  9016. var selected = input.options[input.selectedIndex];
  9017. if (selected.hasAttribute("selected")) {
  9018. value = false;
  9019. } else {
  9020. value = selected.value || false;
  9021. }
  9022. } else {
  9023. if (input.classList.contains("ql-active")) {
  9024. value = false;
  9025. } else {
  9026. value = input.value || !input.hasAttribute("value");
  9027. }
  9028. e.preventDefault();
  9029. }
  9030. _this2.quill.focus();
  9031. var _quill$selection$getR = _this2.quill.selection.getRange(), _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1), range = _quill$selection$getR2[0];
  9032. if (_this2.handlers[format] != null) {
  9033. _this2.handlers[format].call(_this2, value);
  9034. } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) {
  9035. value = prompt("Enter " + format);
  9036. if (!value) return;
  9037. _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty({}, format, value)), _quill2.default.sources.USER);
  9038. } else {
  9039. _this2.quill.format(format, value, _quill2.default.sources.USER);
  9040. }
  9041. _this2.update(range);
  9042. });
  9043. this.controls.push([format, input]);
  9044. }
  9045. }, {
  9046. key: "update",
  9047. value: function update(range) {
  9048. var formats = range == null ? {} : this.quill.getFormat(range);
  9049. this.controls.forEach(function(pair) {
  9050. var _pair = _slicedToArray(pair, 2), format = _pair[0], input = _pair[1];
  9051. if (input.tagName === "SELECT") {
  9052. var option = void 0;
  9053. if (range == null) {
  9054. option = null;
  9055. } else if (formats[format] == null) {
  9056. option = input.querySelector("option[selected]");
  9057. } else if (!Array.isArray(formats[format])) {
  9058. var value = formats[format];
  9059. if (typeof value === "string") {
  9060. value = value.replace(/\"/g, '\\"');
  9061. }
  9062. option = input.querySelector('option[value="' + value + '"]');
  9063. }
  9064. if (option == null) {
  9065. input.value = "";
  9066. input.selectedIndex = -1;
  9067. } else {
  9068. option.selected = true;
  9069. }
  9070. } else {
  9071. if (range == null) {
  9072. input.classList.remove("ql-active");
  9073. } else if (input.hasAttribute("value")) {
  9074. var isActive = formats[format] === input.getAttribute("value") || formats[format] != null && formats[format].toString() === input.getAttribute("value") || formats[format] == null && !input.getAttribute("value");
  9075. input.classList.toggle("ql-active", isActive);
  9076. } else {
  9077. input.classList.toggle("ql-active", formats[format] != null);
  9078. }
  9079. }
  9080. });
  9081. }
  9082. }]);
  9083. return Toolbar2;
  9084. })(_module2.default);
  9085. Toolbar.DEFAULTS = {};
  9086. function addButton(container, format, value) {
  9087. var input = document.createElement("button");
  9088. input.setAttribute("type", "button");
  9089. input.classList.add("ql-" + format);
  9090. if (value != null) {
  9091. input.value = value;
  9092. }
  9093. container.appendChild(input);
  9094. }
  9095. function addControls(container, groups) {
  9096. if (!Array.isArray(groups[0])) {
  9097. groups = [groups];
  9098. }
  9099. groups.forEach(function(controls) {
  9100. var group = document.createElement("span");
  9101. group.classList.add("ql-formats");
  9102. controls.forEach(function(control) {
  9103. if (typeof control === "string") {
  9104. addButton(group, control);
  9105. } else {
  9106. var format = Object.keys(control)[0];
  9107. var value = control[format];
  9108. if (Array.isArray(value)) {
  9109. addSelect(group, format, value);
  9110. } else {
  9111. addButton(group, format, value);
  9112. }
  9113. }
  9114. });
  9115. container.appendChild(group);
  9116. });
  9117. }
  9118. function addSelect(container, format, values) {
  9119. var input = document.createElement("select");
  9120. input.classList.add("ql-" + format);
  9121. values.forEach(function(value) {
  9122. var option = document.createElement("option");
  9123. if (value !== false) {
  9124. option.setAttribute("value", value);
  9125. } else {
  9126. option.setAttribute("selected", "selected");
  9127. }
  9128. input.appendChild(option);
  9129. });
  9130. container.appendChild(input);
  9131. }
  9132. Toolbar.DEFAULTS = {
  9133. container: null,
  9134. handlers: {
  9135. clean: function clean() {
  9136. var _this3 = this;
  9137. var range = this.quill.getSelection();
  9138. if (range == null) return;
  9139. if (range.length == 0) {
  9140. var formats = this.quill.getFormat();
  9141. Object.keys(formats).forEach(function(name) {
  9142. if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) {
  9143. _this3.quill.format(name, false);
  9144. }
  9145. });
  9146. } else {
  9147. this.quill.removeFormat(range, _quill2.default.sources.USER);
  9148. }
  9149. },
  9150. direction: function direction(value) {
  9151. var align = this.quill.getFormat()["align"];
  9152. if (value === "rtl" && align == null) {
  9153. this.quill.format("align", "right", _quill2.default.sources.USER);
  9154. } else if (!value && align === "right") {
  9155. this.quill.format("align", false, _quill2.default.sources.USER);
  9156. }
  9157. this.quill.format("direction", value, _quill2.default.sources.USER);
  9158. },
  9159. indent: function indent(value) {
  9160. var range = this.quill.getSelection();
  9161. var formats = this.quill.getFormat(range);
  9162. var indent2 = parseInt(formats.indent || 0);
  9163. if (value === "+1" || value === "-1") {
  9164. var modifier = value === "+1" ? 1 : -1;
  9165. if (formats.direction === "rtl") modifier *= -1;
  9166. this.quill.format("indent", indent2 + modifier, _quill2.default.sources.USER);
  9167. }
  9168. },
  9169. link: function link(value) {
  9170. if (value === true) {
  9171. value = prompt("Enter link URL:");
  9172. }
  9173. this.quill.format("link", value, _quill2.default.sources.USER);
  9174. },
  9175. list: function list(value) {
  9176. var range = this.quill.getSelection();
  9177. var formats = this.quill.getFormat(range);
  9178. if (value === "check") {
  9179. if (formats["list"] === "checked" || formats["list"] === "unchecked") {
  9180. this.quill.format("list", false, _quill2.default.sources.USER);
  9181. } else {
  9182. this.quill.format("list", "unchecked", _quill2.default.sources.USER);
  9183. }
  9184. } else {
  9185. this.quill.format("list", value, _quill2.default.sources.USER);
  9186. }
  9187. }
  9188. }
  9189. };
  9190. exports2.default = Toolbar;
  9191. exports2.addControls = addControls;
  9192. }),
  9193. /* 58 */
  9194. /***/
  9195. (function(module2, exports2) {
  9196. module2.exports = '<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>';
  9197. }),
  9198. /* 59 */
  9199. /***/
  9200. (function(module2, exports2, __webpack_require__) {
  9201. "use strict";
  9202. Object.defineProperty(exports2, "__esModule", {
  9203. value: true
  9204. });
  9205. var _createClass = /* @__PURE__ */ (function() {
  9206. function defineProperties(target, props) {
  9207. for (var i = 0; i < props.length; i++) {
  9208. var descriptor = props[i];
  9209. descriptor.enumerable = descriptor.enumerable || false;
  9210. descriptor.configurable = true;
  9211. if ("value" in descriptor) descriptor.writable = true;
  9212. Object.defineProperty(target, descriptor.key, descriptor);
  9213. }
  9214. }
  9215. return function(Constructor, protoProps, staticProps) {
  9216. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  9217. if (staticProps) defineProperties(Constructor, staticProps);
  9218. return Constructor;
  9219. };
  9220. })();
  9221. var _get = function get(object, property, receiver) {
  9222. if (object === null) object = Function.prototype;
  9223. var desc = Object.getOwnPropertyDescriptor(object, property);
  9224. if (desc === void 0) {
  9225. var parent = Object.getPrototypeOf(object);
  9226. if (parent === null) {
  9227. return void 0;
  9228. } else {
  9229. return get(parent, property, receiver);
  9230. }
  9231. } else if ("value" in desc) {
  9232. return desc.value;
  9233. } else {
  9234. var getter = desc.get;
  9235. if (getter === void 0) {
  9236. return void 0;
  9237. }
  9238. return getter.call(receiver);
  9239. }
  9240. };
  9241. var _picker = __webpack_require__(28);
  9242. var _picker2 = _interopRequireDefault(_picker);
  9243. function _interopRequireDefault(obj) {
  9244. return obj && obj.__esModule ? obj : { default: obj };
  9245. }
  9246. function _classCallCheck(instance, Constructor) {
  9247. if (!(instance instanceof Constructor)) {
  9248. throw new TypeError("Cannot call a class as a function");
  9249. }
  9250. }
  9251. function _possibleConstructorReturn(self2, call) {
  9252. if (!self2) {
  9253. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  9254. }
  9255. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  9256. }
  9257. function _inherits(subClass, superClass) {
  9258. if (typeof superClass !== "function" && superClass !== null) {
  9259. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  9260. }
  9261. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  9262. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  9263. }
  9264. var ColorPicker = (function(_Picker) {
  9265. _inherits(ColorPicker2, _Picker);
  9266. function ColorPicker2(select, label) {
  9267. _classCallCheck(this, ColorPicker2);
  9268. var _this = _possibleConstructorReturn(this, (ColorPicker2.__proto__ || Object.getPrototypeOf(ColorPicker2)).call(this, select));
  9269. _this.label.innerHTML = label;
  9270. _this.container.classList.add("ql-color-picker");
  9271. [].slice.call(_this.container.querySelectorAll(".ql-picker-item"), 0, 7).forEach(function(item) {
  9272. item.classList.add("ql-primary");
  9273. });
  9274. return _this;
  9275. }
  9276. _createClass(ColorPicker2, [{
  9277. key: "buildItem",
  9278. value: function buildItem(option) {
  9279. var item = _get(ColorPicker2.prototype.__proto__ || Object.getPrototypeOf(ColorPicker2.prototype), "buildItem", this).call(this, option);
  9280. item.style.backgroundColor = option.getAttribute("value") || "";
  9281. return item;
  9282. }
  9283. }, {
  9284. key: "selectItem",
  9285. value: function selectItem(item, trigger) {
  9286. _get(ColorPicker2.prototype.__proto__ || Object.getPrototypeOf(ColorPicker2.prototype), "selectItem", this).call(this, item, trigger);
  9287. var colorLabel = this.label.querySelector(".ql-color-label");
  9288. var value = item ? item.getAttribute("data-value") || "" : "";
  9289. if (colorLabel) {
  9290. if (colorLabel.tagName === "line") {
  9291. colorLabel.style.stroke = value;
  9292. } else {
  9293. colorLabel.style.fill = value;
  9294. }
  9295. }
  9296. }
  9297. }]);
  9298. return ColorPicker2;
  9299. })(_picker2.default);
  9300. exports2.default = ColorPicker;
  9301. }),
  9302. /* 60 */
  9303. /***/
  9304. (function(module2, exports2, __webpack_require__) {
  9305. "use strict";
  9306. Object.defineProperty(exports2, "__esModule", {
  9307. value: true
  9308. });
  9309. var _createClass = /* @__PURE__ */ (function() {
  9310. function defineProperties(target, props) {
  9311. for (var i = 0; i < props.length; i++) {
  9312. var descriptor = props[i];
  9313. descriptor.enumerable = descriptor.enumerable || false;
  9314. descriptor.configurable = true;
  9315. if ("value" in descriptor) descriptor.writable = true;
  9316. Object.defineProperty(target, descriptor.key, descriptor);
  9317. }
  9318. }
  9319. return function(Constructor, protoProps, staticProps) {
  9320. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  9321. if (staticProps) defineProperties(Constructor, staticProps);
  9322. return Constructor;
  9323. };
  9324. })();
  9325. var _get = function get(object, property, receiver) {
  9326. if (object === null) object = Function.prototype;
  9327. var desc = Object.getOwnPropertyDescriptor(object, property);
  9328. if (desc === void 0) {
  9329. var parent = Object.getPrototypeOf(object);
  9330. if (parent === null) {
  9331. return void 0;
  9332. } else {
  9333. return get(parent, property, receiver);
  9334. }
  9335. } else if ("value" in desc) {
  9336. return desc.value;
  9337. } else {
  9338. var getter = desc.get;
  9339. if (getter === void 0) {
  9340. return void 0;
  9341. }
  9342. return getter.call(receiver);
  9343. }
  9344. };
  9345. var _picker = __webpack_require__(28);
  9346. var _picker2 = _interopRequireDefault(_picker);
  9347. function _interopRequireDefault(obj) {
  9348. return obj && obj.__esModule ? obj : { default: obj };
  9349. }
  9350. function _classCallCheck(instance, Constructor) {
  9351. if (!(instance instanceof Constructor)) {
  9352. throw new TypeError("Cannot call a class as a function");
  9353. }
  9354. }
  9355. function _possibleConstructorReturn(self2, call) {
  9356. if (!self2) {
  9357. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  9358. }
  9359. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  9360. }
  9361. function _inherits(subClass, superClass) {
  9362. if (typeof superClass !== "function" && superClass !== null) {
  9363. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  9364. }
  9365. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  9366. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  9367. }
  9368. var IconPicker = (function(_Picker) {
  9369. _inherits(IconPicker2, _Picker);
  9370. function IconPicker2(select, icons) {
  9371. _classCallCheck(this, IconPicker2);
  9372. var _this = _possibleConstructorReturn(this, (IconPicker2.__proto__ || Object.getPrototypeOf(IconPicker2)).call(this, select));
  9373. _this.container.classList.add("ql-icon-picker");
  9374. [].forEach.call(_this.container.querySelectorAll(".ql-picker-item"), function(item) {
  9375. item.innerHTML = icons[item.getAttribute("data-value") || ""];
  9376. });
  9377. _this.defaultItem = _this.container.querySelector(".ql-selected");
  9378. _this.selectItem(_this.defaultItem);
  9379. return _this;
  9380. }
  9381. _createClass(IconPicker2, [{
  9382. key: "selectItem",
  9383. value: function selectItem(item, trigger) {
  9384. _get(IconPicker2.prototype.__proto__ || Object.getPrototypeOf(IconPicker2.prototype), "selectItem", this).call(this, item, trigger);
  9385. item = item || this.defaultItem;
  9386. this.label.innerHTML = item.innerHTML;
  9387. }
  9388. }]);
  9389. return IconPicker2;
  9390. })(_picker2.default);
  9391. exports2.default = IconPicker;
  9392. }),
  9393. /* 61 */
  9394. /***/
  9395. (function(module2, exports2, __webpack_require__) {
  9396. "use strict";
  9397. Object.defineProperty(exports2, "__esModule", {
  9398. value: true
  9399. });
  9400. var _createClass = /* @__PURE__ */ (function() {
  9401. function defineProperties(target, props) {
  9402. for (var i = 0; i < props.length; i++) {
  9403. var descriptor = props[i];
  9404. descriptor.enumerable = descriptor.enumerable || false;
  9405. descriptor.configurable = true;
  9406. if ("value" in descriptor) descriptor.writable = true;
  9407. Object.defineProperty(target, descriptor.key, descriptor);
  9408. }
  9409. }
  9410. return function(Constructor, protoProps, staticProps) {
  9411. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  9412. if (staticProps) defineProperties(Constructor, staticProps);
  9413. return Constructor;
  9414. };
  9415. })();
  9416. function _classCallCheck(instance, Constructor) {
  9417. if (!(instance instanceof Constructor)) {
  9418. throw new TypeError("Cannot call a class as a function");
  9419. }
  9420. }
  9421. var Tooltip = (function() {
  9422. function Tooltip2(quill, boundsContainer) {
  9423. var _this = this;
  9424. _classCallCheck(this, Tooltip2);
  9425. this.quill = quill;
  9426. this.boundsContainer = boundsContainer || document.body;
  9427. this.root = quill.addContainer("ql-tooltip");
  9428. this.root.innerHTML = this.constructor.TEMPLATE;
  9429. if (this.quill.root === this.quill.scrollingContainer) {
  9430. this.quill.root.addEventListener("scroll", function() {
  9431. _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + "px";
  9432. });
  9433. }
  9434. this.hide();
  9435. }
  9436. _createClass(Tooltip2, [{
  9437. key: "hide",
  9438. value: function hide() {
  9439. this.root.classList.add("ql-hidden");
  9440. }
  9441. }, {
  9442. key: "position",
  9443. value: function position(reference) {
  9444. var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2;
  9445. var top = reference.bottom + this.quill.root.scrollTop;
  9446. this.root.style.left = left + "px";
  9447. this.root.style.top = top + "px";
  9448. this.root.classList.remove("ql-flip");
  9449. var containerBounds = this.boundsContainer.getBoundingClientRect();
  9450. var rootBounds = this.root.getBoundingClientRect();
  9451. var shift = 0;
  9452. if (rootBounds.right > containerBounds.right) {
  9453. shift = containerBounds.right - rootBounds.right;
  9454. this.root.style.left = left + shift + "px";
  9455. }
  9456. if (rootBounds.left < containerBounds.left) {
  9457. shift = containerBounds.left - rootBounds.left;
  9458. this.root.style.left = left + shift + "px";
  9459. }
  9460. if (rootBounds.bottom > containerBounds.bottom) {
  9461. var height = rootBounds.bottom - rootBounds.top;
  9462. var verticalShift = reference.bottom - reference.top + height;
  9463. this.root.style.top = top - verticalShift + "px";
  9464. this.root.classList.add("ql-flip");
  9465. }
  9466. return shift;
  9467. }
  9468. }, {
  9469. key: "show",
  9470. value: function show() {
  9471. this.root.classList.remove("ql-editing");
  9472. this.root.classList.remove("ql-hidden");
  9473. }
  9474. }]);
  9475. return Tooltip2;
  9476. })();
  9477. exports2.default = Tooltip;
  9478. }),
  9479. /* 62 */
  9480. /***/
  9481. (function(module2, exports2, __webpack_require__) {
  9482. "use strict";
  9483. Object.defineProperty(exports2, "__esModule", {
  9484. value: true
  9485. });
  9486. var _slicedToArray = /* @__PURE__ */ (function() {
  9487. function sliceIterator(arr, i) {
  9488. var _arr = [];
  9489. var _n = true;
  9490. var _d = false;
  9491. var _e = void 0;
  9492. try {
  9493. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  9494. _arr.push(_s.value);
  9495. if (i && _arr.length === i) break;
  9496. }
  9497. } catch (err) {
  9498. _d = true;
  9499. _e = err;
  9500. } finally {
  9501. try {
  9502. if (!_n && _i["return"]) _i["return"]();
  9503. } finally {
  9504. if (_d) throw _e;
  9505. }
  9506. }
  9507. return _arr;
  9508. }
  9509. return function(arr, i) {
  9510. if (Array.isArray(arr)) {
  9511. return arr;
  9512. } else if (Symbol.iterator in Object(arr)) {
  9513. return sliceIterator(arr, i);
  9514. } else {
  9515. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  9516. }
  9517. };
  9518. })();
  9519. var _get = function get(object, property, receiver) {
  9520. if (object === null) object = Function.prototype;
  9521. var desc = Object.getOwnPropertyDescriptor(object, property);
  9522. if (desc === void 0) {
  9523. var parent = Object.getPrototypeOf(object);
  9524. if (parent === null) {
  9525. return void 0;
  9526. } else {
  9527. return get(parent, property, receiver);
  9528. }
  9529. } else if ("value" in desc) {
  9530. return desc.value;
  9531. } else {
  9532. var getter = desc.get;
  9533. if (getter === void 0) {
  9534. return void 0;
  9535. }
  9536. return getter.call(receiver);
  9537. }
  9538. };
  9539. var _createClass = /* @__PURE__ */ (function() {
  9540. function defineProperties(target, props) {
  9541. for (var i = 0; i < props.length; i++) {
  9542. var descriptor = props[i];
  9543. descriptor.enumerable = descriptor.enumerable || false;
  9544. descriptor.configurable = true;
  9545. if ("value" in descriptor) descriptor.writable = true;
  9546. Object.defineProperty(target, descriptor.key, descriptor);
  9547. }
  9548. }
  9549. return function(Constructor, protoProps, staticProps) {
  9550. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  9551. if (staticProps) defineProperties(Constructor, staticProps);
  9552. return Constructor;
  9553. };
  9554. })();
  9555. var _extend = __webpack_require__(3);
  9556. var _extend2 = _interopRequireDefault(_extend);
  9557. var _emitter = __webpack_require__(8);
  9558. var _emitter2 = _interopRequireDefault(_emitter);
  9559. var _base = __webpack_require__(43);
  9560. var _base2 = _interopRequireDefault(_base);
  9561. var _link = __webpack_require__(27);
  9562. var _link2 = _interopRequireDefault(_link);
  9563. var _selection = __webpack_require__(15);
  9564. var _icons = __webpack_require__(41);
  9565. var _icons2 = _interopRequireDefault(_icons);
  9566. function _interopRequireDefault(obj) {
  9567. return obj && obj.__esModule ? obj : { default: obj };
  9568. }
  9569. function _classCallCheck(instance, Constructor) {
  9570. if (!(instance instanceof Constructor)) {
  9571. throw new TypeError("Cannot call a class as a function");
  9572. }
  9573. }
  9574. function _possibleConstructorReturn(self2, call) {
  9575. if (!self2) {
  9576. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  9577. }
  9578. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  9579. }
  9580. function _inherits(subClass, superClass) {
  9581. if (typeof superClass !== "function" && superClass !== null) {
  9582. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  9583. }
  9584. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  9585. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  9586. }
  9587. var TOOLBAR_CONFIG = [[{ header: ["1", "2", "3", false] }], ["bold", "italic", "underline", "link"], [{ list: "ordered" }, { list: "bullet" }], ["clean"]];
  9588. var SnowTheme = (function(_BaseTheme) {
  9589. _inherits(SnowTheme2, _BaseTheme);
  9590. function SnowTheme2(quill, options) {
  9591. _classCallCheck(this, SnowTheme2);
  9592. if (options.modules.toolbar != null && options.modules.toolbar.container == null) {
  9593. options.modules.toolbar.container = TOOLBAR_CONFIG;
  9594. }
  9595. var _this = _possibleConstructorReturn(this, (SnowTheme2.__proto__ || Object.getPrototypeOf(SnowTheme2)).call(this, quill, options));
  9596. _this.quill.container.classList.add("ql-snow");
  9597. return _this;
  9598. }
  9599. _createClass(SnowTheme2, [{
  9600. key: "extendToolbar",
  9601. value: function extendToolbar(toolbar) {
  9602. toolbar.container.classList.add("ql-snow");
  9603. this.buildButtons([].slice.call(toolbar.container.querySelectorAll("button")), _icons2.default);
  9604. this.buildPickers([].slice.call(toolbar.container.querySelectorAll("select")), _icons2.default);
  9605. this.tooltip = new SnowTooltip(this.quill, this.options.bounds);
  9606. if (toolbar.container.querySelector(".ql-link")) {
  9607. this.quill.keyboard.addBinding({ key: "K", shortKey: true }, function(range, context) {
  9608. toolbar.handlers["link"].call(toolbar, !context.format.link);
  9609. });
  9610. }
  9611. }
  9612. }]);
  9613. return SnowTheme2;
  9614. })(_base2.default);
  9615. SnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {
  9616. modules: {
  9617. toolbar: {
  9618. handlers: {
  9619. link: function link(value) {
  9620. if (value) {
  9621. var range = this.quill.getSelection();
  9622. if (range == null || range.length == 0) return;
  9623. var preview = this.quill.getText(range);
  9624. if (/^\S+@\S+\.\S+$/.test(preview) && preview.indexOf("mailto:") !== 0) {
  9625. preview = "mailto:" + preview;
  9626. }
  9627. var tooltip = this.quill.theme.tooltip;
  9628. tooltip.edit("link", preview);
  9629. } else {
  9630. this.quill.format("link", false);
  9631. }
  9632. }
  9633. }
  9634. }
  9635. }
  9636. });
  9637. var SnowTooltip = (function(_BaseTooltip) {
  9638. _inherits(SnowTooltip2, _BaseTooltip);
  9639. function SnowTooltip2(quill, bounds) {
  9640. _classCallCheck(this, SnowTooltip2);
  9641. var _this2 = _possibleConstructorReturn(this, (SnowTooltip2.__proto__ || Object.getPrototypeOf(SnowTooltip2)).call(this, quill, bounds));
  9642. _this2.preview = _this2.root.querySelector("a.ql-preview");
  9643. return _this2;
  9644. }
  9645. _createClass(SnowTooltip2, [{
  9646. key: "listen",
  9647. value: function listen() {
  9648. var _this3 = this;
  9649. _get(SnowTooltip2.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip2.prototype), "listen", this).call(this);
  9650. this.root.querySelector("a.ql-action").addEventListener("click", function(event) {
  9651. if (_this3.root.classList.contains("ql-editing")) {
  9652. _this3.save();
  9653. } else {
  9654. _this3.edit("link", _this3.preview.textContent);
  9655. }
  9656. event.preventDefault();
  9657. });
  9658. this.root.querySelector("a.ql-remove").addEventListener("click", function(event) {
  9659. if (_this3.linkRange != null) {
  9660. var range = _this3.linkRange;
  9661. _this3.restoreFocus();
  9662. _this3.quill.formatText(range, "link", false, _emitter2.default.sources.USER);
  9663. delete _this3.linkRange;
  9664. }
  9665. event.preventDefault();
  9666. _this3.hide();
  9667. });
  9668. this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function(range, oldRange, source) {
  9669. if (range == null) return;
  9670. if (range.length === 0 && source === _emitter2.default.sources.USER) {
  9671. var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index), _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), link = _quill$scroll$descend2[0], offset = _quill$scroll$descend2[1];
  9672. if (link != null) {
  9673. _this3.linkRange = new _selection.Range(range.index - offset, link.length());
  9674. var preview = _link2.default.formats(link.domNode);
  9675. _this3.preview.textContent = preview;
  9676. _this3.preview.setAttribute("href", preview);
  9677. _this3.show();
  9678. _this3.position(_this3.quill.getBounds(_this3.linkRange));
  9679. return;
  9680. }
  9681. } else {
  9682. delete _this3.linkRange;
  9683. }
  9684. _this3.hide();
  9685. });
  9686. }
  9687. }, {
  9688. key: "show",
  9689. value: function show() {
  9690. _get(SnowTooltip2.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip2.prototype), "show", this).call(this);
  9691. this.root.removeAttribute("data-mode");
  9692. }
  9693. }]);
  9694. return SnowTooltip2;
  9695. })(_base.BaseTooltip);
  9696. SnowTooltip.TEMPLATE = ['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-action"></a>', '<a class="ql-remove"></a>'].join("");
  9697. exports2.default = SnowTheme;
  9698. }),
  9699. /* 63 */
  9700. /***/
  9701. (function(module2, exports2, __webpack_require__) {
  9702. "use strict";
  9703. Object.defineProperty(exports2, "__esModule", {
  9704. value: true
  9705. });
  9706. var _core = __webpack_require__(29);
  9707. var _core2 = _interopRequireDefault(_core);
  9708. var _align = __webpack_require__(36);
  9709. var _direction = __webpack_require__(38);
  9710. var _indent = __webpack_require__(64);
  9711. var _blockquote = __webpack_require__(65);
  9712. var _blockquote2 = _interopRequireDefault(_blockquote);
  9713. var _header = __webpack_require__(66);
  9714. var _header2 = _interopRequireDefault(_header);
  9715. var _list = __webpack_require__(67);
  9716. var _list2 = _interopRequireDefault(_list);
  9717. var _background = __webpack_require__(37);
  9718. var _color = __webpack_require__(26);
  9719. var _font = __webpack_require__(39);
  9720. var _size = __webpack_require__(40);
  9721. var _bold = __webpack_require__(56);
  9722. var _bold2 = _interopRequireDefault(_bold);
  9723. var _italic = __webpack_require__(68);
  9724. var _italic2 = _interopRequireDefault(_italic);
  9725. var _link = __webpack_require__(27);
  9726. var _link2 = _interopRequireDefault(_link);
  9727. var _script = __webpack_require__(69);
  9728. var _script2 = _interopRequireDefault(_script);
  9729. var _strike = __webpack_require__(70);
  9730. var _strike2 = _interopRequireDefault(_strike);
  9731. var _underline = __webpack_require__(71);
  9732. var _underline2 = _interopRequireDefault(_underline);
  9733. var _image = __webpack_require__(72);
  9734. var _image2 = _interopRequireDefault(_image);
  9735. var _video = __webpack_require__(73);
  9736. var _video2 = _interopRequireDefault(_video);
  9737. var _code = __webpack_require__(13);
  9738. var _code2 = _interopRequireDefault(_code);
  9739. var _formula = __webpack_require__(74);
  9740. var _formula2 = _interopRequireDefault(_formula);
  9741. var _syntax = __webpack_require__(75);
  9742. var _syntax2 = _interopRequireDefault(_syntax);
  9743. var _toolbar = __webpack_require__(57);
  9744. var _toolbar2 = _interopRequireDefault(_toolbar);
  9745. var _icons = __webpack_require__(41);
  9746. var _icons2 = _interopRequireDefault(_icons);
  9747. var _picker = __webpack_require__(28);
  9748. var _picker2 = _interopRequireDefault(_picker);
  9749. var _colorPicker = __webpack_require__(59);
  9750. var _colorPicker2 = _interopRequireDefault(_colorPicker);
  9751. var _iconPicker = __webpack_require__(60);
  9752. var _iconPicker2 = _interopRequireDefault(_iconPicker);
  9753. var _tooltip = __webpack_require__(61);
  9754. var _tooltip2 = _interopRequireDefault(_tooltip);
  9755. var _bubble = __webpack_require__(108);
  9756. var _bubble2 = _interopRequireDefault(_bubble);
  9757. var _snow = __webpack_require__(62);
  9758. var _snow2 = _interopRequireDefault(_snow);
  9759. function _interopRequireDefault(obj) {
  9760. return obj && obj.__esModule ? obj : { default: obj };
  9761. }
  9762. _core2.default.register({
  9763. "attributors/attribute/direction": _direction.DirectionAttribute,
  9764. "attributors/class/align": _align.AlignClass,
  9765. "attributors/class/background": _background.BackgroundClass,
  9766. "attributors/class/color": _color.ColorClass,
  9767. "attributors/class/direction": _direction.DirectionClass,
  9768. "attributors/class/font": _font.FontClass,
  9769. "attributors/class/size": _size.SizeClass,
  9770. "attributors/style/align": _align.AlignStyle,
  9771. "attributors/style/background": _background.BackgroundStyle,
  9772. "attributors/style/color": _color.ColorStyle,
  9773. "attributors/style/direction": _direction.DirectionStyle,
  9774. "attributors/style/font": _font.FontStyle,
  9775. "attributors/style/size": _size.SizeStyle
  9776. }, true);
  9777. _core2.default.register({
  9778. "formats/align": _align.AlignClass,
  9779. "formats/direction": _direction.DirectionClass,
  9780. "formats/indent": _indent.IndentClass,
  9781. "formats/background": _background.BackgroundStyle,
  9782. "formats/color": _color.ColorStyle,
  9783. "formats/font": _font.FontClass,
  9784. "formats/size": _size.SizeClass,
  9785. "formats/blockquote": _blockquote2.default,
  9786. "formats/code-block": _code2.default,
  9787. "formats/header": _header2.default,
  9788. "formats/list": _list2.default,
  9789. "formats/bold": _bold2.default,
  9790. "formats/code": _code.Code,
  9791. "formats/italic": _italic2.default,
  9792. "formats/link": _link2.default,
  9793. "formats/script": _script2.default,
  9794. "formats/strike": _strike2.default,
  9795. "formats/underline": _underline2.default,
  9796. "formats/image": _image2.default,
  9797. "formats/video": _video2.default,
  9798. "formats/list/item": _list.ListItem,
  9799. "modules/formula": _formula2.default,
  9800. "modules/syntax": _syntax2.default,
  9801. "modules/toolbar": _toolbar2.default,
  9802. "themes/bubble": _bubble2.default,
  9803. "themes/snow": _snow2.default,
  9804. "ui/icons": _icons2.default,
  9805. "ui/picker": _picker2.default,
  9806. "ui/icon-picker": _iconPicker2.default,
  9807. "ui/color-picker": _colorPicker2.default,
  9808. "ui/tooltip": _tooltip2.default
  9809. }, true);
  9810. exports2.default = _core2.default;
  9811. }),
  9812. /* 64 */
  9813. /***/
  9814. (function(module2, exports2, __webpack_require__) {
  9815. "use strict";
  9816. Object.defineProperty(exports2, "__esModule", {
  9817. value: true
  9818. });
  9819. exports2.IndentClass = void 0;
  9820. var _createClass = /* @__PURE__ */ (function() {
  9821. function defineProperties(target, props) {
  9822. for (var i = 0; i < props.length; i++) {
  9823. var descriptor = props[i];
  9824. descriptor.enumerable = descriptor.enumerable || false;
  9825. descriptor.configurable = true;
  9826. if ("value" in descriptor) descriptor.writable = true;
  9827. Object.defineProperty(target, descriptor.key, descriptor);
  9828. }
  9829. }
  9830. return function(Constructor, protoProps, staticProps) {
  9831. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  9832. if (staticProps) defineProperties(Constructor, staticProps);
  9833. return Constructor;
  9834. };
  9835. })();
  9836. var _get = function get(object, property, receiver) {
  9837. if (object === null) object = Function.prototype;
  9838. var desc = Object.getOwnPropertyDescriptor(object, property);
  9839. if (desc === void 0) {
  9840. var parent = Object.getPrototypeOf(object);
  9841. if (parent === null) {
  9842. return void 0;
  9843. } else {
  9844. return get(parent, property, receiver);
  9845. }
  9846. } else if ("value" in desc) {
  9847. return desc.value;
  9848. } else {
  9849. var getter = desc.get;
  9850. if (getter === void 0) {
  9851. return void 0;
  9852. }
  9853. return getter.call(receiver);
  9854. }
  9855. };
  9856. var _parchment = __webpack_require__(0);
  9857. var _parchment2 = _interopRequireDefault(_parchment);
  9858. function _interopRequireDefault(obj) {
  9859. return obj && obj.__esModule ? obj : { default: obj };
  9860. }
  9861. function _classCallCheck(instance, Constructor) {
  9862. if (!(instance instanceof Constructor)) {
  9863. throw new TypeError("Cannot call a class as a function");
  9864. }
  9865. }
  9866. function _possibleConstructorReturn(self2, call) {
  9867. if (!self2) {
  9868. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  9869. }
  9870. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  9871. }
  9872. function _inherits(subClass, superClass) {
  9873. if (typeof superClass !== "function" && superClass !== null) {
  9874. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  9875. }
  9876. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  9877. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  9878. }
  9879. var IdentAttributor = (function(_Parchment$Attributor) {
  9880. _inherits(IdentAttributor2, _Parchment$Attributor);
  9881. function IdentAttributor2() {
  9882. _classCallCheck(this, IdentAttributor2);
  9883. return _possibleConstructorReturn(this, (IdentAttributor2.__proto__ || Object.getPrototypeOf(IdentAttributor2)).apply(this, arguments));
  9884. }
  9885. _createClass(IdentAttributor2, [{
  9886. key: "add",
  9887. value: function add(node, value) {
  9888. if (value === "+1" || value === "-1") {
  9889. var indent = this.value(node) || 0;
  9890. value = value === "+1" ? indent + 1 : indent - 1;
  9891. }
  9892. if (value === 0) {
  9893. this.remove(node);
  9894. return true;
  9895. } else {
  9896. return _get(IdentAttributor2.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor2.prototype), "add", this).call(this, node, value);
  9897. }
  9898. }
  9899. }, {
  9900. key: "canAdd",
  9901. value: function canAdd(node, value) {
  9902. return _get(IdentAttributor2.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor2.prototype), "canAdd", this).call(this, node, value) || _get(IdentAttributor2.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor2.prototype), "canAdd", this).call(this, node, parseInt(value));
  9903. }
  9904. }, {
  9905. key: "value",
  9906. value: function value(node) {
  9907. return parseInt(_get(IdentAttributor2.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor2.prototype), "value", this).call(this, node)) || void 0;
  9908. }
  9909. }]);
  9910. return IdentAttributor2;
  9911. })(_parchment2.default.Attributor.Class);
  9912. var IndentClass = new IdentAttributor("indent", "ql-indent", {
  9913. scope: _parchment2.default.Scope.BLOCK,
  9914. whitelist: [1, 2, 3, 4, 5, 6, 7, 8]
  9915. });
  9916. exports2.IndentClass = IndentClass;
  9917. }),
  9918. /* 65 */
  9919. /***/
  9920. (function(module2, exports2, __webpack_require__) {
  9921. "use strict";
  9922. Object.defineProperty(exports2, "__esModule", {
  9923. value: true
  9924. });
  9925. var _block = __webpack_require__(4);
  9926. var _block2 = _interopRequireDefault(_block);
  9927. function _interopRequireDefault(obj) {
  9928. return obj && obj.__esModule ? obj : { default: obj };
  9929. }
  9930. function _classCallCheck(instance, Constructor) {
  9931. if (!(instance instanceof Constructor)) {
  9932. throw new TypeError("Cannot call a class as a function");
  9933. }
  9934. }
  9935. function _possibleConstructorReturn(self2, call) {
  9936. if (!self2) {
  9937. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  9938. }
  9939. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  9940. }
  9941. function _inherits(subClass, superClass) {
  9942. if (typeof superClass !== "function" && superClass !== null) {
  9943. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  9944. }
  9945. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  9946. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  9947. }
  9948. var Blockquote = (function(_Block) {
  9949. _inherits(Blockquote2, _Block);
  9950. function Blockquote2() {
  9951. _classCallCheck(this, Blockquote2);
  9952. return _possibleConstructorReturn(this, (Blockquote2.__proto__ || Object.getPrototypeOf(Blockquote2)).apply(this, arguments));
  9953. }
  9954. return Blockquote2;
  9955. })(_block2.default);
  9956. Blockquote.blotName = "blockquote";
  9957. Blockquote.tagName = "blockquote";
  9958. exports2.default = Blockquote;
  9959. }),
  9960. /* 66 */
  9961. /***/
  9962. (function(module2, exports2, __webpack_require__) {
  9963. "use strict";
  9964. Object.defineProperty(exports2, "__esModule", {
  9965. value: true
  9966. });
  9967. var _createClass = /* @__PURE__ */ (function() {
  9968. function defineProperties(target, props) {
  9969. for (var i = 0; i < props.length; i++) {
  9970. var descriptor = props[i];
  9971. descriptor.enumerable = descriptor.enumerable || false;
  9972. descriptor.configurable = true;
  9973. if ("value" in descriptor) descriptor.writable = true;
  9974. Object.defineProperty(target, descriptor.key, descriptor);
  9975. }
  9976. }
  9977. return function(Constructor, protoProps, staticProps) {
  9978. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  9979. if (staticProps) defineProperties(Constructor, staticProps);
  9980. return Constructor;
  9981. };
  9982. })();
  9983. var _block = __webpack_require__(4);
  9984. var _block2 = _interopRequireDefault(_block);
  9985. function _interopRequireDefault(obj) {
  9986. return obj && obj.__esModule ? obj : { default: obj };
  9987. }
  9988. function _classCallCheck(instance, Constructor) {
  9989. if (!(instance instanceof Constructor)) {
  9990. throw new TypeError("Cannot call a class as a function");
  9991. }
  9992. }
  9993. function _possibleConstructorReturn(self2, call) {
  9994. if (!self2) {
  9995. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  9996. }
  9997. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  9998. }
  9999. function _inherits(subClass, superClass) {
  10000. if (typeof superClass !== "function" && superClass !== null) {
  10001. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  10002. }
  10003. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  10004. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  10005. }
  10006. var Header = (function(_Block) {
  10007. _inherits(Header2, _Block);
  10008. function Header2() {
  10009. _classCallCheck(this, Header2);
  10010. return _possibleConstructorReturn(this, (Header2.__proto__ || Object.getPrototypeOf(Header2)).apply(this, arguments));
  10011. }
  10012. _createClass(Header2, null, [{
  10013. key: "formats",
  10014. value: function formats(domNode) {
  10015. return this.tagName.indexOf(domNode.tagName) + 1;
  10016. }
  10017. }]);
  10018. return Header2;
  10019. })(_block2.default);
  10020. Header.blotName = "header";
  10021. Header.tagName = ["H1", "H2", "H3", "H4", "H5", "H6"];
  10022. exports2.default = Header;
  10023. }),
  10024. /* 67 */
  10025. /***/
  10026. (function(module2, exports2, __webpack_require__) {
  10027. "use strict";
  10028. Object.defineProperty(exports2, "__esModule", {
  10029. value: true
  10030. });
  10031. exports2.default = exports2.ListItem = void 0;
  10032. var _createClass = /* @__PURE__ */ (function() {
  10033. function defineProperties(target, props) {
  10034. for (var i = 0; i < props.length; i++) {
  10035. var descriptor = props[i];
  10036. descriptor.enumerable = descriptor.enumerable || false;
  10037. descriptor.configurable = true;
  10038. if ("value" in descriptor) descriptor.writable = true;
  10039. Object.defineProperty(target, descriptor.key, descriptor);
  10040. }
  10041. }
  10042. return function(Constructor, protoProps, staticProps) {
  10043. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  10044. if (staticProps) defineProperties(Constructor, staticProps);
  10045. return Constructor;
  10046. };
  10047. })();
  10048. var _get = function get(object, property, receiver) {
  10049. if (object === null) object = Function.prototype;
  10050. var desc = Object.getOwnPropertyDescriptor(object, property);
  10051. if (desc === void 0) {
  10052. var parent = Object.getPrototypeOf(object);
  10053. if (parent === null) {
  10054. return void 0;
  10055. } else {
  10056. return get(parent, property, receiver);
  10057. }
  10058. } else if ("value" in desc) {
  10059. return desc.value;
  10060. } else {
  10061. var getter = desc.get;
  10062. if (getter === void 0) {
  10063. return void 0;
  10064. }
  10065. return getter.call(receiver);
  10066. }
  10067. };
  10068. var _parchment = __webpack_require__(0);
  10069. var _parchment2 = _interopRequireDefault(_parchment);
  10070. var _block = __webpack_require__(4);
  10071. var _block2 = _interopRequireDefault(_block);
  10072. var _container = __webpack_require__(25);
  10073. var _container2 = _interopRequireDefault(_container);
  10074. function _interopRequireDefault(obj) {
  10075. return obj && obj.__esModule ? obj : { default: obj };
  10076. }
  10077. function _defineProperty(obj, key, value) {
  10078. if (key in obj) {
  10079. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  10080. } else {
  10081. obj[key] = value;
  10082. }
  10083. return obj;
  10084. }
  10085. function _classCallCheck(instance, Constructor) {
  10086. if (!(instance instanceof Constructor)) {
  10087. throw new TypeError("Cannot call a class as a function");
  10088. }
  10089. }
  10090. function _possibleConstructorReturn(self2, call) {
  10091. if (!self2) {
  10092. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  10093. }
  10094. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  10095. }
  10096. function _inherits(subClass, superClass) {
  10097. if (typeof superClass !== "function" && superClass !== null) {
  10098. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  10099. }
  10100. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  10101. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  10102. }
  10103. var ListItem = (function(_Block) {
  10104. _inherits(ListItem2, _Block);
  10105. function ListItem2() {
  10106. _classCallCheck(this, ListItem2);
  10107. return _possibleConstructorReturn(this, (ListItem2.__proto__ || Object.getPrototypeOf(ListItem2)).apply(this, arguments));
  10108. }
  10109. _createClass(ListItem2, [{
  10110. key: "format",
  10111. value: function format(name, value) {
  10112. if (name === List.blotName && !value) {
  10113. this.replaceWith(_parchment2.default.create(this.statics.scope));
  10114. } else {
  10115. _get(ListItem2.prototype.__proto__ || Object.getPrototypeOf(ListItem2.prototype), "format", this).call(this, name, value);
  10116. }
  10117. }
  10118. }, {
  10119. key: "remove",
  10120. value: function remove() {
  10121. if (this.prev == null && this.next == null) {
  10122. this.parent.remove();
  10123. } else {
  10124. _get(ListItem2.prototype.__proto__ || Object.getPrototypeOf(ListItem2.prototype), "remove", this).call(this);
  10125. }
  10126. }
  10127. }, {
  10128. key: "replaceWith",
  10129. value: function replaceWith(name, value) {
  10130. this.parent.isolate(this.offset(this.parent), this.length());
  10131. if (name === this.parent.statics.blotName) {
  10132. this.parent.replaceWith(name, value);
  10133. return this;
  10134. } else {
  10135. this.parent.unwrap();
  10136. return _get(ListItem2.prototype.__proto__ || Object.getPrototypeOf(ListItem2.prototype), "replaceWith", this).call(this, name, value);
  10137. }
  10138. }
  10139. }], [{
  10140. key: "formats",
  10141. value: function formats(domNode) {
  10142. return domNode.tagName === this.tagName ? void 0 : _get(ListItem2.__proto__ || Object.getPrototypeOf(ListItem2), "formats", this).call(this, domNode);
  10143. }
  10144. }]);
  10145. return ListItem2;
  10146. })(_block2.default);
  10147. ListItem.blotName = "list-item";
  10148. ListItem.tagName = "LI";
  10149. var List = (function(_Container) {
  10150. _inherits(List2, _Container);
  10151. _createClass(List2, null, [{
  10152. key: "create",
  10153. value: function create(value) {
  10154. var tagName = value === "ordered" ? "OL" : "UL";
  10155. var node = _get(List2.__proto__ || Object.getPrototypeOf(List2), "create", this).call(this, tagName);
  10156. if (value === "checked" || value === "unchecked") {
  10157. node.setAttribute("data-checked", value === "checked");
  10158. }
  10159. return node;
  10160. }
  10161. }, {
  10162. key: "formats",
  10163. value: function formats(domNode) {
  10164. if (domNode.tagName === "OL") return "ordered";
  10165. if (domNode.tagName === "UL") {
  10166. if (domNode.hasAttribute("data-checked")) {
  10167. return domNode.getAttribute("data-checked") === "true" ? "checked" : "unchecked";
  10168. } else {
  10169. return "bullet";
  10170. }
  10171. }
  10172. return void 0;
  10173. }
  10174. }]);
  10175. function List2(domNode) {
  10176. _classCallCheck(this, List2);
  10177. var _this2 = _possibleConstructorReturn(this, (List2.__proto__ || Object.getPrototypeOf(List2)).call(this, domNode));
  10178. var listEventHandler = function listEventHandler2(e) {
  10179. if (e.target.parentNode !== domNode) return;
  10180. var format = _this2.statics.formats(domNode);
  10181. var blot = _parchment2.default.find(e.target);
  10182. if (format === "checked") {
  10183. blot.format("list", "unchecked");
  10184. } else if (format === "unchecked") {
  10185. blot.format("list", "checked");
  10186. }
  10187. };
  10188. domNode.addEventListener("touchstart", listEventHandler);
  10189. domNode.addEventListener("mousedown", listEventHandler);
  10190. return _this2;
  10191. }
  10192. _createClass(List2, [{
  10193. key: "format",
  10194. value: function format(name, value) {
  10195. if (this.children.length > 0) {
  10196. this.children.tail.format(name, value);
  10197. }
  10198. }
  10199. }, {
  10200. key: "formats",
  10201. value: function formats() {
  10202. return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode));
  10203. }
  10204. }, {
  10205. key: "insertBefore",
  10206. value: function insertBefore(blot, ref2) {
  10207. if (blot instanceof ListItem) {
  10208. _get(List2.prototype.__proto__ || Object.getPrototypeOf(List2.prototype), "insertBefore", this).call(this, blot, ref2);
  10209. } else {
  10210. var index = ref2 == null ? this.length() : ref2.offset(this);
  10211. var after = this.split(index);
  10212. after.parent.insertBefore(blot, after);
  10213. }
  10214. }
  10215. }, {
  10216. key: "optimize",
  10217. value: function optimize(context) {
  10218. _get(List2.prototype.__proto__ || Object.getPrototypeOf(List2.prototype), "optimize", this).call(this, context);
  10219. var next = this.next;
  10220. if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName && next.domNode.getAttribute("data-checked") === this.domNode.getAttribute("data-checked")) {
  10221. next.moveChildren(this);
  10222. next.remove();
  10223. }
  10224. }
  10225. }, {
  10226. key: "replace",
  10227. value: function replace(target) {
  10228. if (target.statics.blotName !== this.statics.blotName) {
  10229. var item = _parchment2.default.create(this.statics.defaultChild);
  10230. target.moveChildren(item);
  10231. this.appendChild(item);
  10232. }
  10233. _get(List2.prototype.__proto__ || Object.getPrototypeOf(List2.prototype), "replace", this).call(this, target);
  10234. }
  10235. }]);
  10236. return List2;
  10237. })(_container2.default);
  10238. List.blotName = "list";
  10239. List.scope = _parchment2.default.Scope.BLOCK_BLOT;
  10240. List.tagName = ["OL", "UL"];
  10241. List.defaultChild = "list-item";
  10242. List.allowedChildren = [ListItem];
  10243. exports2.ListItem = ListItem;
  10244. exports2.default = List;
  10245. }),
  10246. /* 68 */
  10247. /***/
  10248. (function(module2, exports2, __webpack_require__) {
  10249. "use strict";
  10250. Object.defineProperty(exports2, "__esModule", {
  10251. value: true
  10252. });
  10253. var _bold = __webpack_require__(56);
  10254. var _bold2 = _interopRequireDefault(_bold);
  10255. function _interopRequireDefault(obj) {
  10256. return obj && obj.__esModule ? obj : { default: obj };
  10257. }
  10258. function _classCallCheck(instance, Constructor) {
  10259. if (!(instance instanceof Constructor)) {
  10260. throw new TypeError("Cannot call a class as a function");
  10261. }
  10262. }
  10263. function _possibleConstructorReturn(self2, call) {
  10264. if (!self2) {
  10265. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  10266. }
  10267. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  10268. }
  10269. function _inherits(subClass, superClass) {
  10270. if (typeof superClass !== "function" && superClass !== null) {
  10271. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  10272. }
  10273. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  10274. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  10275. }
  10276. var Italic = (function(_Bold) {
  10277. _inherits(Italic2, _Bold);
  10278. function Italic2() {
  10279. _classCallCheck(this, Italic2);
  10280. return _possibleConstructorReturn(this, (Italic2.__proto__ || Object.getPrototypeOf(Italic2)).apply(this, arguments));
  10281. }
  10282. return Italic2;
  10283. })(_bold2.default);
  10284. Italic.blotName = "italic";
  10285. Italic.tagName = ["EM", "I"];
  10286. exports2.default = Italic;
  10287. }),
  10288. /* 69 */
  10289. /***/
  10290. (function(module2, exports2, __webpack_require__) {
  10291. "use strict";
  10292. Object.defineProperty(exports2, "__esModule", {
  10293. value: true
  10294. });
  10295. var _createClass = /* @__PURE__ */ (function() {
  10296. function defineProperties(target, props) {
  10297. for (var i = 0; i < props.length; i++) {
  10298. var descriptor = props[i];
  10299. descriptor.enumerable = descriptor.enumerable || false;
  10300. descriptor.configurable = true;
  10301. if ("value" in descriptor) descriptor.writable = true;
  10302. Object.defineProperty(target, descriptor.key, descriptor);
  10303. }
  10304. }
  10305. return function(Constructor, protoProps, staticProps) {
  10306. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  10307. if (staticProps) defineProperties(Constructor, staticProps);
  10308. return Constructor;
  10309. };
  10310. })();
  10311. var _get = function get(object, property, receiver) {
  10312. if (object === null) object = Function.prototype;
  10313. var desc = Object.getOwnPropertyDescriptor(object, property);
  10314. if (desc === void 0) {
  10315. var parent = Object.getPrototypeOf(object);
  10316. if (parent === null) {
  10317. return void 0;
  10318. } else {
  10319. return get(parent, property, receiver);
  10320. }
  10321. } else if ("value" in desc) {
  10322. return desc.value;
  10323. } else {
  10324. var getter = desc.get;
  10325. if (getter === void 0) {
  10326. return void 0;
  10327. }
  10328. return getter.call(receiver);
  10329. }
  10330. };
  10331. var _inline = __webpack_require__(6);
  10332. var _inline2 = _interopRequireDefault(_inline);
  10333. function _interopRequireDefault(obj) {
  10334. return obj && obj.__esModule ? obj : { default: obj };
  10335. }
  10336. function _classCallCheck(instance, Constructor) {
  10337. if (!(instance instanceof Constructor)) {
  10338. throw new TypeError("Cannot call a class as a function");
  10339. }
  10340. }
  10341. function _possibleConstructorReturn(self2, call) {
  10342. if (!self2) {
  10343. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  10344. }
  10345. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  10346. }
  10347. function _inherits(subClass, superClass) {
  10348. if (typeof superClass !== "function" && superClass !== null) {
  10349. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  10350. }
  10351. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  10352. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  10353. }
  10354. var Script = (function(_Inline) {
  10355. _inherits(Script2, _Inline);
  10356. function Script2() {
  10357. _classCallCheck(this, Script2);
  10358. return _possibleConstructorReturn(this, (Script2.__proto__ || Object.getPrototypeOf(Script2)).apply(this, arguments));
  10359. }
  10360. _createClass(Script2, null, [{
  10361. key: "create",
  10362. value: function create(value) {
  10363. if (value === "super") {
  10364. return document.createElement("sup");
  10365. } else if (value === "sub") {
  10366. return document.createElement("sub");
  10367. } else {
  10368. return _get(Script2.__proto__ || Object.getPrototypeOf(Script2), "create", this).call(this, value);
  10369. }
  10370. }
  10371. }, {
  10372. key: "formats",
  10373. value: function formats(domNode) {
  10374. if (domNode.tagName === "SUB") return "sub";
  10375. if (domNode.tagName === "SUP") return "super";
  10376. return void 0;
  10377. }
  10378. }]);
  10379. return Script2;
  10380. })(_inline2.default);
  10381. Script.blotName = "script";
  10382. Script.tagName = ["SUB", "SUP"];
  10383. exports2.default = Script;
  10384. }),
  10385. /* 70 */
  10386. /***/
  10387. (function(module2, exports2, __webpack_require__) {
  10388. "use strict";
  10389. Object.defineProperty(exports2, "__esModule", {
  10390. value: true
  10391. });
  10392. var _inline = __webpack_require__(6);
  10393. var _inline2 = _interopRequireDefault(_inline);
  10394. function _interopRequireDefault(obj) {
  10395. return obj && obj.__esModule ? obj : { default: obj };
  10396. }
  10397. function _classCallCheck(instance, Constructor) {
  10398. if (!(instance instanceof Constructor)) {
  10399. throw new TypeError("Cannot call a class as a function");
  10400. }
  10401. }
  10402. function _possibleConstructorReturn(self2, call) {
  10403. if (!self2) {
  10404. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  10405. }
  10406. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  10407. }
  10408. function _inherits(subClass, superClass) {
  10409. if (typeof superClass !== "function" && superClass !== null) {
  10410. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  10411. }
  10412. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  10413. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  10414. }
  10415. var Strike = (function(_Inline) {
  10416. _inherits(Strike2, _Inline);
  10417. function Strike2() {
  10418. _classCallCheck(this, Strike2);
  10419. return _possibleConstructorReturn(this, (Strike2.__proto__ || Object.getPrototypeOf(Strike2)).apply(this, arguments));
  10420. }
  10421. return Strike2;
  10422. })(_inline2.default);
  10423. Strike.blotName = "strike";
  10424. Strike.tagName = "S";
  10425. exports2.default = Strike;
  10426. }),
  10427. /* 71 */
  10428. /***/
  10429. (function(module2, exports2, __webpack_require__) {
  10430. "use strict";
  10431. Object.defineProperty(exports2, "__esModule", {
  10432. value: true
  10433. });
  10434. var _inline = __webpack_require__(6);
  10435. var _inline2 = _interopRequireDefault(_inline);
  10436. function _interopRequireDefault(obj) {
  10437. return obj && obj.__esModule ? obj : { default: obj };
  10438. }
  10439. function _classCallCheck(instance, Constructor) {
  10440. if (!(instance instanceof Constructor)) {
  10441. throw new TypeError("Cannot call a class as a function");
  10442. }
  10443. }
  10444. function _possibleConstructorReturn(self2, call) {
  10445. if (!self2) {
  10446. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  10447. }
  10448. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  10449. }
  10450. function _inherits(subClass, superClass) {
  10451. if (typeof superClass !== "function" && superClass !== null) {
  10452. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  10453. }
  10454. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  10455. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  10456. }
  10457. var Underline = (function(_Inline) {
  10458. _inherits(Underline2, _Inline);
  10459. function Underline2() {
  10460. _classCallCheck(this, Underline2);
  10461. return _possibleConstructorReturn(this, (Underline2.__proto__ || Object.getPrototypeOf(Underline2)).apply(this, arguments));
  10462. }
  10463. return Underline2;
  10464. })(_inline2.default);
  10465. Underline.blotName = "underline";
  10466. Underline.tagName = "U";
  10467. exports2.default = Underline;
  10468. }),
  10469. /* 72 */
  10470. /***/
  10471. (function(module2, exports2, __webpack_require__) {
  10472. "use strict";
  10473. Object.defineProperty(exports2, "__esModule", {
  10474. value: true
  10475. });
  10476. var _createClass = /* @__PURE__ */ (function() {
  10477. function defineProperties(target, props) {
  10478. for (var i = 0; i < props.length; i++) {
  10479. var descriptor = props[i];
  10480. descriptor.enumerable = descriptor.enumerable || false;
  10481. descriptor.configurable = true;
  10482. if ("value" in descriptor) descriptor.writable = true;
  10483. Object.defineProperty(target, descriptor.key, descriptor);
  10484. }
  10485. }
  10486. return function(Constructor, protoProps, staticProps) {
  10487. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  10488. if (staticProps) defineProperties(Constructor, staticProps);
  10489. return Constructor;
  10490. };
  10491. })();
  10492. var _get = function get(object, property, receiver) {
  10493. if (object === null) object = Function.prototype;
  10494. var desc = Object.getOwnPropertyDescriptor(object, property);
  10495. if (desc === void 0) {
  10496. var parent = Object.getPrototypeOf(object);
  10497. if (parent === null) {
  10498. return void 0;
  10499. } else {
  10500. return get(parent, property, receiver);
  10501. }
  10502. } else if ("value" in desc) {
  10503. return desc.value;
  10504. } else {
  10505. var getter = desc.get;
  10506. if (getter === void 0) {
  10507. return void 0;
  10508. }
  10509. return getter.call(receiver);
  10510. }
  10511. };
  10512. var _parchment = __webpack_require__(0);
  10513. var _parchment2 = _interopRequireDefault(_parchment);
  10514. var _link = __webpack_require__(27);
  10515. function _interopRequireDefault(obj) {
  10516. return obj && obj.__esModule ? obj : { default: obj };
  10517. }
  10518. function _classCallCheck(instance, Constructor) {
  10519. if (!(instance instanceof Constructor)) {
  10520. throw new TypeError("Cannot call a class as a function");
  10521. }
  10522. }
  10523. function _possibleConstructorReturn(self2, call) {
  10524. if (!self2) {
  10525. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  10526. }
  10527. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  10528. }
  10529. function _inherits(subClass, superClass) {
  10530. if (typeof superClass !== "function" && superClass !== null) {
  10531. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  10532. }
  10533. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  10534. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  10535. }
  10536. var ATTRIBUTES = ["alt", "height", "width"];
  10537. var Image = (function(_Parchment$Embed) {
  10538. _inherits(Image2, _Parchment$Embed);
  10539. function Image2() {
  10540. _classCallCheck(this, Image2);
  10541. return _possibleConstructorReturn(this, (Image2.__proto__ || Object.getPrototypeOf(Image2)).apply(this, arguments));
  10542. }
  10543. _createClass(Image2, [{
  10544. key: "format",
  10545. value: function format(name, value) {
  10546. if (ATTRIBUTES.indexOf(name) > -1) {
  10547. if (value) {
  10548. this.domNode.setAttribute(name, value);
  10549. } else {
  10550. this.domNode.removeAttribute(name);
  10551. }
  10552. } else {
  10553. _get(Image2.prototype.__proto__ || Object.getPrototypeOf(Image2.prototype), "format", this).call(this, name, value);
  10554. }
  10555. }
  10556. }], [{
  10557. key: "create",
  10558. value: function create(value) {
  10559. var node = _get(Image2.__proto__ || Object.getPrototypeOf(Image2), "create", this).call(this, value);
  10560. if (typeof value === "string") {
  10561. node.setAttribute("src", this.sanitize(value));
  10562. }
  10563. return node;
  10564. }
  10565. }, {
  10566. key: "formats",
  10567. value: function formats(domNode) {
  10568. return ATTRIBUTES.reduce(function(formats2, attribute) {
  10569. if (domNode.hasAttribute(attribute)) {
  10570. formats2[attribute] = domNode.getAttribute(attribute);
  10571. }
  10572. return formats2;
  10573. }, {});
  10574. }
  10575. }, {
  10576. key: "match",
  10577. value: function match(url) {
  10578. return /\.(jpe?g|gif|png)$/.test(url) || /^data:image\/.+;base64/.test(url);
  10579. }
  10580. }, {
  10581. key: "sanitize",
  10582. value: function sanitize(url) {
  10583. return (0, _link.sanitize)(url, ["http", "https", "data"]) ? url : "//:0";
  10584. }
  10585. }, {
  10586. key: "value",
  10587. value: function value(domNode) {
  10588. return domNode.getAttribute("src");
  10589. }
  10590. }]);
  10591. return Image2;
  10592. })(_parchment2.default.Embed);
  10593. Image.blotName = "image";
  10594. Image.tagName = "IMG";
  10595. exports2.default = Image;
  10596. }),
  10597. /* 73 */
  10598. /***/
  10599. (function(module2, exports2, __webpack_require__) {
  10600. "use strict";
  10601. Object.defineProperty(exports2, "__esModule", {
  10602. value: true
  10603. });
  10604. var _createClass = /* @__PURE__ */ (function() {
  10605. function defineProperties(target, props) {
  10606. for (var i = 0; i < props.length; i++) {
  10607. var descriptor = props[i];
  10608. descriptor.enumerable = descriptor.enumerable || false;
  10609. descriptor.configurable = true;
  10610. if ("value" in descriptor) descriptor.writable = true;
  10611. Object.defineProperty(target, descriptor.key, descriptor);
  10612. }
  10613. }
  10614. return function(Constructor, protoProps, staticProps) {
  10615. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  10616. if (staticProps) defineProperties(Constructor, staticProps);
  10617. return Constructor;
  10618. };
  10619. })();
  10620. var _get = function get(object, property, receiver) {
  10621. if (object === null) object = Function.prototype;
  10622. var desc = Object.getOwnPropertyDescriptor(object, property);
  10623. if (desc === void 0) {
  10624. var parent = Object.getPrototypeOf(object);
  10625. if (parent === null) {
  10626. return void 0;
  10627. } else {
  10628. return get(parent, property, receiver);
  10629. }
  10630. } else if ("value" in desc) {
  10631. return desc.value;
  10632. } else {
  10633. var getter = desc.get;
  10634. if (getter === void 0) {
  10635. return void 0;
  10636. }
  10637. return getter.call(receiver);
  10638. }
  10639. };
  10640. var _block = __webpack_require__(4);
  10641. var _link = __webpack_require__(27);
  10642. var _link2 = _interopRequireDefault(_link);
  10643. function _interopRequireDefault(obj) {
  10644. return obj && obj.__esModule ? obj : { default: obj };
  10645. }
  10646. function _classCallCheck(instance, Constructor) {
  10647. if (!(instance instanceof Constructor)) {
  10648. throw new TypeError("Cannot call a class as a function");
  10649. }
  10650. }
  10651. function _possibleConstructorReturn(self2, call) {
  10652. if (!self2) {
  10653. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  10654. }
  10655. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  10656. }
  10657. function _inherits(subClass, superClass) {
  10658. if (typeof superClass !== "function" && superClass !== null) {
  10659. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  10660. }
  10661. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  10662. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  10663. }
  10664. var ATTRIBUTES = ["height", "width"];
  10665. var Video = (function(_BlockEmbed) {
  10666. _inherits(Video2, _BlockEmbed);
  10667. function Video2() {
  10668. _classCallCheck(this, Video2);
  10669. return _possibleConstructorReturn(this, (Video2.__proto__ || Object.getPrototypeOf(Video2)).apply(this, arguments));
  10670. }
  10671. _createClass(Video2, [{
  10672. key: "format",
  10673. value: function format(name, value) {
  10674. if (ATTRIBUTES.indexOf(name) > -1) {
  10675. if (value) {
  10676. this.domNode.setAttribute(name, value);
  10677. } else {
  10678. this.domNode.removeAttribute(name);
  10679. }
  10680. } else {
  10681. _get(Video2.prototype.__proto__ || Object.getPrototypeOf(Video2.prototype), "format", this).call(this, name, value);
  10682. }
  10683. }
  10684. }], [{
  10685. key: "create",
  10686. value: function create(value) {
  10687. var node = _get(Video2.__proto__ || Object.getPrototypeOf(Video2), "create", this).call(this, value);
  10688. node.setAttribute("frameborder", "0");
  10689. node.setAttribute("allowfullscreen", true);
  10690. node.setAttribute("src", this.sanitize(value));
  10691. return node;
  10692. }
  10693. }, {
  10694. key: "formats",
  10695. value: function formats(domNode) {
  10696. return ATTRIBUTES.reduce(function(formats2, attribute) {
  10697. if (domNode.hasAttribute(attribute)) {
  10698. formats2[attribute] = domNode.getAttribute(attribute);
  10699. }
  10700. return formats2;
  10701. }, {});
  10702. }
  10703. }, {
  10704. key: "sanitize",
  10705. value: function sanitize(url) {
  10706. return _link2.default.sanitize(url);
  10707. }
  10708. }, {
  10709. key: "value",
  10710. value: function value(domNode) {
  10711. return domNode.getAttribute("src");
  10712. }
  10713. }]);
  10714. return Video2;
  10715. })(_block.BlockEmbed);
  10716. Video.blotName = "video";
  10717. Video.className = "ql-video";
  10718. Video.tagName = "IFRAME";
  10719. exports2.default = Video;
  10720. }),
  10721. /* 74 */
  10722. /***/
  10723. (function(module2, exports2, __webpack_require__) {
  10724. "use strict";
  10725. Object.defineProperty(exports2, "__esModule", {
  10726. value: true
  10727. });
  10728. exports2.default = exports2.FormulaBlot = void 0;
  10729. var _createClass = /* @__PURE__ */ (function() {
  10730. function defineProperties(target, props) {
  10731. for (var i = 0; i < props.length; i++) {
  10732. var descriptor = props[i];
  10733. descriptor.enumerable = descriptor.enumerable || false;
  10734. descriptor.configurable = true;
  10735. if ("value" in descriptor) descriptor.writable = true;
  10736. Object.defineProperty(target, descriptor.key, descriptor);
  10737. }
  10738. }
  10739. return function(Constructor, protoProps, staticProps) {
  10740. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  10741. if (staticProps) defineProperties(Constructor, staticProps);
  10742. return Constructor;
  10743. };
  10744. })();
  10745. var _get = function get(object, property, receiver) {
  10746. if (object === null) object = Function.prototype;
  10747. var desc = Object.getOwnPropertyDescriptor(object, property);
  10748. if (desc === void 0) {
  10749. var parent = Object.getPrototypeOf(object);
  10750. if (parent === null) {
  10751. return void 0;
  10752. } else {
  10753. return get(parent, property, receiver);
  10754. }
  10755. } else if ("value" in desc) {
  10756. return desc.value;
  10757. } else {
  10758. var getter = desc.get;
  10759. if (getter === void 0) {
  10760. return void 0;
  10761. }
  10762. return getter.call(receiver);
  10763. }
  10764. };
  10765. var _embed = __webpack_require__(35);
  10766. var _embed2 = _interopRequireDefault(_embed);
  10767. var _quill = __webpack_require__(5);
  10768. var _quill2 = _interopRequireDefault(_quill);
  10769. var _module = __webpack_require__(9);
  10770. var _module2 = _interopRequireDefault(_module);
  10771. function _interopRequireDefault(obj) {
  10772. return obj && obj.__esModule ? obj : { default: obj };
  10773. }
  10774. function _classCallCheck(instance, Constructor) {
  10775. if (!(instance instanceof Constructor)) {
  10776. throw new TypeError("Cannot call a class as a function");
  10777. }
  10778. }
  10779. function _possibleConstructorReturn(self2, call) {
  10780. if (!self2) {
  10781. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  10782. }
  10783. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  10784. }
  10785. function _inherits(subClass, superClass) {
  10786. if (typeof superClass !== "function" && superClass !== null) {
  10787. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  10788. }
  10789. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  10790. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  10791. }
  10792. var FormulaBlot = (function(_Embed) {
  10793. _inherits(FormulaBlot2, _Embed);
  10794. function FormulaBlot2() {
  10795. _classCallCheck(this, FormulaBlot2);
  10796. return _possibleConstructorReturn(this, (FormulaBlot2.__proto__ || Object.getPrototypeOf(FormulaBlot2)).apply(this, arguments));
  10797. }
  10798. _createClass(FormulaBlot2, null, [{
  10799. key: "create",
  10800. value: function create(value) {
  10801. var node = _get(FormulaBlot2.__proto__ || Object.getPrototypeOf(FormulaBlot2), "create", this).call(this, value);
  10802. if (typeof value === "string") {
  10803. window.katex.render(value, node, {
  10804. throwOnError: false,
  10805. errorColor: "#f00"
  10806. });
  10807. node.setAttribute("data-value", value);
  10808. }
  10809. return node;
  10810. }
  10811. }, {
  10812. key: "value",
  10813. value: function value(domNode) {
  10814. return domNode.getAttribute("data-value");
  10815. }
  10816. }]);
  10817. return FormulaBlot2;
  10818. })(_embed2.default);
  10819. FormulaBlot.blotName = "formula";
  10820. FormulaBlot.className = "ql-formula";
  10821. FormulaBlot.tagName = "SPAN";
  10822. var Formula = (function(_Module) {
  10823. _inherits(Formula2, _Module);
  10824. _createClass(Formula2, null, [{
  10825. key: "register",
  10826. value: function register() {
  10827. _quill2.default.register(FormulaBlot, true);
  10828. }
  10829. }]);
  10830. function Formula2() {
  10831. _classCallCheck(this, Formula2);
  10832. var _this2 = _possibleConstructorReturn(this, (Formula2.__proto__ || Object.getPrototypeOf(Formula2)).call(this));
  10833. if (window.katex == null) {
  10834. throw new Error("Formula module requires KaTeX.");
  10835. }
  10836. return _this2;
  10837. }
  10838. return Formula2;
  10839. })(_module2.default);
  10840. exports2.FormulaBlot = FormulaBlot;
  10841. exports2.default = Formula;
  10842. }),
  10843. /* 75 */
  10844. /***/
  10845. (function(module2, exports2, __webpack_require__) {
  10846. "use strict";
  10847. Object.defineProperty(exports2, "__esModule", {
  10848. value: true
  10849. });
  10850. exports2.default = exports2.CodeToken = exports2.CodeBlock = void 0;
  10851. var _createClass = /* @__PURE__ */ (function() {
  10852. function defineProperties(target, props) {
  10853. for (var i = 0; i < props.length; i++) {
  10854. var descriptor = props[i];
  10855. descriptor.enumerable = descriptor.enumerable || false;
  10856. descriptor.configurable = true;
  10857. if ("value" in descriptor) descriptor.writable = true;
  10858. Object.defineProperty(target, descriptor.key, descriptor);
  10859. }
  10860. }
  10861. return function(Constructor, protoProps, staticProps) {
  10862. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  10863. if (staticProps) defineProperties(Constructor, staticProps);
  10864. return Constructor;
  10865. };
  10866. })();
  10867. var _get = function get(object, property, receiver) {
  10868. if (object === null) object = Function.prototype;
  10869. var desc = Object.getOwnPropertyDescriptor(object, property);
  10870. if (desc === void 0) {
  10871. var parent = Object.getPrototypeOf(object);
  10872. if (parent === null) {
  10873. return void 0;
  10874. } else {
  10875. return get(parent, property, receiver);
  10876. }
  10877. } else if ("value" in desc) {
  10878. return desc.value;
  10879. } else {
  10880. var getter = desc.get;
  10881. if (getter === void 0) {
  10882. return void 0;
  10883. }
  10884. return getter.call(receiver);
  10885. }
  10886. };
  10887. var _parchment = __webpack_require__(0);
  10888. var _parchment2 = _interopRequireDefault(_parchment);
  10889. var _quill = __webpack_require__(5);
  10890. var _quill2 = _interopRequireDefault(_quill);
  10891. var _module = __webpack_require__(9);
  10892. var _module2 = _interopRequireDefault(_module);
  10893. var _code = __webpack_require__(13);
  10894. var _code2 = _interopRequireDefault(_code);
  10895. function _interopRequireDefault(obj) {
  10896. return obj && obj.__esModule ? obj : { default: obj };
  10897. }
  10898. function _classCallCheck(instance, Constructor) {
  10899. if (!(instance instanceof Constructor)) {
  10900. throw new TypeError("Cannot call a class as a function");
  10901. }
  10902. }
  10903. function _possibleConstructorReturn(self2, call) {
  10904. if (!self2) {
  10905. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  10906. }
  10907. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  10908. }
  10909. function _inherits(subClass, superClass) {
  10910. if (typeof superClass !== "function" && superClass !== null) {
  10911. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  10912. }
  10913. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  10914. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  10915. }
  10916. var SyntaxCodeBlock = (function(_CodeBlock) {
  10917. _inherits(SyntaxCodeBlock2, _CodeBlock);
  10918. function SyntaxCodeBlock2() {
  10919. _classCallCheck(this, SyntaxCodeBlock2);
  10920. return _possibleConstructorReturn(this, (SyntaxCodeBlock2.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock2)).apply(this, arguments));
  10921. }
  10922. _createClass(SyntaxCodeBlock2, [{
  10923. key: "replaceWith",
  10924. value: function replaceWith(block) {
  10925. this.domNode.textContent = this.domNode.textContent;
  10926. this.attach();
  10927. _get(SyntaxCodeBlock2.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock2.prototype), "replaceWith", this).call(this, block);
  10928. }
  10929. }, {
  10930. key: "highlight",
  10931. value: function highlight(_highlight) {
  10932. var text = this.domNode.textContent;
  10933. if (this.cachedText !== text) {
  10934. if (text.trim().length > 0 || this.cachedText == null) {
  10935. this.domNode.innerHTML = _highlight(text);
  10936. this.domNode.normalize();
  10937. this.attach();
  10938. }
  10939. this.cachedText = text;
  10940. }
  10941. }
  10942. }]);
  10943. return SyntaxCodeBlock2;
  10944. })(_code2.default);
  10945. SyntaxCodeBlock.className = "ql-syntax";
  10946. var CodeToken = new _parchment2.default.Attributor.Class("token", "hljs", {
  10947. scope: _parchment2.default.Scope.INLINE
  10948. });
  10949. var Syntax = (function(_Module) {
  10950. _inherits(Syntax2, _Module);
  10951. _createClass(Syntax2, null, [{
  10952. key: "register",
  10953. value: function register() {
  10954. _quill2.default.register(CodeToken, true);
  10955. _quill2.default.register(SyntaxCodeBlock, true);
  10956. }
  10957. }]);
  10958. function Syntax2(quill, options) {
  10959. _classCallCheck(this, Syntax2);
  10960. var _this2 = _possibleConstructorReturn(this, (Syntax2.__proto__ || Object.getPrototypeOf(Syntax2)).call(this, quill, options));
  10961. if (typeof _this2.options.highlight !== "function") {
  10962. throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");
  10963. }
  10964. var timer = null;
  10965. _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function() {
  10966. clearTimeout(timer);
  10967. timer = setTimeout(function() {
  10968. _this2.highlight();
  10969. timer = null;
  10970. }, _this2.options.interval);
  10971. });
  10972. _this2.highlight();
  10973. return _this2;
  10974. }
  10975. _createClass(Syntax2, [{
  10976. key: "highlight",
  10977. value: function highlight() {
  10978. var _this3 = this;
  10979. if (this.quill.selection.composing) return;
  10980. this.quill.update(_quill2.default.sources.USER);
  10981. var range = this.quill.getSelection();
  10982. this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function(code) {
  10983. code.highlight(_this3.options.highlight);
  10984. });
  10985. this.quill.update(_quill2.default.sources.SILENT);
  10986. if (range != null) {
  10987. this.quill.setSelection(range, _quill2.default.sources.SILENT);
  10988. }
  10989. }
  10990. }]);
  10991. return Syntax2;
  10992. })(_module2.default);
  10993. Syntax.DEFAULTS = {
  10994. highlight: (function() {
  10995. if (window.hljs == null) return null;
  10996. return function(text) {
  10997. var result = window.hljs.highlightAuto(text);
  10998. return result.value;
  10999. };
  11000. })(),
  11001. interval: 1e3
  11002. };
  11003. exports2.CodeBlock = SyntaxCodeBlock;
  11004. exports2.CodeToken = CodeToken;
  11005. exports2.default = Syntax;
  11006. }),
  11007. /* 76 */
  11008. /***/
  11009. (function(module2, exports2) {
  11010. module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>';
  11011. }),
  11012. /* 77 */
  11013. /***/
  11014. (function(module2, exports2) {
  11015. module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>';
  11016. }),
  11017. /* 78 */
  11018. /***/
  11019. (function(module2, exports2) {
  11020. module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>';
  11021. }),
  11022. /* 79 */
  11023. /***/
  11024. (function(module2, exports2) {
  11025. module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>';
  11026. }),
  11027. /* 80 */
  11028. /***/
  11029. (function(module2, exports2) {
  11030. module2.exports = '<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>';
  11031. }),
  11032. /* 81 */
  11033. /***/
  11034. (function(module2, exports2) {
  11035. module2.exports = '<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>';
  11036. }),
  11037. /* 82 */
  11038. /***/
  11039. (function(module2, exports2) {
  11040. module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>';
  11041. }),
  11042. /* 83 */
  11043. /***/
  11044. (function(module2, exports2) {
  11045. module2.exports = '<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>';
  11046. }),
  11047. /* 84 */
  11048. /***/
  11049. (function(module2, exports2) {
  11050. module2.exports = '<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>';
  11051. }),
  11052. /* 85 */
  11053. /***/
  11054. (function(module2, exports2) {
  11055. module2.exports = '<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>';
  11056. }),
  11057. /* 86 */
  11058. /***/
  11059. (function(module2, exports2) {
  11060. module2.exports = '<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>';
  11061. }),
  11062. /* 87 */
  11063. /***/
  11064. (function(module2, exports2) {
  11065. module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>';
  11066. }),
  11067. /* 88 */
  11068. /***/
  11069. (function(module2, exports2) {
  11070. module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>';
  11071. }),
  11072. /* 89 */
  11073. /***/
  11074. (function(module2, exports2) {
  11075. module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>';
  11076. }),
  11077. /* 90 */
  11078. /***/
  11079. (function(module2, exports2) {
  11080. module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>';
  11081. }),
  11082. /* 91 */
  11083. /***/
  11084. (function(module2, exports2) {
  11085. module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>';
  11086. }),
  11087. /* 92 */
  11088. /***/
  11089. (function(module2, exports2) {
  11090. module2.exports = '<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>';
  11091. }),
  11092. /* 93 */
  11093. /***/
  11094. (function(module2, exports2) {
  11095. module2.exports = '<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>';
  11096. }),
  11097. /* 94 */
  11098. /***/
  11099. (function(module2, exports2) {
  11100. module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>';
  11101. }),
  11102. /* 95 */
  11103. /***/
  11104. (function(module2, exports2) {
  11105. module2.exports = '<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>';
  11106. }),
  11107. /* 96 */
  11108. /***/
  11109. (function(module2, exports2) {
  11110. module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>';
  11111. }),
  11112. /* 97 */
  11113. /***/
  11114. (function(module2, exports2) {
  11115. module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>';
  11116. }),
  11117. /* 98 */
  11118. /***/
  11119. (function(module2, exports2) {
  11120. module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>';
  11121. }),
  11122. /* 99 */
  11123. /***/
  11124. (function(module2, exports2) {
  11125. module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>';
  11126. }),
  11127. /* 100 */
  11128. /***/
  11129. (function(module2, exports2) {
  11130. module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>';
  11131. }),
  11132. /* 101 */
  11133. /***/
  11134. (function(module2, exports2) {
  11135. module2.exports = '<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>';
  11136. }),
  11137. /* 102 */
  11138. /***/
  11139. (function(module2, exports2) {
  11140. module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>';
  11141. }),
  11142. /* 103 */
  11143. /***/
  11144. (function(module2, exports2) {
  11145. module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>';
  11146. }),
  11147. /* 104 */
  11148. /***/
  11149. (function(module2, exports2) {
  11150. module2.exports = '<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>';
  11151. }),
  11152. /* 105 */
  11153. /***/
  11154. (function(module2, exports2) {
  11155. module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>';
  11156. }),
  11157. /* 106 */
  11158. /***/
  11159. (function(module2, exports2) {
  11160. module2.exports = '<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>';
  11161. }),
  11162. /* 107 */
  11163. /***/
  11164. (function(module2, exports2) {
  11165. module2.exports = '<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>';
  11166. }),
  11167. /* 108 */
  11168. /***/
  11169. (function(module2, exports2, __webpack_require__) {
  11170. "use strict";
  11171. Object.defineProperty(exports2, "__esModule", {
  11172. value: true
  11173. });
  11174. exports2.default = exports2.BubbleTooltip = void 0;
  11175. var _get = function get(object, property, receiver) {
  11176. if (object === null) object = Function.prototype;
  11177. var desc = Object.getOwnPropertyDescriptor(object, property);
  11178. if (desc === void 0) {
  11179. var parent = Object.getPrototypeOf(object);
  11180. if (parent === null) {
  11181. return void 0;
  11182. } else {
  11183. return get(parent, property, receiver);
  11184. }
  11185. } else if ("value" in desc) {
  11186. return desc.value;
  11187. } else {
  11188. var getter = desc.get;
  11189. if (getter === void 0) {
  11190. return void 0;
  11191. }
  11192. return getter.call(receiver);
  11193. }
  11194. };
  11195. var _createClass = /* @__PURE__ */ (function() {
  11196. function defineProperties(target, props) {
  11197. for (var i = 0; i < props.length; i++) {
  11198. var descriptor = props[i];
  11199. descriptor.enumerable = descriptor.enumerable || false;
  11200. descriptor.configurable = true;
  11201. if ("value" in descriptor) descriptor.writable = true;
  11202. Object.defineProperty(target, descriptor.key, descriptor);
  11203. }
  11204. }
  11205. return function(Constructor, protoProps, staticProps) {
  11206. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  11207. if (staticProps) defineProperties(Constructor, staticProps);
  11208. return Constructor;
  11209. };
  11210. })();
  11211. var _extend = __webpack_require__(3);
  11212. var _extend2 = _interopRequireDefault(_extend);
  11213. var _emitter = __webpack_require__(8);
  11214. var _emitter2 = _interopRequireDefault(_emitter);
  11215. var _base = __webpack_require__(43);
  11216. var _base2 = _interopRequireDefault(_base);
  11217. var _selection = __webpack_require__(15);
  11218. var _icons = __webpack_require__(41);
  11219. var _icons2 = _interopRequireDefault(_icons);
  11220. function _interopRequireDefault(obj) {
  11221. return obj && obj.__esModule ? obj : { default: obj };
  11222. }
  11223. function _classCallCheck(instance, Constructor) {
  11224. if (!(instance instanceof Constructor)) {
  11225. throw new TypeError("Cannot call a class as a function");
  11226. }
  11227. }
  11228. function _possibleConstructorReturn(self2, call) {
  11229. if (!self2) {
  11230. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  11231. }
  11232. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  11233. }
  11234. function _inherits(subClass, superClass) {
  11235. if (typeof superClass !== "function" && superClass !== null) {
  11236. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  11237. }
  11238. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
  11239. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  11240. }
  11241. var TOOLBAR_CONFIG = [["bold", "italic", "link"], [{ header: 1 }, { header: 2 }, "blockquote"]];
  11242. var BubbleTheme = (function(_BaseTheme) {
  11243. _inherits(BubbleTheme2, _BaseTheme);
  11244. function BubbleTheme2(quill, options) {
  11245. _classCallCheck(this, BubbleTheme2);
  11246. if (options.modules.toolbar != null && options.modules.toolbar.container == null) {
  11247. options.modules.toolbar.container = TOOLBAR_CONFIG;
  11248. }
  11249. var _this = _possibleConstructorReturn(this, (BubbleTheme2.__proto__ || Object.getPrototypeOf(BubbleTheme2)).call(this, quill, options));
  11250. _this.quill.container.classList.add("ql-bubble");
  11251. return _this;
  11252. }
  11253. _createClass(BubbleTheme2, [{
  11254. key: "extendToolbar",
  11255. value: function extendToolbar(toolbar) {
  11256. this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);
  11257. this.tooltip.root.appendChild(toolbar.container);
  11258. this.buildButtons([].slice.call(toolbar.container.querySelectorAll("button")), _icons2.default);
  11259. this.buildPickers([].slice.call(toolbar.container.querySelectorAll("select")), _icons2.default);
  11260. }
  11261. }]);
  11262. return BubbleTheme2;
  11263. })(_base2.default);
  11264. BubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {
  11265. modules: {
  11266. toolbar: {
  11267. handlers: {
  11268. link: function link(value) {
  11269. if (!value) {
  11270. this.quill.format("link", false);
  11271. } else {
  11272. this.quill.theme.tooltip.edit();
  11273. }
  11274. }
  11275. }
  11276. }
  11277. }
  11278. });
  11279. var BubbleTooltip = (function(_BaseTooltip) {
  11280. _inherits(BubbleTooltip2, _BaseTooltip);
  11281. function BubbleTooltip2(quill, bounds) {
  11282. _classCallCheck(this, BubbleTooltip2);
  11283. var _this2 = _possibleConstructorReturn(this, (BubbleTooltip2.__proto__ || Object.getPrototypeOf(BubbleTooltip2)).call(this, quill, bounds));
  11284. _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function(type, range, oldRange, source) {
  11285. if (type !== _emitter2.default.events.SELECTION_CHANGE) return;
  11286. if (range != null && range.length > 0 && source === _emitter2.default.sources.USER) {
  11287. _this2.show();
  11288. _this2.root.style.left = "0px";
  11289. _this2.root.style.width = "";
  11290. _this2.root.style.width = _this2.root.offsetWidth + "px";
  11291. var lines = _this2.quill.getLines(range.index, range.length);
  11292. if (lines.length === 1) {
  11293. _this2.position(_this2.quill.getBounds(range));
  11294. } else {
  11295. var lastLine = lines[lines.length - 1];
  11296. var index = _this2.quill.getIndex(lastLine);
  11297. var length = Math.min(lastLine.length() - 1, range.index + range.length - index);
  11298. var _bounds = _this2.quill.getBounds(new _selection.Range(index, length));
  11299. _this2.position(_bounds);
  11300. }
  11301. } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) {
  11302. _this2.hide();
  11303. }
  11304. });
  11305. return _this2;
  11306. }
  11307. _createClass(BubbleTooltip2, [{
  11308. key: "listen",
  11309. value: function listen() {
  11310. var _this3 = this;
  11311. _get(BubbleTooltip2.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip2.prototype), "listen", this).call(this);
  11312. this.root.querySelector(".ql-close").addEventListener("click", function() {
  11313. _this3.root.classList.remove("ql-editing");
  11314. });
  11315. this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function() {
  11316. setTimeout(function() {
  11317. if (_this3.root.classList.contains("ql-hidden")) return;
  11318. var range = _this3.quill.getSelection();
  11319. if (range != null) {
  11320. _this3.position(_this3.quill.getBounds(range));
  11321. }
  11322. }, 1);
  11323. });
  11324. }
  11325. }, {
  11326. key: "cancel",
  11327. value: function cancel() {
  11328. this.show();
  11329. }
  11330. }, {
  11331. key: "position",
  11332. value: function position(reference) {
  11333. var shift = _get(BubbleTooltip2.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip2.prototype), "position", this).call(this, reference);
  11334. var arrow = this.root.querySelector(".ql-tooltip-arrow");
  11335. arrow.style.marginLeft = "";
  11336. if (shift === 0) return shift;
  11337. arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + "px";
  11338. }
  11339. }]);
  11340. return BubbleTooltip2;
  11341. })(_base.BaseTooltip);
  11342. BubbleTooltip.TEMPLATE = ['<span class="ql-tooltip-arrow"></span>', '<div class="ql-tooltip-editor">', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-close"></a>', "</div>"].join("");
  11343. exports2.BubbleTooltip = BubbleTooltip;
  11344. exports2.default = BubbleTheme;
  11345. }),
  11346. /* 109 */
  11347. /***/
  11348. (function(module2, exports2, __webpack_require__) {
  11349. module2.exports = __webpack_require__(63);
  11350. })
  11351. /******/
  11352. ])["default"]
  11353. );
  11354. });
  11355. }
  11356. });
  11357. // node_modules/fast-diff/diff.js
  11358. var require_diff = __commonJS({
  11359. "node_modules/fast-diff/diff.js"(exports, module) {
  11360. var DIFF_DELETE = -1;
  11361. var DIFF_INSERT = 1;
  11362. var DIFF_EQUAL = 0;
  11363. function diff_main(text1, text2, cursor_pos, _fix_unicode) {
  11364. if (text1 === text2) {
  11365. if (text1) {
  11366. return [[DIFF_EQUAL, text1]];
  11367. }
  11368. return [];
  11369. }
  11370. if (cursor_pos != null) {
  11371. var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);
  11372. if (editdiff) {
  11373. return editdiff;
  11374. }
  11375. }
  11376. var commonlength = diff_commonPrefix(text1, text2);
  11377. var commonprefix = text1.substring(0, commonlength);
  11378. text1 = text1.substring(commonlength);
  11379. text2 = text2.substring(commonlength);
  11380. commonlength = diff_commonSuffix(text1, text2);
  11381. var commonsuffix = text1.substring(text1.length - commonlength);
  11382. text1 = text1.substring(0, text1.length - commonlength);
  11383. text2 = text2.substring(0, text2.length - commonlength);
  11384. var diffs = diff_compute_(text1, text2);
  11385. if (commonprefix) {
  11386. diffs.unshift([DIFF_EQUAL, commonprefix]);
  11387. }
  11388. if (commonsuffix) {
  11389. diffs.push([DIFF_EQUAL, commonsuffix]);
  11390. }
  11391. diff_cleanupMerge(diffs, _fix_unicode);
  11392. return diffs;
  11393. }
  11394. function diff_compute_(text1, text2) {
  11395. var diffs;
  11396. if (!text1) {
  11397. return [[DIFF_INSERT, text2]];
  11398. }
  11399. if (!text2) {
  11400. return [[DIFF_DELETE, text1]];
  11401. }
  11402. var longtext = text1.length > text2.length ? text1 : text2;
  11403. var shorttext = text1.length > text2.length ? text2 : text1;
  11404. var i = longtext.indexOf(shorttext);
  11405. if (i !== -1) {
  11406. diffs = [
  11407. [DIFF_INSERT, longtext.substring(0, i)],
  11408. [DIFF_EQUAL, shorttext],
  11409. [DIFF_INSERT, longtext.substring(i + shorttext.length)]
  11410. ];
  11411. if (text1.length > text2.length) {
  11412. diffs[0][0] = diffs[2][0] = DIFF_DELETE;
  11413. }
  11414. return diffs;
  11415. }
  11416. if (shorttext.length === 1) {
  11417. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
  11418. }
  11419. var hm = diff_halfMatch_(text1, text2);
  11420. if (hm) {
  11421. var text1_a = hm[0];
  11422. var text1_b = hm[1];
  11423. var text2_a = hm[2];
  11424. var text2_b = hm[3];
  11425. var mid_common = hm[4];
  11426. var diffs_a = diff_main(text1_a, text2_a);
  11427. var diffs_b = diff_main(text1_b, text2_b);
  11428. return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);
  11429. }
  11430. return diff_bisect_(text1, text2);
  11431. }
  11432. function diff_bisect_(text1, text2) {
  11433. var text1_length = text1.length;
  11434. var text2_length = text2.length;
  11435. var max_d = Math.ceil((text1_length + text2_length) / 2);
  11436. var v_offset = max_d;
  11437. var v_length = 2 * max_d;
  11438. var v1 = new Array(v_length);
  11439. var v2 = new Array(v_length);
  11440. for (var x = 0; x < v_length; x++) {
  11441. v1[x] = -1;
  11442. v2[x] = -1;
  11443. }
  11444. v1[v_offset + 1] = 0;
  11445. v2[v_offset + 1] = 0;
  11446. var delta = text1_length - text2_length;
  11447. var front = delta % 2 !== 0;
  11448. var k1start = 0;
  11449. var k1end = 0;
  11450. var k2start = 0;
  11451. var k2end = 0;
  11452. for (var d = 0; d < max_d; d++) {
  11453. for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
  11454. var k1_offset = v_offset + k1;
  11455. var x1;
  11456. if (k1 === -d || k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1]) {
  11457. x1 = v1[k1_offset + 1];
  11458. } else {
  11459. x1 = v1[k1_offset - 1] + 1;
  11460. }
  11461. var y1 = x1 - k1;
  11462. while (x1 < text1_length && y1 < text2_length && text1.charAt(x1) === text2.charAt(y1)) {
  11463. x1++;
  11464. y1++;
  11465. }
  11466. v1[k1_offset] = x1;
  11467. if (x1 > text1_length) {
  11468. k1end += 2;
  11469. } else if (y1 > text2_length) {
  11470. k1start += 2;
  11471. } else if (front) {
  11472. var k2_offset = v_offset + delta - k1;
  11473. if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {
  11474. var x2 = text1_length - v2[k2_offset];
  11475. if (x1 >= x2) {
  11476. return diff_bisectSplit_(text1, text2, x1, y1);
  11477. }
  11478. }
  11479. }
  11480. }
  11481. for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
  11482. var k2_offset = v_offset + k2;
  11483. var x2;
  11484. if (k2 === -d || k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1]) {
  11485. x2 = v2[k2_offset + 1];
  11486. } else {
  11487. x2 = v2[k2_offset - 1] + 1;
  11488. }
  11489. var y2 = x2 - k2;
  11490. while (x2 < text1_length && y2 < text2_length && text1.charAt(text1_length - x2 - 1) === text2.charAt(text2_length - y2 - 1)) {
  11491. x2++;
  11492. y2++;
  11493. }
  11494. v2[k2_offset] = x2;
  11495. if (x2 > text1_length) {
  11496. k2end += 2;
  11497. } else if (y2 > text2_length) {
  11498. k2start += 2;
  11499. } else if (!front) {
  11500. var k1_offset = v_offset + delta - k2;
  11501. if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) {
  11502. var x1 = v1[k1_offset];
  11503. var y1 = v_offset + x1 - k1_offset;
  11504. x2 = text1_length - x2;
  11505. if (x1 >= x2) {
  11506. return diff_bisectSplit_(text1, text2, x1, y1);
  11507. }
  11508. }
  11509. }
  11510. }
  11511. }
  11512. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
  11513. }
  11514. function diff_bisectSplit_(text1, text2, x, y) {
  11515. var text1a = text1.substring(0, x);
  11516. var text2a = text2.substring(0, y);
  11517. var text1b = text1.substring(x);
  11518. var text2b = text2.substring(y);
  11519. var diffs = diff_main(text1a, text2a);
  11520. var diffsb = diff_main(text1b, text2b);
  11521. return diffs.concat(diffsb);
  11522. }
  11523. function diff_commonPrefix(text1, text2) {
  11524. if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {
  11525. return 0;
  11526. }
  11527. var pointermin = 0;
  11528. var pointermax = Math.min(text1.length, text2.length);
  11529. var pointermid = pointermax;
  11530. var pointerstart = 0;
  11531. while (pointermin < pointermid) {
  11532. if (text1.substring(pointerstart, pointermid) == text2.substring(pointerstart, pointermid)) {
  11533. pointermin = pointermid;
  11534. pointerstart = pointermin;
  11535. } else {
  11536. pointermax = pointermid;
  11537. }
  11538. pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
  11539. }
  11540. if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {
  11541. pointermid--;
  11542. }
  11543. return pointermid;
  11544. }
  11545. function diff_commonSuffix(text1, text2) {
  11546. if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {
  11547. return 0;
  11548. }
  11549. var pointermin = 0;
  11550. var pointermax = Math.min(text1.length, text2.length);
  11551. var pointermid = pointermax;
  11552. var pointerend = 0;
  11553. while (pointermin < pointermid) {
  11554. if (text1.substring(text1.length - pointermid, text1.length - pointerend) == text2.substring(text2.length - pointermid, text2.length - pointerend)) {
  11555. pointermin = pointermid;
  11556. pointerend = pointermin;
  11557. } else {
  11558. pointermax = pointermid;
  11559. }
  11560. pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
  11561. }
  11562. if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {
  11563. pointermid--;
  11564. }
  11565. return pointermid;
  11566. }
  11567. function diff_halfMatch_(text1, text2) {
  11568. var longtext = text1.length > text2.length ? text1 : text2;
  11569. var shorttext = text1.length > text2.length ? text2 : text1;
  11570. if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
  11571. return null;
  11572. }
  11573. function diff_halfMatchI_(longtext2, shorttext2, i) {
  11574. var seed = longtext2.substring(i, i + Math.floor(longtext2.length / 4));
  11575. var j = -1;
  11576. var best_common = "";
  11577. var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
  11578. while ((j = shorttext2.indexOf(seed, j + 1)) !== -1) {
  11579. var prefixLength = diff_commonPrefix(
  11580. longtext2.substring(i),
  11581. shorttext2.substring(j)
  11582. );
  11583. var suffixLength = diff_commonSuffix(
  11584. longtext2.substring(0, i),
  11585. shorttext2.substring(0, j)
  11586. );
  11587. if (best_common.length < suffixLength + prefixLength) {
  11588. best_common = shorttext2.substring(
  11589. j - suffixLength,
  11590. j
  11591. ) + shorttext2.substring(j, j + prefixLength);
  11592. best_longtext_a = longtext2.substring(0, i - suffixLength);
  11593. best_longtext_b = longtext2.substring(i + prefixLength);
  11594. best_shorttext_a = shorttext2.substring(0, j - suffixLength);
  11595. best_shorttext_b = shorttext2.substring(j + prefixLength);
  11596. }
  11597. }
  11598. if (best_common.length * 2 >= longtext2.length) {
  11599. return [
  11600. best_longtext_a,
  11601. best_longtext_b,
  11602. best_shorttext_a,
  11603. best_shorttext_b,
  11604. best_common
  11605. ];
  11606. } else {
  11607. return null;
  11608. }
  11609. }
  11610. var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4));
  11611. var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));
  11612. var hm;
  11613. if (!hm1 && !hm2) {
  11614. return null;
  11615. } else if (!hm2) {
  11616. hm = hm1;
  11617. } else if (!hm1) {
  11618. hm = hm2;
  11619. } else {
  11620. hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
  11621. }
  11622. var text1_a, text1_b, text2_a, text2_b;
  11623. if (text1.length > text2.length) {
  11624. text1_a = hm[0];
  11625. text1_b = hm[1];
  11626. text2_a = hm[2];
  11627. text2_b = hm[3];
  11628. } else {
  11629. text2_a = hm[0];
  11630. text2_b = hm[1];
  11631. text1_a = hm[2];
  11632. text1_b = hm[3];
  11633. }
  11634. var mid_common = hm[4];
  11635. return [text1_a, text1_b, text2_a, text2_b, mid_common];
  11636. }
  11637. function diff_cleanupMerge(diffs, fix_unicode) {
  11638. diffs.push([DIFF_EQUAL, ""]);
  11639. var pointer = 0;
  11640. var count_delete = 0;
  11641. var count_insert = 0;
  11642. var text_delete = "";
  11643. var text_insert = "";
  11644. var commonlength;
  11645. while (pointer < diffs.length) {
  11646. if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
  11647. diffs.splice(pointer, 1);
  11648. continue;
  11649. }
  11650. switch (diffs[pointer][0]) {
  11651. case DIFF_INSERT:
  11652. count_insert++;
  11653. text_insert += diffs[pointer][1];
  11654. pointer++;
  11655. break;
  11656. case DIFF_DELETE:
  11657. count_delete++;
  11658. text_delete += diffs[pointer][1];
  11659. pointer++;
  11660. break;
  11661. case DIFF_EQUAL:
  11662. var previous_equality = pointer - count_insert - count_delete - 1;
  11663. if (fix_unicode) {
  11664. if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) {
  11665. var stray = diffs[previous_equality][1].slice(-1);
  11666. diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1);
  11667. text_delete = stray + text_delete;
  11668. text_insert = stray + text_insert;
  11669. if (!diffs[previous_equality][1]) {
  11670. diffs.splice(previous_equality, 1);
  11671. pointer--;
  11672. var k = previous_equality - 1;
  11673. if (diffs[k] && diffs[k][0] === DIFF_INSERT) {
  11674. count_insert++;
  11675. text_insert = diffs[k][1] + text_insert;
  11676. k--;
  11677. }
  11678. if (diffs[k] && diffs[k][0] === DIFF_DELETE) {
  11679. count_delete++;
  11680. text_delete = diffs[k][1] + text_delete;
  11681. k--;
  11682. }
  11683. previous_equality = k;
  11684. }
  11685. }
  11686. if (starts_with_pair_end(diffs[pointer][1])) {
  11687. var stray = diffs[pointer][1].charAt(0);
  11688. diffs[pointer][1] = diffs[pointer][1].slice(1);
  11689. text_delete += stray;
  11690. text_insert += stray;
  11691. }
  11692. }
  11693. if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
  11694. diffs.splice(pointer, 1);
  11695. break;
  11696. }
  11697. if (text_delete.length > 0 || text_insert.length > 0) {
  11698. if (text_delete.length > 0 && text_insert.length > 0) {
  11699. commonlength = diff_commonPrefix(text_insert, text_delete);
  11700. if (commonlength !== 0) {
  11701. if (previous_equality >= 0) {
  11702. diffs[previous_equality][1] += text_insert.substring(0, commonlength);
  11703. } else {
  11704. diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]);
  11705. pointer++;
  11706. }
  11707. text_insert = text_insert.substring(commonlength);
  11708. text_delete = text_delete.substring(commonlength);
  11709. }
  11710. commonlength = diff_commonSuffix(text_insert, text_delete);
  11711. if (commonlength !== 0) {
  11712. diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
  11713. text_insert = text_insert.substring(0, text_insert.length - commonlength);
  11714. text_delete = text_delete.substring(0, text_delete.length - commonlength);
  11715. }
  11716. }
  11717. var n = count_insert + count_delete;
  11718. if (text_delete.length === 0 && text_insert.length === 0) {
  11719. diffs.splice(pointer - n, n);
  11720. pointer = pointer - n;
  11721. } else if (text_delete.length === 0) {
  11722. diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);
  11723. pointer = pointer - n + 1;
  11724. } else if (text_insert.length === 0) {
  11725. diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);
  11726. pointer = pointer - n + 1;
  11727. } else {
  11728. diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);
  11729. pointer = pointer - n + 2;
  11730. }
  11731. }
  11732. if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {
  11733. diffs[pointer - 1][1] += diffs[pointer][1];
  11734. diffs.splice(pointer, 1);
  11735. } else {
  11736. pointer++;
  11737. }
  11738. count_insert = 0;
  11739. count_delete = 0;
  11740. text_delete = "";
  11741. text_insert = "";
  11742. break;
  11743. }
  11744. }
  11745. if (diffs[diffs.length - 1][1] === "") {
  11746. diffs.pop();
  11747. }
  11748. var changes = false;
  11749. pointer = 1;
  11750. while (pointer < diffs.length - 1) {
  11751. if (diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL) {
  11752. if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {
  11753. diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length);
  11754. diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
  11755. diffs.splice(pointer - 1, 1);
  11756. changes = true;
  11757. } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == diffs[pointer + 1][1]) {
  11758. diffs[pointer - 1][1] += diffs[pointer + 1][1];
  11759. diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1];
  11760. diffs.splice(pointer + 1, 1);
  11761. changes = true;
  11762. }
  11763. }
  11764. pointer++;
  11765. }
  11766. if (changes) {
  11767. diff_cleanupMerge(diffs, fix_unicode);
  11768. }
  11769. }
  11770. function is_surrogate_pair_start(charCode) {
  11771. return charCode >= 55296 && charCode <= 56319;
  11772. }
  11773. function is_surrogate_pair_end(charCode) {
  11774. return charCode >= 56320 && charCode <= 57343;
  11775. }
  11776. function starts_with_pair_end(str) {
  11777. return is_surrogate_pair_end(str.charCodeAt(0));
  11778. }
  11779. function ends_with_pair_start(str) {
  11780. return is_surrogate_pair_start(str.charCodeAt(str.length - 1));
  11781. }
  11782. function remove_empty_tuples(tuples) {
  11783. var ret = [];
  11784. for (var i = 0; i < tuples.length; i++) {
  11785. if (tuples[i][1].length > 0) {
  11786. ret.push(tuples[i]);
  11787. }
  11788. }
  11789. return ret;
  11790. }
  11791. function make_edit_splice(before, oldMiddle, newMiddle, after) {
  11792. if (ends_with_pair_start(before) || starts_with_pair_end(after)) {
  11793. return null;
  11794. }
  11795. return remove_empty_tuples([
  11796. [DIFF_EQUAL, before],
  11797. [DIFF_DELETE, oldMiddle],
  11798. [DIFF_INSERT, newMiddle],
  11799. [DIFF_EQUAL, after]
  11800. ]);
  11801. }
  11802. function find_cursor_edit_diff(oldText, newText, cursor_pos) {
  11803. var oldRange = typeof cursor_pos === "number" ? { index: cursor_pos, length: 0 } : cursor_pos.oldRange;
  11804. var newRange = typeof cursor_pos === "number" ? null : cursor_pos.newRange;
  11805. var oldLength = oldText.length;
  11806. var newLength = newText.length;
  11807. if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {
  11808. var oldCursor = oldRange.index;
  11809. var oldBefore = oldText.slice(0, oldCursor);
  11810. var oldAfter = oldText.slice(oldCursor);
  11811. var maybeNewCursor = newRange ? newRange.index : null;
  11812. editBefore: {
  11813. var newCursor = oldCursor + newLength - oldLength;
  11814. if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {
  11815. break editBefore;
  11816. }
  11817. if (newCursor < 0 || newCursor > newLength) {
  11818. break editBefore;
  11819. }
  11820. var newBefore = newText.slice(0, newCursor);
  11821. var newAfter = newText.slice(newCursor);
  11822. if (newAfter !== oldAfter) {
  11823. break editBefore;
  11824. }
  11825. var prefixLength = Math.min(oldCursor, newCursor);
  11826. var oldPrefix = oldBefore.slice(0, prefixLength);
  11827. var newPrefix = newBefore.slice(0, prefixLength);
  11828. if (oldPrefix !== newPrefix) {
  11829. break editBefore;
  11830. }
  11831. var oldMiddle = oldBefore.slice(prefixLength);
  11832. var newMiddle = newBefore.slice(prefixLength);
  11833. return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);
  11834. }
  11835. editAfter: {
  11836. if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {
  11837. break editAfter;
  11838. }
  11839. var cursor = oldCursor;
  11840. var newBefore = newText.slice(0, cursor);
  11841. var newAfter = newText.slice(cursor);
  11842. if (newBefore !== oldBefore) {
  11843. break editAfter;
  11844. }
  11845. var suffixLength = Math.min(oldLength - cursor, newLength - cursor);
  11846. var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);
  11847. var newSuffix = newAfter.slice(newAfter.length - suffixLength);
  11848. if (oldSuffix !== newSuffix) {
  11849. break editAfter;
  11850. }
  11851. var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);
  11852. var newMiddle = newAfter.slice(0, newAfter.length - suffixLength);
  11853. return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix);
  11854. }
  11855. }
  11856. if (oldRange.length > 0 && newRange && newRange.length === 0) {
  11857. replaceRange: {
  11858. var oldPrefix = oldText.slice(0, oldRange.index);
  11859. var oldSuffix = oldText.slice(oldRange.index + oldRange.length);
  11860. var prefixLength = oldPrefix.length;
  11861. var suffixLength = oldSuffix.length;
  11862. if (newLength < prefixLength + suffixLength) {
  11863. break replaceRange;
  11864. }
  11865. var newPrefix = newText.slice(0, prefixLength);
  11866. var newSuffix = newText.slice(newLength - suffixLength);
  11867. if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) {
  11868. break replaceRange;
  11869. }
  11870. var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength);
  11871. var newMiddle = newText.slice(prefixLength, newLength - suffixLength);
  11872. return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix);
  11873. }
  11874. }
  11875. return null;
  11876. }
  11877. function diff(text1, text2, cursor_pos) {
  11878. return diff_main(text1, text2, cursor_pos, true);
  11879. }
  11880. diff.INSERT = DIFF_INSERT;
  11881. diff.DELETE = DIFF_DELETE;
  11882. diff.EQUAL = DIFF_EQUAL;
  11883. module.exports = diff;
  11884. }
  11885. });
  11886. // node_modules/lodash.clonedeep/index.js
  11887. var require_lodash = __commonJS({
  11888. "node_modules/lodash.clonedeep/index.js"(exports, module) {
  11889. var LARGE_ARRAY_SIZE = 200;
  11890. var HASH_UNDEFINED = "__lodash_hash_undefined__";
  11891. var MAX_SAFE_INTEGER = 9007199254740991;
  11892. var argsTag = "[object Arguments]";
  11893. var arrayTag = "[object Array]";
  11894. var boolTag = "[object Boolean]";
  11895. var dateTag = "[object Date]";
  11896. var errorTag = "[object Error]";
  11897. var funcTag = "[object Function]";
  11898. var genTag = "[object GeneratorFunction]";
  11899. var mapTag = "[object Map]";
  11900. var numberTag = "[object Number]";
  11901. var objectTag = "[object Object]";
  11902. var promiseTag = "[object Promise]";
  11903. var regexpTag = "[object RegExp]";
  11904. var setTag = "[object Set]";
  11905. var stringTag = "[object String]";
  11906. var symbolTag = "[object Symbol]";
  11907. var weakMapTag = "[object WeakMap]";
  11908. var arrayBufferTag = "[object ArrayBuffer]";
  11909. var dataViewTag = "[object DataView]";
  11910. var float32Tag = "[object Float32Array]";
  11911. var float64Tag = "[object Float64Array]";
  11912. var int8Tag = "[object Int8Array]";
  11913. var int16Tag = "[object Int16Array]";
  11914. var int32Tag = "[object Int32Array]";
  11915. var uint8Tag = "[object Uint8Array]";
  11916. var uint8ClampedTag = "[object Uint8ClampedArray]";
  11917. var uint16Tag = "[object Uint16Array]";
  11918. var uint32Tag = "[object Uint32Array]";
  11919. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  11920. var reFlags = /\w*$/;
  11921. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  11922. var reIsUint = /^(?:0|[1-9]\d*)$/;
  11923. var cloneableTags = {};
  11924. cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  11925. cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
  11926. var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
  11927. var freeSelf = typeof self == "object" && self && self.Object === Object && self;
  11928. var root = freeGlobal || freeSelf || Function("return this")();
  11929. var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
  11930. var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
  11931. var moduleExports = freeModule && freeModule.exports === freeExports;
  11932. function addMapEntry(map, pair) {
  11933. map.set(pair[0], pair[1]);
  11934. return map;
  11935. }
  11936. function addSetEntry(set, value) {
  11937. set.add(value);
  11938. return set;
  11939. }
  11940. function arrayEach(array, iteratee) {
  11941. var index = -1, length = array ? array.length : 0;
  11942. while (++index < length) {
  11943. if (iteratee(array[index], index, array) === false) {
  11944. break;
  11945. }
  11946. }
  11947. return array;
  11948. }
  11949. function arrayPush(array, values) {
  11950. var index = -1, length = values.length, offset = array.length;
  11951. while (++index < length) {
  11952. array[offset + index] = values[index];
  11953. }
  11954. return array;
  11955. }
  11956. function arrayReduce(array, iteratee, accumulator, initAccum) {
  11957. var index = -1, length = array ? array.length : 0;
  11958. if (initAccum && length) {
  11959. accumulator = array[++index];
  11960. }
  11961. while (++index < length) {
  11962. accumulator = iteratee(accumulator, array[index], index, array);
  11963. }
  11964. return accumulator;
  11965. }
  11966. function baseTimes(n, iteratee) {
  11967. var index = -1, result = Array(n);
  11968. while (++index < n) {
  11969. result[index] = iteratee(index);
  11970. }
  11971. return result;
  11972. }
  11973. function getValue(object, key) {
  11974. return object == null ? void 0 : object[key];
  11975. }
  11976. function isHostObject(value) {
  11977. var result = false;
  11978. if (value != null && typeof value.toString != "function") {
  11979. try {
  11980. result = !!(value + "");
  11981. } catch (e) {
  11982. }
  11983. }
  11984. return result;
  11985. }
  11986. function mapToArray(map) {
  11987. var index = -1, result = Array(map.size);
  11988. map.forEach(function(value, key) {
  11989. result[++index] = [key, value];
  11990. });
  11991. return result;
  11992. }
  11993. function overArg(func, transform) {
  11994. return function(arg) {
  11995. return func(transform(arg));
  11996. };
  11997. }
  11998. function setToArray(set) {
  11999. var index = -1, result = Array(set.size);
  12000. set.forEach(function(value) {
  12001. result[++index] = value;
  12002. });
  12003. return result;
  12004. }
  12005. var arrayProto = Array.prototype;
  12006. var funcProto = Function.prototype;
  12007. var objectProto = Object.prototype;
  12008. var coreJsData = root["__core-js_shared__"];
  12009. var maskSrcKey = (function() {
  12010. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
  12011. return uid ? "Symbol(src)_1." + uid : "";
  12012. })();
  12013. var funcToString = funcProto.toString;
  12014. var hasOwnProperty = objectProto.hasOwnProperty;
  12015. var objectToString = objectProto.toString;
  12016. var reIsNative = RegExp(
  12017. "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
  12018. );
  12019. var Buffer2 = moduleExports ? root.Buffer : void 0;
  12020. var Symbol2 = root.Symbol;
  12021. var Uint8Array = root.Uint8Array;
  12022. var getPrototype = overArg(Object.getPrototypeOf, Object);
  12023. var objectCreate = Object.create;
  12024. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  12025. var splice = arrayProto.splice;
  12026. var nativeGetSymbols = Object.getOwnPropertySymbols;
  12027. var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
  12028. var nativeKeys = overArg(Object.keys, Object);
  12029. var DataView = getNative(root, "DataView");
  12030. var Map2 = getNative(root, "Map");
  12031. var Promise2 = getNative(root, "Promise");
  12032. var Set2 = getNative(root, "Set");
  12033. var WeakMap = getNative(root, "WeakMap");
  12034. var nativeCreate = getNative(Object, "create");
  12035. var dataViewCtorString = toSource(DataView);
  12036. var mapCtorString = toSource(Map2);
  12037. var promiseCtorString = toSource(Promise2);
  12038. var setCtorString = toSource(Set2);
  12039. var weakMapCtorString = toSource(WeakMap);
  12040. var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
  12041. var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
  12042. function Hash(entries) {
  12043. var index = -1, length = entries ? entries.length : 0;
  12044. this.clear();
  12045. while (++index < length) {
  12046. var entry = entries[index];
  12047. this.set(entry[0], entry[1]);
  12048. }
  12049. }
  12050. function hashClear() {
  12051. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  12052. }
  12053. function hashDelete(key) {
  12054. return this.has(key) && delete this.__data__[key];
  12055. }
  12056. function hashGet(key) {
  12057. var data = this.__data__;
  12058. if (nativeCreate) {
  12059. var result = data[key];
  12060. return result === HASH_UNDEFINED ? void 0 : result;
  12061. }
  12062. return hasOwnProperty.call(data, key) ? data[key] : void 0;
  12063. }
  12064. function hashHas(key) {
  12065. var data = this.__data__;
  12066. return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
  12067. }
  12068. function hashSet(key, value) {
  12069. var data = this.__data__;
  12070. data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
  12071. return this;
  12072. }
  12073. Hash.prototype.clear = hashClear;
  12074. Hash.prototype["delete"] = hashDelete;
  12075. Hash.prototype.get = hashGet;
  12076. Hash.prototype.has = hashHas;
  12077. Hash.prototype.set = hashSet;
  12078. function ListCache(entries) {
  12079. var index = -1, length = entries ? entries.length : 0;
  12080. this.clear();
  12081. while (++index < length) {
  12082. var entry = entries[index];
  12083. this.set(entry[0], entry[1]);
  12084. }
  12085. }
  12086. function listCacheClear() {
  12087. this.__data__ = [];
  12088. }
  12089. function listCacheDelete(key) {
  12090. var data = this.__data__, index = assocIndexOf(data, key);
  12091. if (index < 0) {
  12092. return false;
  12093. }
  12094. var lastIndex = data.length - 1;
  12095. if (index == lastIndex) {
  12096. data.pop();
  12097. } else {
  12098. splice.call(data, index, 1);
  12099. }
  12100. return true;
  12101. }
  12102. function listCacheGet(key) {
  12103. var data = this.__data__, index = assocIndexOf(data, key);
  12104. return index < 0 ? void 0 : data[index][1];
  12105. }
  12106. function listCacheHas(key) {
  12107. return assocIndexOf(this.__data__, key) > -1;
  12108. }
  12109. function listCacheSet(key, value) {
  12110. var data = this.__data__, index = assocIndexOf(data, key);
  12111. if (index < 0) {
  12112. data.push([key, value]);
  12113. } else {
  12114. data[index][1] = value;
  12115. }
  12116. return this;
  12117. }
  12118. ListCache.prototype.clear = listCacheClear;
  12119. ListCache.prototype["delete"] = listCacheDelete;
  12120. ListCache.prototype.get = listCacheGet;
  12121. ListCache.prototype.has = listCacheHas;
  12122. ListCache.prototype.set = listCacheSet;
  12123. function MapCache(entries) {
  12124. var index = -1, length = entries ? entries.length : 0;
  12125. this.clear();
  12126. while (++index < length) {
  12127. var entry = entries[index];
  12128. this.set(entry[0], entry[1]);
  12129. }
  12130. }
  12131. function mapCacheClear() {
  12132. this.__data__ = {
  12133. "hash": new Hash(),
  12134. "map": new (Map2 || ListCache)(),
  12135. "string": new Hash()
  12136. };
  12137. }
  12138. function mapCacheDelete(key) {
  12139. return getMapData(this, key)["delete"](key);
  12140. }
  12141. function mapCacheGet(key) {
  12142. return getMapData(this, key).get(key);
  12143. }
  12144. function mapCacheHas(key) {
  12145. return getMapData(this, key).has(key);
  12146. }
  12147. function mapCacheSet(key, value) {
  12148. getMapData(this, key).set(key, value);
  12149. return this;
  12150. }
  12151. MapCache.prototype.clear = mapCacheClear;
  12152. MapCache.prototype["delete"] = mapCacheDelete;
  12153. MapCache.prototype.get = mapCacheGet;
  12154. MapCache.prototype.has = mapCacheHas;
  12155. MapCache.prototype.set = mapCacheSet;
  12156. function Stack(entries) {
  12157. this.__data__ = new ListCache(entries);
  12158. }
  12159. function stackClear() {
  12160. this.__data__ = new ListCache();
  12161. }
  12162. function stackDelete(key) {
  12163. return this.__data__["delete"](key);
  12164. }
  12165. function stackGet(key) {
  12166. return this.__data__.get(key);
  12167. }
  12168. function stackHas(key) {
  12169. return this.__data__.has(key);
  12170. }
  12171. function stackSet(key, value) {
  12172. var cache = this.__data__;
  12173. if (cache instanceof ListCache) {
  12174. var pairs = cache.__data__;
  12175. if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
  12176. pairs.push([key, value]);
  12177. return this;
  12178. }
  12179. cache = this.__data__ = new MapCache(pairs);
  12180. }
  12181. cache.set(key, value);
  12182. return this;
  12183. }
  12184. Stack.prototype.clear = stackClear;
  12185. Stack.prototype["delete"] = stackDelete;
  12186. Stack.prototype.get = stackGet;
  12187. Stack.prototype.has = stackHas;
  12188. Stack.prototype.set = stackSet;
  12189. function arrayLikeKeys(value, inherited) {
  12190. var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
  12191. var length = result.length, skipIndexes = !!length;
  12192. for (var key in value) {
  12193. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) {
  12194. result.push(key);
  12195. }
  12196. }
  12197. return result;
  12198. }
  12199. function assignValue(object, key, value) {
  12200. var objValue = object[key];
  12201. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
  12202. object[key] = value;
  12203. }
  12204. }
  12205. function assocIndexOf(array, key) {
  12206. var length = array.length;
  12207. while (length--) {
  12208. if (eq(array[length][0], key)) {
  12209. return length;
  12210. }
  12211. }
  12212. return -1;
  12213. }
  12214. function baseAssign(object, source) {
  12215. return object && copyObject(source, keys(source), object);
  12216. }
  12217. function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
  12218. var result;
  12219. if (customizer) {
  12220. result = object ? customizer(value, key, object, stack) : customizer(value);
  12221. }
  12222. if (result !== void 0) {
  12223. return result;
  12224. }
  12225. if (!isObject(value)) {
  12226. return value;
  12227. }
  12228. var isArr = isArray(value);
  12229. if (isArr) {
  12230. result = initCloneArray(value);
  12231. if (!isDeep) {
  12232. return copyArray(value, result);
  12233. }
  12234. } else {
  12235. var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
  12236. if (isBuffer(value)) {
  12237. return cloneBuffer(value, isDeep);
  12238. }
  12239. if (tag == objectTag || tag == argsTag || isFunc && !object) {
  12240. if (isHostObject(value)) {
  12241. return object ? value : {};
  12242. }
  12243. result = initCloneObject(isFunc ? {} : value);
  12244. if (!isDeep) {
  12245. return copySymbols(value, baseAssign(result, value));
  12246. }
  12247. } else {
  12248. if (!cloneableTags[tag]) {
  12249. return object ? value : {};
  12250. }
  12251. result = initCloneByTag(value, tag, baseClone, isDeep);
  12252. }
  12253. }
  12254. stack || (stack = new Stack());
  12255. var stacked = stack.get(value);
  12256. if (stacked) {
  12257. return stacked;
  12258. }
  12259. stack.set(value, result);
  12260. if (!isArr) {
  12261. var props = isFull ? getAllKeys(value) : keys(value);
  12262. }
  12263. arrayEach(props || value, function(subValue, key2) {
  12264. if (props) {
  12265. key2 = subValue;
  12266. subValue = value[key2];
  12267. }
  12268. assignValue(result, key2, baseClone(subValue, isDeep, isFull, customizer, key2, value, stack));
  12269. });
  12270. return result;
  12271. }
  12272. function baseCreate(proto) {
  12273. return isObject(proto) ? objectCreate(proto) : {};
  12274. }
  12275. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  12276. var result = keysFunc(object);
  12277. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  12278. }
  12279. function baseGetTag(value) {
  12280. return objectToString.call(value);
  12281. }
  12282. function baseIsNative(value) {
  12283. if (!isObject(value) || isMasked(value)) {
  12284. return false;
  12285. }
  12286. var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
  12287. return pattern.test(toSource(value));
  12288. }
  12289. function baseKeys(object) {
  12290. if (!isPrototype(object)) {
  12291. return nativeKeys(object);
  12292. }
  12293. var result = [];
  12294. for (var key in Object(object)) {
  12295. if (hasOwnProperty.call(object, key) && key != "constructor") {
  12296. result.push(key);
  12297. }
  12298. }
  12299. return result;
  12300. }
  12301. function cloneBuffer(buffer, isDeep) {
  12302. if (isDeep) {
  12303. return buffer.slice();
  12304. }
  12305. var result = new buffer.constructor(buffer.length);
  12306. buffer.copy(result);
  12307. return result;
  12308. }
  12309. function cloneArrayBuffer(arrayBuffer) {
  12310. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  12311. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  12312. return result;
  12313. }
  12314. function cloneDataView(dataView, isDeep) {
  12315. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  12316. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  12317. }
  12318. function cloneMap(map, isDeep, cloneFunc) {
  12319. var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
  12320. return arrayReduce(array, addMapEntry, new map.constructor());
  12321. }
  12322. function cloneRegExp(regexp) {
  12323. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  12324. result.lastIndex = regexp.lastIndex;
  12325. return result;
  12326. }
  12327. function cloneSet(set, isDeep, cloneFunc) {
  12328. var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
  12329. return arrayReduce(array, addSetEntry, new set.constructor());
  12330. }
  12331. function cloneSymbol(symbol) {
  12332. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  12333. }
  12334. function cloneTypedArray(typedArray, isDeep) {
  12335. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  12336. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  12337. }
  12338. function copyArray(source, array) {
  12339. var index = -1, length = source.length;
  12340. array || (array = Array(length));
  12341. while (++index < length) {
  12342. array[index] = source[index];
  12343. }
  12344. return array;
  12345. }
  12346. function copyObject(source, props, object, customizer) {
  12347. object || (object = {});
  12348. var index = -1, length = props.length;
  12349. while (++index < length) {
  12350. var key = props[index];
  12351. var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
  12352. assignValue(object, key, newValue === void 0 ? source[key] : newValue);
  12353. }
  12354. return object;
  12355. }
  12356. function copySymbols(source, object) {
  12357. return copyObject(source, getSymbols(source), object);
  12358. }
  12359. function getAllKeys(object) {
  12360. return baseGetAllKeys(object, keys, getSymbols);
  12361. }
  12362. function getMapData(map, key) {
  12363. var data = map.__data__;
  12364. return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
  12365. }
  12366. function getNative(object, key) {
  12367. var value = getValue(object, key);
  12368. return baseIsNative(value) ? value : void 0;
  12369. }
  12370. var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
  12371. var getTag = baseGetTag;
  12372. if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
  12373. getTag = function(value) {
  12374. var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0;
  12375. if (ctorString) {
  12376. switch (ctorString) {
  12377. case dataViewCtorString:
  12378. return dataViewTag;
  12379. case mapCtorString:
  12380. return mapTag;
  12381. case promiseCtorString:
  12382. return promiseTag;
  12383. case setCtorString:
  12384. return setTag;
  12385. case weakMapCtorString:
  12386. return weakMapTag;
  12387. }
  12388. }
  12389. return result;
  12390. };
  12391. }
  12392. function initCloneArray(array) {
  12393. var length = array.length, result = array.constructor(length);
  12394. if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
  12395. result.index = array.index;
  12396. result.input = array.input;
  12397. }
  12398. return result;
  12399. }
  12400. function initCloneObject(object) {
  12401. return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
  12402. }
  12403. function initCloneByTag(object, tag, cloneFunc, isDeep) {
  12404. var Ctor = object.constructor;
  12405. switch (tag) {
  12406. case arrayBufferTag:
  12407. return cloneArrayBuffer(object);
  12408. case boolTag:
  12409. case dateTag:
  12410. return new Ctor(+object);
  12411. case dataViewTag:
  12412. return cloneDataView(object, isDeep);
  12413. case float32Tag:
  12414. case float64Tag:
  12415. case int8Tag:
  12416. case int16Tag:
  12417. case int32Tag:
  12418. case uint8Tag:
  12419. case uint8ClampedTag:
  12420. case uint16Tag:
  12421. case uint32Tag:
  12422. return cloneTypedArray(object, isDeep);
  12423. case mapTag:
  12424. return cloneMap(object, isDeep, cloneFunc);
  12425. case numberTag:
  12426. case stringTag:
  12427. return new Ctor(object);
  12428. case regexpTag:
  12429. return cloneRegExp(object);
  12430. case setTag:
  12431. return cloneSet(object, isDeep, cloneFunc);
  12432. case symbolTag:
  12433. return cloneSymbol(object);
  12434. }
  12435. }
  12436. function isIndex(value, length) {
  12437. length = length == null ? MAX_SAFE_INTEGER : length;
  12438. return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
  12439. }
  12440. function isKeyable(value) {
  12441. var type = typeof value;
  12442. return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
  12443. }
  12444. function isMasked(func) {
  12445. return !!maskSrcKey && maskSrcKey in func;
  12446. }
  12447. function isPrototype(value) {
  12448. var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
  12449. return value === proto;
  12450. }
  12451. function toSource(func) {
  12452. if (func != null) {
  12453. try {
  12454. return funcToString.call(func);
  12455. } catch (e) {
  12456. }
  12457. try {
  12458. return func + "";
  12459. } catch (e) {
  12460. }
  12461. }
  12462. return "";
  12463. }
  12464. function cloneDeep(value) {
  12465. return baseClone(value, true, true);
  12466. }
  12467. function eq(value, other) {
  12468. return value === other || value !== value && other !== other;
  12469. }
  12470. function isArguments(value) {
  12471. return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
  12472. }
  12473. var isArray = Array.isArray;
  12474. function isArrayLike(value) {
  12475. return value != null && isLength(value.length) && !isFunction(value);
  12476. }
  12477. function isArrayLikeObject(value) {
  12478. return isObjectLike(value) && isArrayLike(value);
  12479. }
  12480. var isBuffer = nativeIsBuffer || stubFalse;
  12481. function isFunction(value) {
  12482. var tag = isObject(value) ? objectToString.call(value) : "";
  12483. return tag == funcTag || tag == genTag;
  12484. }
  12485. function isLength(value) {
  12486. return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12487. }
  12488. function isObject(value) {
  12489. var type = typeof value;
  12490. return !!value && (type == "object" || type == "function");
  12491. }
  12492. function isObjectLike(value) {
  12493. return !!value && typeof value == "object";
  12494. }
  12495. function keys(object) {
  12496. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  12497. }
  12498. function stubArray() {
  12499. return [];
  12500. }
  12501. function stubFalse() {
  12502. return false;
  12503. }
  12504. module.exports = cloneDeep;
  12505. }
  12506. });
  12507. // node_modules/lodash.isequal/index.js
  12508. var require_lodash2 = __commonJS({
  12509. "node_modules/lodash.isequal/index.js"(exports, module) {
  12510. var LARGE_ARRAY_SIZE = 200;
  12511. var HASH_UNDEFINED = "__lodash_hash_undefined__";
  12512. var COMPARE_PARTIAL_FLAG = 1;
  12513. var COMPARE_UNORDERED_FLAG = 2;
  12514. var MAX_SAFE_INTEGER = 9007199254740991;
  12515. var argsTag = "[object Arguments]";
  12516. var arrayTag = "[object Array]";
  12517. var asyncTag = "[object AsyncFunction]";
  12518. var boolTag = "[object Boolean]";
  12519. var dateTag = "[object Date]";
  12520. var errorTag = "[object Error]";
  12521. var funcTag = "[object Function]";
  12522. var genTag = "[object GeneratorFunction]";
  12523. var mapTag = "[object Map]";
  12524. var numberTag = "[object Number]";
  12525. var nullTag = "[object Null]";
  12526. var objectTag = "[object Object]";
  12527. var promiseTag = "[object Promise]";
  12528. var proxyTag = "[object Proxy]";
  12529. var regexpTag = "[object RegExp]";
  12530. var setTag = "[object Set]";
  12531. var stringTag = "[object String]";
  12532. var symbolTag = "[object Symbol]";
  12533. var undefinedTag = "[object Undefined]";
  12534. var weakMapTag = "[object WeakMap]";
  12535. var arrayBufferTag = "[object ArrayBuffer]";
  12536. var dataViewTag = "[object DataView]";
  12537. var float32Tag = "[object Float32Array]";
  12538. var float64Tag = "[object Float64Array]";
  12539. var int8Tag = "[object Int8Array]";
  12540. var int16Tag = "[object Int16Array]";
  12541. var int32Tag = "[object Int32Array]";
  12542. var uint8Tag = "[object Uint8Array]";
  12543. var uint8ClampedTag = "[object Uint8ClampedArray]";
  12544. var uint16Tag = "[object Uint16Array]";
  12545. var uint32Tag = "[object Uint32Array]";
  12546. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  12547. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  12548. var reIsUint = /^(?:0|[1-9]\d*)$/;
  12549. var typedArrayTags = {};
  12550. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
  12551. typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
  12552. var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
  12553. var freeSelf = typeof self == "object" && self && self.Object === Object && self;
  12554. var root = freeGlobal || freeSelf || Function("return this")();
  12555. var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
  12556. var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
  12557. var moduleExports = freeModule && freeModule.exports === freeExports;
  12558. var freeProcess = moduleExports && freeGlobal.process;
  12559. var nodeUtil = (function() {
  12560. try {
  12561. return freeProcess && freeProcess.binding && freeProcess.binding("util");
  12562. } catch (e) {
  12563. }
  12564. })();
  12565. var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  12566. function arrayFilter(array, predicate) {
  12567. var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
  12568. while (++index < length) {
  12569. var value = array[index];
  12570. if (predicate(value, index, array)) {
  12571. result[resIndex++] = value;
  12572. }
  12573. }
  12574. return result;
  12575. }
  12576. function arrayPush(array, values) {
  12577. var index = -1, length = values.length, offset = array.length;
  12578. while (++index < length) {
  12579. array[offset + index] = values[index];
  12580. }
  12581. return array;
  12582. }
  12583. function arraySome(array, predicate) {
  12584. var index = -1, length = array == null ? 0 : array.length;
  12585. while (++index < length) {
  12586. if (predicate(array[index], index, array)) {
  12587. return true;
  12588. }
  12589. }
  12590. return false;
  12591. }
  12592. function baseTimes(n, iteratee) {
  12593. var index = -1, result = Array(n);
  12594. while (++index < n) {
  12595. result[index] = iteratee(index);
  12596. }
  12597. return result;
  12598. }
  12599. function baseUnary(func) {
  12600. return function(value) {
  12601. return func(value);
  12602. };
  12603. }
  12604. function cacheHas(cache, key) {
  12605. return cache.has(key);
  12606. }
  12607. function getValue(object, key) {
  12608. return object == null ? void 0 : object[key];
  12609. }
  12610. function mapToArray(map) {
  12611. var index = -1, result = Array(map.size);
  12612. map.forEach(function(value, key) {
  12613. result[++index] = [key, value];
  12614. });
  12615. return result;
  12616. }
  12617. function overArg(func, transform) {
  12618. return function(arg) {
  12619. return func(transform(arg));
  12620. };
  12621. }
  12622. function setToArray(set) {
  12623. var index = -1, result = Array(set.size);
  12624. set.forEach(function(value) {
  12625. result[++index] = value;
  12626. });
  12627. return result;
  12628. }
  12629. var arrayProto = Array.prototype;
  12630. var funcProto = Function.prototype;
  12631. var objectProto = Object.prototype;
  12632. var coreJsData = root["__core-js_shared__"];
  12633. var funcToString = funcProto.toString;
  12634. var hasOwnProperty = objectProto.hasOwnProperty;
  12635. var maskSrcKey = (function() {
  12636. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
  12637. return uid ? "Symbol(src)_1." + uid : "";
  12638. })();
  12639. var nativeObjectToString = objectProto.toString;
  12640. var reIsNative = RegExp(
  12641. "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
  12642. );
  12643. var Buffer2 = moduleExports ? root.Buffer : void 0;
  12644. var Symbol2 = root.Symbol;
  12645. var Uint8Array = root.Uint8Array;
  12646. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  12647. var splice = arrayProto.splice;
  12648. var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
  12649. var nativeGetSymbols = Object.getOwnPropertySymbols;
  12650. var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
  12651. var nativeKeys = overArg(Object.keys, Object);
  12652. var DataView = getNative(root, "DataView");
  12653. var Map2 = getNative(root, "Map");
  12654. var Promise2 = getNative(root, "Promise");
  12655. var Set2 = getNative(root, "Set");
  12656. var WeakMap = getNative(root, "WeakMap");
  12657. var nativeCreate = getNative(Object, "create");
  12658. var dataViewCtorString = toSource(DataView);
  12659. var mapCtorString = toSource(Map2);
  12660. var promiseCtorString = toSource(Promise2);
  12661. var setCtorString = toSource(Set2);
  12662. var weakMapCtorString = toSource(WeakMap);
  12663. var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
  12664. var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
  12665. function Hash(entries) {
  12666. var index = -1, length = entries == null ? 0 : entries.length;
  12667. this.clear();
  12668. while (++index < length) {
  12669. var entry = entries[index];
  12670. this.set(entry[0], entry[1]);
  12671. }
  12672. }
  12673. function hashClear() {
  12674. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  12675. this.size = 0;
  12676. }
  12677. function hashDelete(key) {
  12678. var result = this.has(key) && delete this.__data__[key];
  12679. this.size -= result ? 1 : 0;
  12680. return result;
  12681. }
  12682. function hashGet(key) {
  12683. var data = this.__data__;
  12684. if (nativeCreate) {
  12685. var result = data[key];
  12686. return result === HASH_UNDEFINED ? void 0 : result;
  12687. }
  12688. return hasOwnProperty.call(data, key) ? data[key] : void 0;
  12689. }
  12690. function hashHas(key) {
  12691. var data = this.__data__;
  12692. return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
  12693. }
  12694. function hashSet(key, value) {
  12695. var data = this.__data__;
  12696. this.size += this.has(key) ? 0 : 1;
  12697. data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
  12698. return this;
  12699. }
  12700. Hash.prototype.clear = hashClear;
  12701. Hash.prototype["delete"] = hashDelete;
  12702. Hash.prototype.get = hashGet;
  12703. Hash.prototype.has = hashHas;
  12704. Hash.prototype.set = hashSet;
  12705. function ListCache(entries) {
  12706. var index = -1, length = entries == null ? 0 : entries.length;
  12707. this.clear();
  12708. while (++index < length) {
  12709. var entry = entries[index];
  12710. this.set(entry[0], entry[1]);
  12711. }
  12712. }
  12713. function listCacheClear() {
  12714. this.__data__ = [];
  12715. this.size = 0;
  12716. }
  12717. function listCacheDelete(key) {
  12718. var data = this.__data__, index = assocIndexOf(data, key);
  12719. if (index < 0) {
  12720. return false;
  12721. }
  12722. var lastIndex = data.length - 1;
  12723. if (index == lastIndex) {
  12724. data.pop();
  12725. } else {
  12726. splice.call(data, index, 1);
  12727. }
  12728. --this.size;
  12729. return true;
  12730. }
  12731. function listCacheGet(key) {
  12732. var data = this.__data__, index = assocIndexOf(data, key);
  12733. return index < 0 ? void 0 : data[index][1];
  12734. }
  12735. function listCacheHas(key) {
  12736. return assocIndexOf(this.__data__, key) > -1;
  12737. }
  12738. function listCacheSet(key, value) {
  12739. var data = this.__data__, index = assocIndexOf(data, key);
  12740. if (index < 0) {
  12741. ++this.size;
  12742. data.push([key, value]);
  12743. } else {
  12744. data[index][1] = value;
  12745. }
  12746. return this;
  12747. }
  12748. ListCache.prototype.clear = listCacheClear;
  12749. ListCache.prototype["delete"] = listCacheDelete;
  12750. ListCache.prototype.get = listCacheGet;
  12751. ListCache.prototype.has = listCacheHas;
  12752. ListCache.prototype.set = listCacheSet;
  12753. function MapCache(entries) {
  12754. var index = -1, length = entries == null ? 0 : entries.length;
  12755. this.clear();
  12756. while (++index < length) {
  12757. var entry = entries[index];
  12758. this.set(entry[0], entry[1]);
  12759. }
  12760. }
  12761. function mapCacheClear() {
  12762. this.size = 0;
  12763. this.__data__ = {
  12764. "hash": new Hash(),
  12765. "map": new (Map2 || ListCache)(),
  12766. "string": new Hash()
  12767. };
  12768. }
  12769. function mapCacheDelete(key) {
  12770. var result = getMapData(this, key)["delete"](key);
  12771. this.size -= result ? 1 : 0;
  12772. return result;
  12773. }
  12774. function mapCacheGet(key) {
  12775. return getMapData(this, key).get(key);
  12776. }
  12777. function mapCacheHas(key) {
  12778. return getMapData(this, key).has(key);
  12779. }
  12780. function mapCacheSet(key, value) {
  12781. var data = getMapData(this, key), size = data.size;
  12782. data.set(key, value);
  12783. this.size += data.size == size ? 0 : 1;
  12784. return this;
  12785. }
  12786. MapCache.prototype.clear = mapCacheClear;
  12787. MapCache.prototype["delete"] = mapCacheDelete;
  12788. MapCache.prototype.get = mapCacheGet;
  12789. MapCache.prototype.has = mapCacheHas;
  12790. MapCache.prototype.set = mapCacheSet;
  12791. function SetCache(values) {
  12792. var index = -1, length = values == null ? 0 : values.length;
  12793. this.__data__ = new MapCache();
  12794. while (++index < length) {
  12795. this.add(values[index]);
  12796. }
  12797. }
  12798. function setCacheAdd(value) {
  12799. this.__data__.set(value, HASH_UNDEFINED);
  12800. return this;
  12801. }
  12802. function setCacheHas(value) {
  12803. return this.__data__.has(value);
  12804. }
  12805. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  12806. SetCache.prototype.has = setCacheHas;
  12807. function Stack(entries) {
  12808. var data = this.__data__ = new ListCache(entries);
  12809. this.size = data.size;
  12810. }
  12811. function stackClear() {
  12812. this.__data__ = new ListCache();
  12813. this.size = 0;
  12814. }
  12815. function stackDelete(key) {
  12816. var data = this.__data__, result = data["delete"](key);
  12817. this.size = data.size;
  12818. return result;
  12819. }
  12820. function stackGet(key) {
  12821. return this.__data__.get(key);
  12822. }
  12823. function stackHas(key) {
  12824. return this.__data__.has(key);
  12825. }
  12826. function stackSet(key, value) {
  12827. var data = this.__data__;
  12828. if (data instanceof ListCache) {
  12829. var pairs = data.__data__;
  12830. if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
  12831. pairs.push([key, value]);
  12832. this.size = ++data.size;
  12833. return this;
  12834. }
  12835. data = this.__data__ = new MapCache(pairs);
  12836. }
  12837. data.set(key, value);
  12838. this.size = data.size;
  12839. return this;
  12840. }
  12841. Stack.prototype.clear = stackClear;
  12842. Stack.prototype["delete"] = stackDelete;
  12843. Stack.prototype.get = stackGet;
  12844. Stack.prototype.has = stackHas;
  12845. Stack.prototype.set = stackSet;
  12846. function arrayLikeKeys(value, inherited) {
  12847. var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
  12848. for (var key in value) {
  12849. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
  12850. (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
  12851. isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
  12852. isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
  12853. isIndex(key, length)))) {
  12854. result.push(key);
  12855. }
  12856. }
  12857. return result;
  12858. }
  12859. function assocIndexOf(array, key) {
  12860. var length = array.length;
  12861. while (length--) {
  12862. if (eq(array[length][0], key)) {
  12863. return length;
  12864. }
  12865. }
  12866. return -1;
  12867. }
  12868. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  12869. var result = keysFunc(object);
  12870. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  12871. }
  12872. function baseGetTag(value) {
  12873. if (value == null) {
  12874. return value === void 0 ? undefinedTag : nullTag;
  12875. }
  12876. return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
  12877. }
  12878. function baseIsArguments(value) {
  12879. return isObjectLike(value) && baseGetTag(value) == argsTag;
  12880. }
  12881. function baseIsEqual(value, other, bitmask, customizer, stack) {
  12882. if (value === other) {
  12883. return true;
  12884. }
  12885. if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
  12886. return value !== value && other !== other;
  12887. }
  12888. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  12889. }
  12890. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  12891. var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
  12892. objTag = objTag == argsTag ? objectTag : objTag;
  12893. othTag = othTag == argsTag ? objectTag : othTag;
  12894. var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
  12895. if (isSameTag && isBuffer(object)) {
  12896. if (!isBuffer(other)) {
  12897. return false;
  12898. }
  12899. objIsArr = true;
  12900. objIsObj = false;
  12901. }
  12902. if (isSameTag && !objIsObj) {
  12903. stack || (stack = new Stack());
  12904. return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  12905. }
  12906. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  12907. var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
  12908. if (objIsWrapped || othIsWrapped) {
  12909. var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
  12910. stack || (stack = new Stack());
  12911. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  12912. }
  12913. }
  12914. if (!isSameTag) {
  12915. return false;
  12916. }
  12917. stack || (stack = new Stack());
  12918. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  12919. }
  12920. function baseIsNative(value) {
  12921. if (!isObject(value) || isMasked(value)) {
  12922. return false;
  12923. }
  12924. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  12925. return pattern.test(toSource(value));
  12926. }
  12927. function baseIsTypedArray(value) {
  12928. return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  12929. }
  12930. function baseKeys(object) {
  12931. if (!isPrototype(object)) {
  12932. return nativeKeys(object);
  12933. }
  12934. var result = [];
  12935. for (var key in Object(object)) {
  12936. if (hasOwnProperty.call(object, key) && key != "constructor") {
  12937. result.push(key);
  12938. }
  12939. }
  12940. return result;
  12941. }
  12942. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  12943. var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
  12944. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  12945. return false;
  12946. }
  12947. var stacked = stack.get(array);
  12948. if (stacked && stack.get(other)) {
  12949. return stacked == other;
  12950. }
  12951. var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
  12952. stack.set(array, other);
  12953. stack.set(other, array);
  12954. while (++index < arrLength) {
  12955. var arrValue = array[index], othValue = other[index];
  12956. if (customizer) {
  12957. var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
  12958. }
  12959. if (compared !== void 0) {
  12960. if (compared) {
  12961. continue;
  12962. }
  12963. result = false;
  12964. break;
  12965. }
  12966. if (seen) {
  12967. if (!arraySome(other, function(othValue2, othIndex) {
  12968. if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
  12969. return seen.push(othIndex);
  12970. }
  12971. })) {
  12972. result = false;
  12973. break;
  12974. }
  12975. } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  12976. result = false;
  12977. break;
  12978. }
  12979. }
  12980. stack["delete"](array);
  12981. stack["delete"](other);
  12982. return result;
  12983. }
  12984. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  12985. switch (tag) {
  12986. case dataViewTag:
  12987. if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
  12988. return false;
  12989. }
  12990. object = object.buffer;
  12991. other = other.buffer;
  12992. case arrayBufferTag:
  12993. if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  12994. return false;
  12995. }
  12996. return true;
  12997. case boolTag:
  12998. case dateTag:
  12999. case numberTag:
  13000. return eq(+object, +other);
  13001. case errorTag:
  13002. return object.name == other.name && object.message == other.message;
  13003. case regexpTag:
  13004. case stringTag:
  13005. return object == other + "";
  13006. case mapTag:
  13007. var convert = mapToArray;
  13008. case setTag:
  13009. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  13010. convert || (convert = setToArray);
  13011. if (object.size != other.size && !isPartial) {
  13012. return false;
  13013. }
  13014. var stacked = stack.get(object);
  13015. if (stacked) {
  13016. return stacked == other;
  13017. }
  13018. bitmask |= COMPARE_UNORDERED_FLAG;
  13019. stack.set(object, other);
  13020. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  13021. stack["delete"](object);
  13022. return result;
  13023. case symbolTag:
  13024. if (symbolValueOf) {
  13025. return symbolValueOf.call(object) == symbolValueOf.call(other);
  13026. }
  13027. }
  13028. return false;
  13029. }
  13030. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  13031. var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
  13032. if (objLength != othLength && !isPartial) {
  13033. return false;
  13034. }
  13035. var index = objLength;
  13036. while (index--) {
  13037. var key = objProps[index];
  13038. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  13039. return false;
  13040. }
  13041. }
  13042. var stacked = stack.get(object);
  13043. if (stacked && stack.get(other)) {
  13044. return stacked == other;
  13045. }
  13046. var result = true;
  13047. stack.set(object, other);
  13048. stack.set(other, object);
  13049. var skipCtor = isPartial;
  13050. while (++index < objLength) {
  13051. key = objProps[index];
  13052. var objValue = object[key], othValue = other[key];
  13053. if (customizer) {
  13054. var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
  13055. }
  13056. if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
  13057. result = false;
  13058. break;
  13059. }
  13060. skipCtor || (skipCtor = key == "constructor");
  13061. }
  13062. if (result && !skipCtor) {
  13063. var objCtor = object.constructor, othCtor = other.constructor;
  13064. if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
  13065. result = false;
  13066. }
  13067. }
  13068. stack["delete"](object);
  13069. stack["delete"](other);
  13070. return result;
  13071. }
  13072. function getAllKeys(object) {
  13073. return baseGetAllKeys(object, keys, getSymbols);
  13074. }
  13075. function getMapData(map, key) {
  13076. var data = map.__data__;
  13077. return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
  13078. }
  13079. function getNative(object, key) {
  13080. var value = getValue(object, key);
  13081. return baseIsNative(value) ? value : void 0;
  13082. }
  13083. function getRawTag(value) {
  13084. var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
  13085. try {
  13086. value[symToStringTag] = void 0;
  13087. var unmasked = true;
  13088. } catch (e) {
  13089. }
  13090. var result = nativeObjectToString.call(value);
  13091. if (unmasked) {
  13092. if (isOwn) {
  13093. value[symToStringTag] = tag;
  13094. } else {
  13095. delete value[symToStringTag];
  13096. }
  13097. }
  13098. return result;
  13099. }
  13100. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  13101. if (object == null) {
  13102. return [];
  13103. }
  13104. object = Object(object);
  13105. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  13106. return propertyIsEnumerable.call(object, symbol);
  13107. });
  13108. };
  13109. var getTag = baseGetTag;
  13110. if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
  13111. getTag = function(value) {
  13112. var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
  13113. if (ctorString) {
  13114. switch (ctorString) {
  13115. case dataViewCtorString:
  13116. return dataViewTag;
  13117. case mapCtorString:
  13118. return mapTag;
  13119. case promiseCtorString:
  13120. return promiseTag;
  13121. case setCtorString:
  13122. return setTag;
  13123. case weakMapCtorString:
  13124. return weakMapTag;
  13125. }
  13126. }
  13127. return result;
  13128. };
  13129. }
  13130. function isIndex(value, length) {
  13131. length = length == null ? MAX_SAFE_INTEGER : length;
  13132. return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
  13133. }
  13134. function isKeyable(value) {
  13135. var type = typeof value;
  13136. return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
  13137. }
  13138. function isMasked(func) {
  13139. return !!maskSrcKey && maskSrcKey in func;
  13140. }
  13141. function isPrototype(value) {
  13142. var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
  13143. return value === proto;
  13144. }
  13145. function objectToString(value) {
  13146. return nativeObjectToString.call(value);
  13147. }
  13148. function toSource(func) {
  13149. if (func != null) {
  13150. try {
  13151. return funcToString.call(func);
  13152. } catch (e) {
  13153. }
  13154. try {
  13155. return func + "";
  13156. } catch (e) {
  13157. }
  13158. }
  13159. return "";
  13160. }
  13161. function eq(value, other) {
  13162. return value === other || value !== value && other !== other;
  13163. }
  13164. var isArguments = baseIsArguments(/* @__PURE__ */ (function() {
  13165. return arguments;
  13166. })()) ? baseIsArguments : function(value) {
  13167. return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
  13168. };
  13169. var isArray = Array.isArray;
  13170. function isArrayLike(value) {
  13171. return value != null && isLength(value.length) && !isFunction(value);
  13172. }
  13173. var isBuffer = nativeIsBuffer || stubFalse;
  13174. function isEqual(value, other) {
  13175. return baseIsEqual(value, other);
  13176. }
  13177. function isFunction(value) {
  13178. if (!isObject(value)) {
  13179. return false;
  13180. }
  13181. var tag = baseGetTag(value);
  13182. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  13183. }
  13184. function isLength(value) {
  13185. return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  13186. }
  13187. function isObject(value) {
  13188. var type = typeof value;
  13189. return value != null && (type == "object" || type == "function");
  13190. }
  13191. function isObjectLike(value) {
  13192. return value != null && typeof value == "object";
  13193. }
  13194. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  13195. function keys(object) {
  13196. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13197. }
  13198. function stubArray() {
  13199. return [];
  13200. }
  13201. function stubFalse() {
  13202. return false;
  13203. }
  13204. module.exports = isEqual;
  13205. }
  13206. });
  13207. // node_modules/quill-delta/dist/AttributeMap.js
  13208. var require_AttributeMap = __commonJS({
  13209. "node_modules/quill-delta/dist/AttributeMap.js"(exports) {
  13210. "use strict";
  13211. var __importDefault = exports && exports.__importDefault || function(mod) {
  13212. return mod && mod.__esModule ? mod : { "default": mod };
  13213. };
  13214. Object.defineProperty(exports, "__esModule", { value: true });
  13215. var lodash_clonedeep_1 = __importDefault(require_lodash());
  13216. var lodash_isequal_1 = __importDefault(require_lodash2());
  13217. var AttributeMap;
  13218. (function(AttributeMap2) {
  13219. function compose(a, b, keepNull) {
  13220. if (a === void 0) {
  13221. a = {};
  13222. }
  13223. if (b === void 0) {
  13224. b = {};
  13225. }
  13226. if (typeof a !== "object") {
  13227. a = {};
  13228. }
  13229. if (typeof b !== "object") {
  13230. b = {};
  13231. }
  13232. var attributes = lodash_clonedeep_1.default(b);
  13233. if (!keepNull) {
  13234. attributes = Object.keys(attributes).reduce(function(copy, key2) {
  13235. if (attributes[key2] != null) {
  13236. copy[key2] = attributes[key2];
  13237. }
  13238. return copy;
  13239. }, {});
  13240. }
  13241. for (var key in a) {
  13242. if (a[key] !== void 0 && b[key] === void 0) {
  13243. attributes[key] = a[key];
  13244. }
  13245. }
  13246. return Object.keys(attributes).length > 0 ? attributes : void 0;
  13247. }
  13248. AttributeMap2.compose = compose;
  13249. function diff(a, b) {
  13250. if (a === void 0) {
  13251. a = {};
  13252. }
  13253. if (b === void 0) {
  13254. b = {};
  13255. }
  13256. if (typeof a !== "object") {
  13257. a = {};
  13258. }
  13259. if (typeof b !== "object") {
  13260. b = {};
  13261. }
  13262. var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function(attrs, key) {
  13263. if (!lodash_isequal_1.default(a[key], b[key])) {
  13264. attrs[key] = b[key] === void 0 ? null : b[key];
  13265. }
  13266. return attrs;
  13267. }, {});
  13268. return Object.keys(attributes).length > 0 ? attributes : void 0;
  13269. }
  13270. AttributeMap2.diff = diff;
  13271. function invert(attr, base) {
  13272. if (attr === void 0) {
  13273. attr = {};
  13274. }
  13275. if (base === void 0) {
  13276. base = {};
  13277. }
  13278. attr = attr || {};
  13279. var baseInverted = Object.keys(base).reduce(function(memo, key) {
  13280. if (base[key] !== attr[key] && attr[key] !== void 0) {
  13281. memo[key] = base[key];
  13282. }
  13283. return memo;
  13284. }, {});
  13285. return Object.keys(attr).reduce(function(memo, key) {
  13286. if (attr[key] !== base[key] && base[key] === void 0) {
  13287. memo[key] = null;
  13288. }
  13289. return memo;
  13290. }, baseInverted);
  13291. }
  13292. AttributeMap2.invert = invert;
  13293. function transform(a, b, priority) {
  13294. if (priority === void 0) {
  13295. priority = false;
  13296. }
  13297. if (typeof a !== "object") {
  13298. return b;
  13299. }
  13300. if (typeof b !== "object") {
  13301. return void 0;
  13302. }
  13303. if (!priority) {
  13304. return b;
  13305. }
  13306. var attributes = Object.keys(b).reduce(function(attrs, key) {
  13307. if (a[key] === void 0) {
  13308. attrs[key] = b[key];
  13309. }
  13310. return attrs;
  13311. }, {});
  13312. return Object.keys(attributes).length > 0 ? attributes : void 0;
  13313. }
  13314. AttributeMap2.transform = transform;
  13315. })(AttributeMap || (AttributeMap = {}));
  13316. exports.default = AttributeMap;
  13317. }
  13318. });
  13319. // node_modules/quill-delta/dist/Iterator.js
  13320. var require_Iterator = __commonJS({
  13321. "node_modules/quill-delta/dist/Iterator.js"(exports) {
  13322. "use strict";
  13323. var __importDefault = exports && exports.__importDefault || function(mod) {
  13324. return mod && mod.__esModule ? mod : { "default": mod };
  13325. };
  13326. Object.defineProperty(exports, "__esModule", { value: true });
  13327. var Op_1 = __importDefault(require_Op());
  13328. var Iterator = (
  13329. /** @class */
  13330. (function() {
  13331. function Iterator2(ops) {
  13332. this.ops = ops;
  13333. this.index = 0;
  13334. this.offset = 0;
  13335. }
  13336. Iterator2.prototype.hasNext = function() {
  13337. return this.peekLength() < Infinity;
  13338. };
  13339. Iterator2.prototype.next = function(length) {
  13340. if (!length) {
  13341. length = Infinity;
  13342. }
  13343. var nextOp = this.ops[this.index];
  13344. if (nextOp) {
  13345. var offset = this.offset;
  13346. var opLength = Op_1.default.length(nextOp);
  13347. if (length >= opLength - offset) {
  13348. length = opLength - offset;
  13349. this.index += 1;
  13350. this.offset = 0;
  13351. } else {
  13352. this.offset += length;
  13353. }
  13354. if (typeof nextOp.delete === "number") {
  13355. return { delete: length };
  13356. } else {
  13357. var retOp = {};
  13358. if (nextOp.attributes) {
  13359. retOp.attributes = nextOp.attributes;
  13360. }
  13361. if (typeof nextOp.retain === "number") {
  13362. retOp.retain = length;
  13363. } else if (typeof nextOp.insert === "string") {
  13364. retOp.insert = nextOp.insert.substr(offset, length);
  13365. } else {
  13366. retOp.insert = nextOp.insert;
  13367. }
  13368. return retOp;
  13369. }
  13370. } else {
  13371. return { retain: Infinity };
  13372. }
  13373. };
  13374. Iterator2.prototype.peek = function() {
  13375. return this.ops[this.index];
  13376. };
  13377. Iterator2.prototype.peekLength = function() {
  13378. if (this.ops[this.index]) {
  13379. return Op_1.default.length(this.ops[this.index]) - this.offset;
  13380. } else {
  13381. return Infinity;
  13382. }
  13383. };
  13384. Iterator2.prototype.peekType = function() {
  13385. if (this.ops[this.index]) {
  13386. if (typeof this.ops[this.index].delete === "number") {
  13387. return "delete";
  13388. } else if (typeof this.ops[this.index].retain === "number") {
  13389. return "retain";
  13390. } else {
  13391. return "insert";
  13392. }
  13393. }
  13394. return "retain";
  13395. };
  13396. Iterator2.prototype.rest = function() {
  13397. if (!this.hasNext()) {
  13398. return [];
  13399. } else if (this.offset === 0) {
  13400. return this.ops.slice(this.index);
  13401. } else {
  13402. var offset = this.offset;
  13403. var index = this.index;
  13404. var next = this.next();
  13405. var rest = this.ops.slice(this.index);
  13406. this.offset = offset;
  13407. this.index = index;
  13408. return [next].concat(rest);
  13409. }
  13410. };
  13411. return Iterator2;
  13412. })()
  13413. );
  13414. exports.default = Iterator;
  13415. }
  13416. });
  13417. // node_modules/quill-delta/dist/Op.js
  13418. var require_Op = __commonJS({
  13419. "node_modules/quill-delta/dist/Op.js"(exports) {
  13420. "use strict";
  13421. var __importDefault = exports && exports.__importDefault || function(mod) {
  13422. return mod && mod.__esModule ? mod : { "default": mod };
  13423. };
  13424. Object.defineProperty(exports, "__esModule", { value: true });
  13425. var Iterator_1 = __importDefault(require_Iterator());
  13426. var Op;
  13427. (function(Op2) {
  13428. function iterator(ops) {
  13429. return new Iterator_1.default(ops);
  13430. }
  13431. Op2.iterator = iterator;
  13432. function length(op) {
  13433. if (typeof op.delete === "number") {
  13434. return op.delete;
  13435. } else if (typeof op.retain === "number") {
  13436. return op.retain;
  13437. } else {
  13438. return typeof op.insert === "string" ? op.insert.length : 1;
  13439. }
  13440. }
  13441. Op2.length = length;
  13442. })(Op || (Op = {}));
  13443. exports.default = Op;
  13444. }
  13445. });
  13446. // node_modules/quill-delta/dist/Delta.js
  13447. var require_Delta = __commonJS({
  13448. "node_modules/quill-delta/dist/Delta.js"(exports, module) {
  13449. "use strict";
  13450. var __importDefault = exports && exports.__importDefault || function(mod) {
  13451. return mod && mod.__esModule ? mod : { "default": mod };
  13452. };
  13453. var fast_diff_1 = __importDefault(require_diff());
  13454. var lodash_clonedeep_1 = __importDefault(require_lodash());
  13455. var lodash_isequal_1 = __importDefault(require_lodash2());
  13456. var AttributeMap_1 = __importDefault(require_AttributeMap());
  13457. var Op_1 = __importDefault(require_Op());
  13458. var NULL_CHARACTER = String.fromCharCode(0);
  13459. var Delta2 = (
  13460. /** @class */
  13461. (function() {
  13462. function Delta3(ops) {
  13463. if (Array.isArray(ops)) {
  13464. this.ops = ops;
  13465. } else if (ops != null && Array.isArray(ops.ops)) {
  13466. this.ops = ops.ops;
  13467. } else {
  13468. this.ops = [];
  13469. }
  13470. }
  13471. Delta3.prototype.insert = function(arg, attributes) {
  13472. var newOp = {};
  13473. if (typeof arg === "string" && arg.length === 0) {
  13474. return this;
  13475. }
  13476. newOp.insert = arg;
  13477. if (attributes != null && typeof attributes === "object" && Object.keys(attributes).length > 0) {
  13478. newOp.attributes = attributes;
  13479. }
  13480. return this.push(newOp);
  13481. };
  13482. Delta3.prototype.delete = function(length) {
  13483. if (length <= 0) {
  13484. return this;
  13485. }
  13486. return this.push({ delete: length });
  13487. };
  13488. Delta3.prototype.retain = function(length, attributes) {
  13489. if (length <= 0) {
  13490. return this;
  13491. }
  13492. var newOp = { retain: length };
  13493. if (attributes != null && typeof attributes === "object" && Object.keys(attributes).length > 0) {
  13494. newOp.attributes = attributes;
  13495. }
  13496. return this.push(newOp);
  13497. };
  13498. Delta3.prototype.push = function(newOp) {
  13499. var index = this.ops.length;
  13500. var lastOp = this.ops[index - 1];
  13501. newOp = lodash_clonedeep_1.default(newOp);
  13502. if (typeof lastOp === "object") {
  13503. if (typeof newOp.delete === "number" && typeof lastOp.delete === "number") {
  13504. this.ops[index - 1] = { delete: lastOp.delete + newOp.delete };
  13505. return this;
  13506. }
  13507. if (typeof lastOp.delete === "number" && newOp.insert != null) {
  13508. index -= 1;
  13509. lastOp = this.ops[index - 1];
  13510. if (typeof lastOp !== "object") {
  13511. this.ops.unshift(newOp);
  13512. return this;
  13513. }
  13514. }
  13515. if (lodash_isequal_1.default(newOp.attributes, lastOp.attributes)) {
  13516. if (typeof newOp.insert === "string" && typeof lastOp.insert === "string") {
  13517. this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };
  13518. if (typeof newOp.attributes === "object") {
  13519. this.ops[index - 1].attributes = newOp.attributes;
  13520. }
  13521. return this;
  13522. } else if (typeof newOp.retain === "number" && typeof lastOp.retain === "number") {
  13523. this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };
  13524. if (typeof newOp.attributes === "object") {
  13525. this.ops[index - 1].attributes = newOp.attributes;
  13526. }
  13527. return this;
  13528. }
  13529. }
  13530. }
  13531. if (index === this.ops.length) {
  13532. this.ops.push(newOp);
  13533. } else {
  13534. this.ops.splice(index, 0, newOp);
  13535. }
  13536. return this;
  13537. };
  13538. Delta3.prototype.chop = function() {
  13539. var lastOp = this.ops[this.ops.length - 1];
  13540. if (lastOp && lastOp.retain && !lastOp.attributes) {
  13541. this.ops.pop();
  13542. }
  13543. return this;
  13544. };
  13545. Delta3.prototype.filter = function(predicate) {
  13546. return this.ops.filter(predicate);
  13547. };
  13548. Delta3.prototype.forEach = function(predicate) {
  13549. this.ops.forEach(predicate);
  13550. };
  13551. Delta3.prototype.map = function(predicate) {
  13552. return this.ops.map(predicate);
  13553. };
  13554. Delta3.prototype.partition = function(predicate) {
  13555. var passed = [];
  13556. var failed = [];
  13557. this.forEach(function(op) {
  13558. var target = predicate(op) ? passed : failed;
  13559. target.push(op);
  13560. });
  13561. return [passed, failed];
  13562. };
  13563. Delta3.prototype.reduce = function(predicate, initialValue) {
  13564. return this.ops.reduce(predicate, initialValue);
  13565. };
  13566. Delta3.prototype.changeLength = function() {
  13567. return this.reduce(function(length, elem) {
  13568. if (elem.insert) {
  13569. return length + Op_1.default.length(elem);
  13570. } else if (elem.delete) {
  13571. return length - elem.delete;
  13572. }
  13573. return length;
  13574. }, 0);
  13575. };
  13576. Delta3.prototype.length = function() {
  13577. return this.reduce(function(length, elem) {
  13578. return length + Op_1.default.length(elem);
  13579. }, 0);
  13580. };
  13581. Delta3.prototype.slice = function(start, end) {
  13582. if (start === void 0) {
  13583. start = 0;
  13584. }
  13585. if (end === void 0) {
  13586. end = Infinity;
  13587. }
  13588. var ops = [];
  13589. var iter = Op_1.default.iterator(this.ops);
  13590. var index = 0;
  13591. while (index < end && iter.hasNext()) {
  13592. var nextOp = void 0;
  13593. if (index < start) {
  13594. nextOp = iter.next(start - index);
  13595. } else {
  13596. nextOp = iter.next(end - index);
  13597. ops.push(nextOp);
  13598. }
  13599. index += Op_1.default.length(nextOp);
  13600. }
  13601. return new Delta3(ops);
  13602. };
  13603. Delta3.prototype.compose = function(other) {
  13604. var thisIter = Op_1.default.iterator(this.ops);
  13605. var otherIter = Op_1.default.iterator(other.ops);
  13606. var ops = [];
  13607. var firstOther = otherIter.peek();
  13608. if (firstOther != null && typeof firstOther.retain === "number" && firstOther.attributes == null) {
  13609. var firstLeft = firstOther.retain;
  13610. while (thisIter.peekType() === "insert" && thisIter.peekLength() <= firstLeft) {
  13611. firstLeft -= thisIter.peekLength();
  13612. ops.push(thisIter.next());
  13613. }
  13614. if (firstOther.retain - firstLeft > 0) {
  13615. otherIter.next(firstOther.retain - firstLeft);
  13616. }
  13617. }
  13618. var delta = new Delta3(ops);
  13619. while (thisIter.hasNext() || otherIter.hasNext()) {
  13620. if (otherIter.peekType() === "insert") {
  13621. delta.push(otherIter.next());
  13622. } else if (thisIter.peekType() === "delete") {
  13623. delta.push(thisIter.next());
  13624. } else {
  13625. var length_1 = Math.min(thisIter.peekLength(), otherIter.peekLength());
  13626. var thisOp = thisIter.next(length_1);
  13627. var otherOp = otherIter.next(length_1);
  13628. if (typeof otherOp.retain === "number") {
  13629. var newOp = {};
  13630. if (typeof thisOp.retain === "number") {
  13631. newOp.retain = length_1;
  13632. } else {
  13633. newOp.insert = thisOp.insert;
  13634. }
  13635. var attributes = AttributeMap_1.default.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === "number");
  13636. if (attributes) {
  13637. newOp.attributes = attributes;
  13638. }
  13639. delta.push(newOp);
  13640. if (!otherIter.hasNext() && lodash_isequal_1.default(delta.ops[delta.ops.length - 1], newOp)) {
  13641. var rest = new Delta3(thisIter.rest());
  13642. return delta.concat(rest).chop();
  13643. }
  13644. } else if (typeof otherOp.delete === "number" && typeof thisOp.retain === "number") {
  13645. delta.push(otherOp);
  13646. }
  13647. }
  13648. }
  13649. return delta.chop();
  13650. };
  13651. Delta3.prototype.concat = function(other) {
  13652. var delta = new Delta3(this.ops.slice());
  13653. if (other.ops.length > 0) {
  13654. delta.push(other.ops[0]);
  13655. delta.ops = delta.ops.concat(other.ops.slice(1));
  13656. }
  13657. return delta;
  13658. };
  13659. Delta3.prototype.diff = function(other, cursor) {
  13660. if (this.ops === other.ops) {
  13661. return new Delta3();
  13662. }
  13663. var strings = [this, other].map(function(delta) {
  13664. return delta.map(function(op) {
  13665. if (op.insert != null) {
  13666. return typeof op.insert === "string" ? op.insert : NULL_CHARACTER;
  13667. }
  13668. var prep = delta === other ? "on" : "with";
  13669. throw new Error("diff() called " + prep + " non-document");
  13670. }).join("");
  13671. });
  13672. var retDelta = new Delta3();
  13673. var diffResult = fast_diff_1.default(strings[0], strings[1], cursor);
  13674. var thisIter = Op_1.default.iterator(this.ops);
  13675. var otherIter = Op_1.default.iterator(other.ops);
  13676. diffResult.forEach(function(component) {
  13677. var length = component[1].length;
  13678. while (length > 0) {
  13679. var opLength = 0;
  13680. switch (component[0]) {
  13681. case fast_diff_1.default.INSERT:
  13682. opLength = Math.min(otherIter.peekLength(), length);
  13683. retDelta.push(otherIter.next(opLength));
  13684. break;
  13685. case fast_diff_1.default.DELETE:
  13686. opLength = Math.min(length, thisIter.peekLength());
  13687. thisIter.next(opLength);
  13688. retDelta.delete(opLength);
  13689. break;
  13690. case fast_diff_1.default.EQUAL:
  13691. opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);
  13692. var thisOp = thisIter.next(opLength);
  13693. var otherOp = otherIter.next(opLength);
  13694. if (lodash_isequal_1.default(thisOp.insert, otherOp.insert)) {
  13695. retDelta.retain(opLength, AttributeMap_1.default.diff(thisOp.attributes, otherOp.attributes));
  13696. } else {
  13697. retDelta.push(otherOp).delete(opLength);
  13698. }
  13699. break;
  13700. }
  13701. length -= opLength;
  13702. }
  13703. });
  13704. return retDelta.chop();
  13705. };
  13706. Delta3.prototype.eachLine = function(predicate, newline) {
  13707. if (newline === void 0) {
  13708. newline = "\n";
  13709. }
  13710. var iter = Op_1.default.iterator(this.ops);
  13711. var line = new Delta3();
  13712. var i = 0;
  13713. while (iter.hasNext()) {
  13714. if (iter.peekType() !== "insert") {
  13715. return;
  13716. }
  13717. var thisOp = iter.peek();
  13718. var start = Op_1.default.length(thisOp) - iter.peekLength();
  13719. var index = typeof thisOp.insert === "string" ? thisOp.insert.indexOf(newline, start) - start : -1;
  13720. if (index < 0) {
  13721. line.push(iter.next());
  13722. } else if (index > 0) {
  13723. line.push(iter.next(index));
  13724. } else {
  13725. if (predicate(line, iter.next(1).attributes || {}, i) === false) {
  13726. return;
  13727. }
  13728. i += 1;
  13729. line = new Delta3();
  13730. }
  13731. }
  13732. if (line.length() > 0) {
  13733. predicate(line, {}, i);
  13734. }
  13735. };
  13736. Delta3.prototype.invert = function(base) {
  13737. var inverted = new Delta3();
  13738. this.reduce(function(baseIndex, op) {
  13739. if (op.insert) {
  13740. inverted.delete(Op_1.default.length(op));
  13741. } else if (op.retain && op.attributes == null) {
  13742. inverted.retain(op.retain);
  13743. return baseIndex + op.retain;
  13744. } else if (op.delete || op.retain && op.attributes) {
  13745. var length_2 = op.delete || op.retain;
  13746. var slice = base.slice(baseIndex, baseIndex + length_2);
  13747. slice.forEach(function(baseOp) {
  13748. if (op.delete) {
  13749. inverted.push(baseOp);
  13750. } else if (op.retain && op.attributes) {
  13751. inverted.retain(Op_1.default.length(baseOp), AttributeMap_1.default.invert(op.attributes, baseOp.attributes));
  13752. }
  13753. });
  13754. return baseIndex + length_2;
  13755. }
  13756. return baseIndex;
  13757. }, 0);
  13758. return inverted.chop();
  13759. };
  13760. Delta3.prototype.transform = function(arg, priority) {
  13761. if (priority === void 0) {
  13762. priority = false;
  13763. }
  13764. priority = !!priority;
  13765. if (typeof arg === "number") {
  13766. return this.transformPosition(arg, priority);
  13767. }
  13768. var other = arg;
  13769. var thisIter = Op_1.default.iterator(this.ops);
  13770. var otherIter = Op_1.default.iterator(other.ops);
  13771. var delta = new Delta3();
  13772. while (thisIter.hasNext() || otherIter.hasNext()) {
  13773. if (thisIter.peekType() === "insert" && (priority || otherIter.peekType() !== "insert")) {
  13774. delta.retain(Op_1.default.length(thisIter.next()));
  13775. } else if (otherIter.peekType() === "insert") {
  13776. delta.push(otherIter.next());
  13777. } else {
  13778. var length_3 = Math.min(thisIter.peekLength(), otherIter.peekLength());
  13779. var thisOp = thisIter.next(length_3);
  13780. var otherOp = otherIter.next(length_3);
  13781. if (thisOp.delete) {
  13782. continue;
  13783. } else if (otherOp.delete) {
  13784. delta.push(otherOp);
  13785. } else {
  13786. delta.retain(length_3, AttributeMap_1.default.transform(thisOp.attributes, otherOp.attributes, priority));
  13787. }
  13788. }
  13789. }
  13790. return delta.chop();
  13791. };
  13792. Delta3.prototype.transformPosition = function(index, priority) {
  13793. if (priority === void 0) {
  13794. priority = false;
  13795. }
  13796. priority = !!priority;
  13797. var thisIter = Op_1.default.iterator(this.ops);
  13798. var offset = 0;
  13799. while (thisIter.hasNext() && offset <= index) {
  13800. var length_4 = thisIter.peekLength();
  13801. var nextType = thisIter.peekType();
  13802. thisIter.next();
  13803. if (nextType === "delete") {
  13804. index -= Math.min(length_4, index - offset);
  13805. continue;
  13806. } else if (nextType === "insert" && (offset < index || !priority)) {
  13807. index += length_4;
  13808. }
  13809. offset += length_4;
  13810. }
  13811. return index;
  13812. };
  13813. Delta3.Op = Op_1.default;
  13814. Delta3.AttributeMap = AttributeMap_1.default;
  13815. return Delta3;
  13816. })()
  13817. );
  13818. module.exports = Delta2;
  13819. }
  13820. });
  13821. // node_modules/@vueup/vue-quill/dist/vue-quill.esm-bundler.js
  13822. var import_quill = __toESM(require_quill());
  13823. var import_quill2 = __toESM(require_quill());
  13824. var import_quill_delta = __toESM(require_Delta());
  13825. var import_quill_delta2 = __toESM(require_Delta());
  13826. var toolbarOptions = {
  13827. essential: [
  13828. [{ header: [1, 2, 3, 4, 5, 6, false] }],
  13829. ["bold", "italic", "underline"],
  13830. [{ list: "ordered" }, { list: "bullet" }, { align: [] }],
  13831. ["blockquote", "code-block", "link"],
  13832. [{ color: [] }, "clean"]
  13833. ],
  13834. minimal: [
  13835. [{ header: 1 }, { header: 2 }],
  13836. ["bold", "italic", "underline"],
  13837. [{ list: "ordered" }, { list: "bullet" }, { align: [] }]
  13838. ],
  13839. full: [
  13840. ["bold", "italic", "underline", "strike"],
  13841. ["blockquote", "code-block"],
  13842. [{ header: 1 }, { header: 2 }],
  13843. [{ list: "ordered" }, { list: "bullet" }],
  13844. [{ script: "sub" }, { script: "super" }],
  13845. [{ indent: "-1" }, { indent: "+1" }],
  13846. [{ direction: "rtl" }],
  13847. [{ size: ["small", false, "large", "huge"] }],
  13848. [{ header: [1, 2, 3, 4, 5, 6, false] }],
  13849. [{ color: [] }, { background: [] }],
  13850. [{ font: [] }],
  13851. [{ align: [] }],
  13852. ["link", "video", "image"],
  13853. ["clean"]
  13854. // remove formatting button
  13855. ]
  13856. };
  13857. var QuillEditor = defineComponent({
  13858. name: "QuillEditor",
  13859. inheritAttrs: false,
  13860. props: {
  13861. content: {
  13862. type: [String, Object]
  13863. },
  13864. contentType: {
  13865. type: String,
  13866. default: "delta",
  13867. validator: (value) => {
  13868. return ["delta", "html", "text"].includes(value);
  13869. }
  13870. },
  13871. enable: {
  13872. type: Boolean,
  13873. default: true
  13874. },
  13875. readOnly: {
  13876. type: Boolean,
  13877. default: false
  13878. },
  13879. placeholder: {
  13880. type: String,
  13881. required: false
  13882. },
  13883. theme: {
  13884. type: String,
  13885. default: "snow",
  13886. validator: (value) => {
  13887. return ["snow", "bubble", ""].includes(value);
  13888. }
  13889. },
  13890. toolbar: {
  13891. type: [String, Array, Object],
  13892. required: false,
  13893. validator: (value) => {
  13894. if (typeof value === "string" && value !== "") {
  13895. return value.charAt(0) === "#" ? true : Object.keys(toolbarOptions).indexOf(value) !== -1;
  13896. }
  13897. return true;
  13898. }
  13899. },
  13900. modules: {
  13901. type: Object,
  13902. required: false
  13903. },
  13904. options: {
  13905. type: Object,
  13906. required: false
  13907. },
  13908. globalOptions: {
  13909. type: Object,
  13910. required: false
  13911. }
  13912. },
  13913. emits: [
  13914. "textChange",
  13915. "selectionChange",
  13916. "editorChange",
  13917. "update:content",
  13918. "focus",
  13919. "blur",
  13920. "ready"
  13921. ],
  13922. setup: (props, ctx) => {
  13923. onMounted(() => {
  13924. initialize();
  13925. });
  13926. onBeforeUnmount(() => {
  13927. quill = null;
  13928. });
  13929. let quill;
  13930. let options;
  13931. const editor = ref();
  13932. const initialize = () => {
  13933. var _a;
  13934. if (!editor.value)
  13935. return;
  13936. options = composeOptions();
  13937. if (props.modules) {
  13938. if (Array.isArray(props.modules)) {
  13939. for (const module of props.modules) {
  13940. import_quill.default.register(`modules/${module.name}`, module.module);
  13941. }
  13942. } else {
  13943. import_quill.default.register(`modules/${props.modules.name}`, props.modules.module);
  13944. }
  13945. }
  13946. quill = new import_quill.default(editor.value, options);
  13947. setContents(props.content);
  13948. quill.on("text-change", handleTextChange);
  13949. quill.on("selection-change", handleSelectionChange);
  13950. quill.on("editor-change", handleEditorChange);
  13951. if (props.theme !== "bubble")
  13952. editor.value.classList.remove("ql-bubble");
  13953. if (props.theme !== "snow")
  13954. editor.value.classList.remove("ql-snow");
  13955. (_a = quill.getModule("toolbar")) === null || _a === void 0 ? void 0 : _a.container.addEventListener("mousedown", (e) => {
  13956. e.preventDefault();
  13957. });
  13958. ctx.emit("ready", quill);
  13959. };
  13960. const composeOptions = () => {
  13961. const clientOptions = {};
  13962. if (props.theme !== "")
  13963. clientOptions.theme = props.theme;
  13964. if (props.readOnly)
  13965. clientOptions.readOnly = props.readOnly;
  13966. if (props.placeholder)
  13967. clientOptions.placeholder = props.placeholder;
  13968. if (props.toolbar && props.toolbar !== "") {
  13969. clientOptions.modules = {
  13970. toolbar: (() => {
  13971. if (typeof props.toolbar === "object") {
  13972. return props.toolbar;
  13973. } else if (typeof props.toolbar === "string") {
  13974. const str = props.toolbar;
  13975. return str.charAt(0) === "#" ? props.toolbar : toolbarOptions[props.toolbar];
  13976. }
  13977. return;
  13978. })()
  13979. };
  13980. }
  13981. if (props.modules) {
  13982. const modules = (() => {
  13983. var _a, _b;
  13984. const modulesOption = {};
  13985. if (Array.isArray(props.modules)) {
  13986. for (const module of props.modules) {
  13987. modulesOption[module.name] = (_a = module.options) !== null && _a !== void 0 ? _a : {};
  13988. }
  13989. } else {
  13990. modulesOption[props.modules.name] = (_b = props.modules.options) !== null && _b !== void 0 ? _b : {};
  13991. }
  13992. return modulesOption;
  13993. })();
  13994. clientOptions.modules = Object.assign({}, clientOptions.modules, modules);
  13995. }
  13996. return Object.assign({}, props.globalOptions, props.options, clientOptions);
  13997. };
  13998. const maybeClone = (delta) => {
  13999. return typeof delta === "object" && delta ? delta.slice() : delta;
  14000. };
  14001. const deltaHasValuesOtherThanRetain = (delta) => {
  14002. return Object.values(delta.ops).some((v) => !v.retain || Object.keys(v).length !== 1);
  14003. };
  14004. let internalModel;
  14005. const internalModelEquals = (against) => {
  14006. if (typeof internalModel === typeof against) {
  14007. if (against === internalModel) {
  14008. return true;
  14009. }
  14010. if (typeof against === "object" && against && typeof internalModel === "object" && internalModel) {
  14011. return !deltaHasValuesOtherThanRetain(internalModel.diff(against));
  14012. }
  14013. }
  14014. return false;
  14015. };
  14016. const handleTextChange = (delta, oldContents, source) => {
  14017. internalModel = maybeClone(getContents());
  14018. if (!internalModelEquals(props.content)) {
  14019. ctx.emit("update:content", internalModel);
  14020. }
  14021. ctx.emit("textChange", { delta, oldContents, source });
  14022. };
  14023. const isEditorFocus = ref();
  14024. const handleSelectionChange = (range, oldRange, source) => {
  14025. isEditorFocus.value = !!(quill === null || quill === void 0 ? void 0 : quill.hasFocus());
  14026. ctx.emit("selectionChange", { range, oldRange, source });
  14027. };
  14028. watch(isEditorFocus, (focus2) => {
  14029. if (focus2)
  14030. ctx.emit("focus", editor);
  14031. else
  14032. ctx.emit("blur", editor);
  14033. });
  14034. const handleEditorChange = (...args) => {
  14035. if (args[0] === "text-change")
  14036. ctx.emit("editorChange", {
  14037. name: args[0],
  14038. delta: args[1],
  14039. oldContents: args[2],
  14040. source: args[3]
  14041. });
  14042. if (args[0] === "selection-change")
  14043. ctx.emit("editorChange", {
  14044. name: args[0],
  14045. range: args[1],
  14046. oldRange: args[2],
  14047. source: args[3]
  14048. });
  14049. };
  14050. const getEditor = () => {
  14051. return editor.value;
  14052. };
  14053. const getToolbar = () => {
  14054. var _a;
  14055. return (_a = quill === null || quill === void 0 ? void 0 : quill.getModule("toolbar")) === null || _a === void 0 ? void 0 : _a.container;
  14056. };
  14057. const getQuill = () => {
  14058. if (quill)
  14059. return quill;
  14060. else
  14061. throw `The quill editor hasn't been instantiated yet,
  14062. make sure to call this method when the editor ready
  14063. or use v-on:ready="onReady(quill)" event instead.`;
  14064. };
  14065. const getContents = (index, length) => {
  14066. if (props.contentType === "html") {
  14067. return getHTML();
  14068. } else if (props.contentType === "text") {
  14069. return getText(index, length);
  14070. }
  14071. return quill === null || quill === void 0 ? void 0 : quill.getContents(index, length);
  14072. };
  14073. const setContents = (content, source = "api") => {
  14074. const normalizedContent = !content ? props.contentType === "delta" ? new import_quill_delta.default() : "" : content;
  14075. if (props.contentType === "html") {
  14076. setHTML(normalizedContent);
  14077. } else if (props.contentType === "text") {
  14078. setText(normalizedContent, source);
  14079. } else {
  14080. quill === null || quill === void 0 ? void 0 : quill.setContents(normalizedContent, source);
  14081. }
  14082. internalModel = maybeClone(normalizedContent);
  14083. };
  14084. const getText = (index, length) => {
  14085. var _a;
  14086. return (_a = quill === null || quill === void 0 ? void 0 : quill.getText(index, length)) !== null && _a !== void 0 ? _a : "";
  14087. };
  14088. const setText = (text, source = "api") => {
  14089. quill === null || quill === void 0 ? void 0 : quill.setText(text, source);
  14090. };
  14091. const getHTML = () => {
  14092. var _a;
  14093. return (_a = quill === null || quill === void 0 ? void 0 : quill.root.innerHTML) !== null && _a !== void 0 ? _a : "";
  14094. };
  14095. const setHTML = (html) => {
  14096. if (quill)
  14097. quill.root.innerHTML = html;
  14098. };
  14099. const pasteHTML = (html, source = "api") => {
  14100. const delta = quill === null || quill === void 0 ? void 0 : quill.clipboard.convert(html);
  14101. if (delta)
  14102. quill === null || quill === void 0 ? void 0 : quill.setContents(delta, source);
  14103. };
  14104. const focus = () => {
  14105. quill === null || quill === void 0 ? void 0 : quill.focus();
  14106. };
  14107. const reinit = () => {
  14108. nextTick(() => {
  14109. var _a;
  14110. if (!ctx.slots.toolbar && quill)
  14111. (_a = quill.getModule("toolbar")) === null || _a === void 0 ? void 0 : _a.container.remove();
  14112. initialize();
  14113. });
  14114. };
  14115. watch(() => props.content, (newContent) => {
  14116. if (!quill || !newContent || internalModelEquals(newContent))
  14117. return;
  14118. const selection = quill.getSelection();
  14119. if (selection) {
  14120. nextTick(() => quill === null || quill === void 0 ? void 0 : quill.setSelection(selection));
  14121. }
  14122. setContents(newContent);
  14123. }, { deep: true });
  14124. watch(() => props.enable, (newValue) => {
  14125. if (quill)
  14126. quill.enable(newValue);
  14127. });
  14128. return {
  14129. editor,
  14130. getEditor,
  14131. getToolbar,
  14132. getQuill,
  14133. getContents,
  14134. setContents,
  14135. getHTML,
  14136. setHTML,
  14137. pasteHTML,
  14138. focus,
  14139. getText,
  14140. setText,
  14141. reinit
  14142. };
  14143. },
  14144. render() {
  14145. var _a, _b;
  14146. return [
  14147. (_b = (_a = this.$slots).toolbar) === null || _b === void 0 ? void 0 : _b.call(_a),
  14148. h("div", { ref: "editor", ...this.$attrs })
  14149. ];
  14150. }
  14151. });
  14152. var export_Delta = import_quill_delta2.default;
  14153. var export_Quill = import_quill2.default;
  14154. export {
  14155. export_Delta as Delta,
  14156. export_Quill as Quill,
  14157. QuillEditor
  14158. };
  14159. /*! Bundled license information:
  14160. quill/dist/quill.js:
  14161. (*!
  14162. * Quill Editor v1.3.7
  14163. * https://quilljs.com/
  14164. * Copyright (c) 2014, Jason Chen
  14165. * Copyright (c) 2013, salesforce.com
  14166. *)
  14167. @vueup/vue-quill/dist/vue-quill.esm-bundler.js:
  14168. (*!
  14169. * VueQuill @vueup/vue-quill v1.2.0
  14170. * https://vueup.github.io/vue-quill/
  14171. *
  14172. * Includes quill v1.3.7
  14173. * https://quilljs.com/
  14174. *
  14175. * Copyright (c) 2023 Ahmad Luthfi Masruri
  14176. * Released under the MIT license
  14177. * Date: 2023-05-12T08:44:03.742Z
  14178. *)
  14179. */
  14180. //# sourceMappingURL=@vueup_vue-quill.js.map