block-library.js 1.5 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187
  1. /******/ (function() { // webpackBootstrap
  2. /******/ var __webpack_modules__ = ({
  3. /***/ 3827:
  4. /***/ (function(module, exports) {
  5. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  6. Copyright (c) 2018 Jed Watson.
  7. Licensed under the MIT License (MIT), see
  8. http://jedwatson.github.io/classnames
  9. */
  10. /* global define */
  11. (function () {
  12. 'use strict';
  13. var classNames = (function () {
  14. // don't inherit from Object so we can skip hasOwnProperty check later
  15. // http://stackoverflow.com/questions/15518328/creating-js-object-with-object-createnull#answer-21079232
  16. function StorageObject() {}
  17. StorageObject.prototype = Object.create(null);
  18. function _parseArray (resultSet, array) {
  19. var length = array.length;
  20. for (var i = 0; i < length; ++i) {
  21. _parse(resultSet, array[i]);
  22. }
  23. }
  24. var hasOwn = {}.hasOwnProperty;
  25. function _parseNumber (resultSet, num) {
  26. resultSet[num] = true;
  27. }
  28. function _parseObject (resultSet, object) {
  29. if (object.toString === Object.prototype.toString) {
  30. for (var k in object) {
  31. if (hasOwn.call(object, k)) {
  32. // set value to false instead of deleting it to avoid changing object structure
  33. // https://www.smashingmagazine.com/2012/11/writing-fast-memory-efficient-javascript/#de-referencing-misconceptions
  34. resultSet[k] = !!object[k];
  35. }
  36. }
  37. } else {
  38. resultSet[object.toString()] = true;
  39. }
  40. }
  41. var SPACE = /\s+/;
  42. function _parseString (resultSet, str) {
  43. var array = str.split(SPACE);
  44. var length = array.length;
  45. for (var i = 0; i < length; ++i) {
  46. resultSet[array[i]] = true;
  47. }
  48. }
  49. function _parse (resultSet, arg) {
  50. if (!arg) return;
  51. var argType = typeof arg;
  52. // 'foo bar'
  53. if (argType === 'string') {
  54. _parseString(resultSet, arg);
  55. // ['foo', 'bar', ...]
  56. } else if (Array.isArray(arg)) {
  57. _parseArray(resultSet, arg);
  58. // { 'foo': true, ... }
  59. } else if (argType === 'object') {
  60. _parseObject(resultSet, arg);
  61. // '130'
  62. } else if (argType === 'number') {
  63. _parseNumber(resultSet, arg);
  64. }
  65. }
  66. function _classNames () {
  67. // don't leak arguments
  68. // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
  69. var len = arguments.length;
  70. var args = Array(len);
  71. for (var i = 0; i < len; i++) {
  72. args[i] = arguments[i];
  73. }
  74. var classSet = new StorageObject();
  75. _parseArray(classSet, args);
  76. var list = [];
  77. for (var k in classSet) {
  78. if (classSet[k]) {
  79. list.push(k)
  80. }
  81. }
  82. return list.join(' ');
  83. }
  84. return _classNames;
  85. })();
  86. if ( true && module.exports) {
  87. classNames.default = classNames;
  88. module.exports = classNames;
  89. } else if (true) {
  90. // register as 'classnames', consistent with npm package name
  91. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
  92. return classNames;
  93. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  94. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  95. } else {}
  96. }());
  97. /***/ }),
  98. /***/ 4403:
  99. /***/ (function(module, exports) {
  100. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  101. Copyright (c) 2018 Jed Watson.
  102. Licensed under the MIT License (MIT), see
  103. http://jedwatson.github.io/classnames
  104. */
  105. /* global define */
  106. (function () {
  107. 'use strict';
  108. var hasOwn = {}.hasOwnProperty;
  109. function classNames() {
  110. var classes = [];
  111. for (var i = 0; i < arguments.length; i++) {
  112. var arg = arguments[i];
  113. if (!arg) continue;
  114. var argType = typeof arg;
  115. if (argType === 'string' || argType === 'number') {
  116. classes.push(arg);
  117. } else if (Array.isArray(arg)) {
  118. if (arg.length) {
  119. var inner = classNames.apply(null, arg);
  120. if (inner) {
  121. classes.push(inner);
  122. }
  123. }
  124. } else if (argType === 'object') {
  125. if (arg.toString === Object.prototype.toString) {
  126. for (var key in arg) {
  127. if (hasOwn.call(arg, key) && arg[key]) {
  128. classes.push(key);
  129. }
  130. }
  131. } else {
  132. classes.push(arg.toString());
  133. }
  134. }
  135. }
  136. return classes.join(' ');
  137. }
  138. if ( true && module.exports) {
  139. classNames.default = classNames;
  140. module.exports = classNames;
  141. } else if (true) {
  142. // register as 'classnames', consistent with npm package name
  143. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
  144. return classNames;
  145. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  146. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  147. } else {}
  148. }());
  149. /***/ }),
  150. /***/ 5027:
  151. /***/ (function(module) {
  152. /*! Fast Average Color | © 2019 Denis Seleznev | MIT License | https://github.com/hcodes/fast-average-color/ */
  153. (function (global, factory) {
  154. true ? module.exports = factory() :
  155. 0;
  156. }(this, (function () { 'use strict';
  157. function _classCallCheck(instance, Constructor) {
  158. if (!(instance instanceof Constructor)) {
  159. throw new TypeError("Cannot call a class as a function");
  160. }
  161. }
  162. function _defineProperties(target, props) {
  163. for (var i = 0; i < props.length; i++) {
  164. var descriptor = props[i];
  165. descriptor.enumerable = descriptor.enumerable || false;
  166. descriptor.configurable = true;
  167. if ("value" in descriptor) descriptor.writable = true;
  168. Object.defineProperty(target, descriptor.key, descriptor);
  169. }
  170. }
  171. function _createClass(Constructor, protoProps, staticProps) {
  172. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  173. if (staticProps) _defineProperties(Constructor, staticProps);
  174. return Constructor;
  175. }
  176. function _slicedToArray(arr, i) {
  177. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
  178. }
  179. function _arrayWithHoles(arr) {
  180. if (Array.isArray(arr)) return arr;
  181. }
  182. function _iterableToArrayLimit(arr, i) {
  183. var _arr = [];
  184. var _n = true;
  185. var _d = false;
  186. var _e = undefined;
  187. try {
  188. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  189. _arr.push(_s.value);
  190. if (i && _arr.length === i) break;
  191. }
  192. } catch (err) {
  193. _d = true;
  194. _e = err;
  195. } finally {
  196. try {
  197. if (!_n && _i["return"] != null) _i["return"]();
  198. } finally {
  199. if (_d) throw _e;
  200. }
  201. }
  202. return _arr;
  203. }
  204. function _nonIterableRest() {
  205. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  206. }
  207. var FastAverageColor =
  208. /*#__PURE__*/
  209. function () {
  210. function FastAverageColor() {
  211. _classCallCheck(this, FastAverageColor);
  212. }
  213. _createClass(FastAverageColor, [{
  214. key: "getColorAsync",
  215. /**
  216. * Get asynchronously the average color from not loaded image.
  217. *
  218. * @param {HTMLImageElement} resource
  219. * @param {Function} callback
  220. * @param {Object|null} [options]
  221. * @param {Array} [options.defaultColor=[255, 255, 255, 255]]
  222. * @param {*} [options.data]
  223. * @param {string} [options.mode="speed"] "precision" or "speed"
  224. * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant"
  225. * @param {number} [options.step=1]
  226. * @param {number} [options.left=0]
  227. * @param {number} [options.top=0]
  228. * @param {number} [options.width=width of resource]
  229. * @param {number} [options.height=height of resource]
  230. */
  231. value: function getColorAsync(resource, callback, options) {
  232. if (resource.complete) {
  233. callback.call(resource, this.getColor(resource, options), options && options.data);
  234. } else {
  235. this._bindImageEvents(resource, callback, options);
  236. }
  237. }
  238. /**
  239. * Get the average color from images, videos and canvas.
  240. *
  241. * @param {HTMLImageElement|HTMLVideoElement|HTMLCanvasElement} resource
  242. * @param {Object|null} [options]
  243. * @param {Array} [options.defaultColor=[255, 255, 255, 255]]
  244. * @param {*} [options.data]
  245. * @param {string} [options.mode="speed"] "precision" or "speed"
  246. * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant"
  247. * @param {number} [options.step=1]
  248. * @param {number} [options.left=0]
  249. * @param {number} [options.top=0]
  250. * @param {number} [options.width=width of resource]
  251. * @param {number} [options.height=height of resource]
  252. *
  253. * @returns {Object}
  254. */
  255. }, {
  256. key: "getColor",
  257. value: function getColor(resource, options) {
  258. options = options || {};
  259. var defaultColor = this._getDefaultColor(options),
  260. originalSize = this._getOriginalSize(resource),
  261. size = this._prepareSizeAndPosition(originalSize, options);
  262. var error = null,
  263. value = defaultColor;
  264. if (!size.srcWidth || !size.srcHeight || !size.destWidth || !size.destHeight) {
  265. return this._prepareResult(defaultColor, new Error('FastAverageColor: Incorrect sizes.'));
  266. }
  267. if (!this._ctx) {
  268. this._canvas = this._makeCanvas();
  269. this._ctx = this._canvas.getContext && this._canvas.getContext('2d');
  270. if (!this._ctx) {
  271. return this._prepareResult(defaultColor, new Error('FastAverageColor: Canvas Context 2D is not supported in this browser.'));
  272. }
  273. }
  274. this._canvas.width = size.destWidth;
  275. this._canvas.height = size.destHeight;
  276. try {
  277. this._ctx.clearRect(0, 0, size.destWidth, size.destHeight);
  278. this._ctx.drawImage(resource, size.srcLeft, size.srcTop, size.srcWidth, size.srcHeight, 0, 0, size.destWidth, size.destHeight);
  279. var bitmapData = this._ctx.getImageData(0, 0, size.destWidth, size.destHeight).data;
  280. value = this.getColorFromArray4(bitmapData, options);
  281. } catch (e) {
  282. // Security error, CORS
  283. // https://developer.mozilla.org/en/docs/Web/HTML/CORS_enabled_image
  284. error = e;
  285. }
  286. return this._prepareResult(value, error);
  287. }
  288. /**
  289. * Get the average color from a array when 1 pixel is 4 bytes.
  290. *
  291. * @param {Array|Uint8Array} arr
  292. * @param {Object} [options]
  293. * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant"
  294. * @param {Array} [options.defaultColor=[255, 255, 255, 255]]
  295. * @param {number} [options.step=1]
  296. *
  297. * @returns {Array} [red (0-255), green (0-255), blue (0-255), alpha (0-255)]
  298. */
  299. }, {
  300. key: "getColorFromArray4",
  301. value: function getColorFromArray4(arr, options) {
  302. options = options || {};
  303. var bytesPerPixel = 4,
  304. arrLength = arr.length;
  305. if (arrLength < bytesPerPixel) {
  306. return this._getDefaultColor(options);
  307. }
  308. var len = arrLength - arrLength % bytesPerPixel,
  309. preparedStep = (options.step || 1) * bytesPerPixel,
  310. algorithm = '_' + (options.algorithm || 'sqrt') + 'Algorithm';
  311. if (typeof this[algorithm] !== 'function') {
  312. throw new Error("FastAverageColor: ".concat(options.algorithm, " is unknown algorithm."));
  313. }
  314. return this[algorithm](arr, len, preparedStep);
  315. }
  316. /**
  317. * Destroy the instance.
  318. */
  319. }, {
  320. key: "destroy",
  321. value: function destroy() {
  322. delete this._canvas;
  323. delete this._ctx;
  324. }
  325. }, {
  326. key: "_getDefaultColor",
  327. value: function _getDefaultColor(options) {
  328. return this._getOption(options, 'defaultColor', [255, 255, 255, 255]);
  329. }
  330. }, {
  331. key: "_getOption",
  332. value: function _getOption(options, name, defaultValue) {
  333. return typeof options[name] === 'undefined' ? defaultValue : options[name];
  334. }
  335. }, {
  336. key: "_prepareSizeAndPosition",
  337. value: function _prepareSizeAndPosition(originalSize, options) {
  338. var srcLeft = this._getOption(options, 'left', 0),
  339. srcTop = this._getOption(options, 'top', 0),
  340. srcWidth = this._getOption(options, 'width', originalSize.width),
  341. srcHeight = this._getOption(options, 'height', originalSize.height),
  342. destWidth = srcWidth,
  343. destHeight = srcHeight;
  344. if (options.mode === 'precision') {
  345. return {
  346. srcLeft: srcLeft,
  347. srcTop: srcTop,
  348. srcWidth: srcWidth,
  349. srcHeight: srcHeight,
  350. destWidth: destWidth,
  351. destHeight: destHeight
  352. };
  353. }
  354. var maxSize = 100,
  355. minSize = 10;
  356. var factor;
  357. if (srcWidth > srcHeight) {
  358. factor = srcWidth / srcHeight;
  359. destWidth = maxSize;
  360. destHeight = Math.round(destWidth / factor);
  361. } else {
  362. factor = srcHeight / srcWidth;
  363. destHeight = maxSize;
  364. destWidth = Math.round(destHeight / factor);
  365. }
  366. if (destWidth > srcWidth || destHeight > srcHeight || destWidth < minSize || destHeight < minSize) {
  367. destWidth = srcWidth;
  368. destHeight = srcHeight;
  369. }
  370. return {
  371. srcLeft: srcLeft,
  372. srcTop: srcTop,
  373. srcWidth: srcWidth,
  374. srcHeight: srcHeight,
  375. destWidth: destWidth,
  376. destHeight: destHeight
  377. };
  378. }
  379. }, {
  380. key: "_simpleAlgorithm",
  381. value: function _simpleAlgorithm(arr, len, preparedStep) {
  382. var redTotal = 0,
  383. greenTotal = 0,
  384. blueTotal = 0,
  385. alphaTotal = 0,
  386. count = 0;
  387. for (var i = 0; i < len; i += preparedStep) {
  388. var alpha = arr[i + 3],
  389. red = arr[i] * alpha,
  390. green = arr[i + 1] * alpha,
  391. blue = arr[i + 2] * alpha;
  392. redTotal += red;
  393. greenTotal += green;
  394. blueTotal += blue;
  395. alphaTotal += alpha;
  396. count++;
  397. }
  398. return alphaTotal ? [Math.round(redTotal / alphaTotal), Math.round(greenTotal / alphaTotal), Math.round(blueTotal / alphaTotal), Math.round(alphaTotal / count)] : [0, 0, 0, 0];
  399. }
  400. }, {
  401. key: "_sqrtAlgorithm",
  402. value: function _sqrtAlgorithm(arr, len, preparedStep) {
  403. var redTotal = 0,
  404. greenTotal = 0,
  405. blueTotal = 0,
  406. alphaTotal = 0,
  407. count = 0;
  408. for (var i = 0; i < len; i += preparedStep) {
  409. var red = arr[i],
  410. green = arr[i + 1],
  411. blue = arr[i + 2],
  412. alpha = arr[i + 3];
  413. redTotal += red * red * alpha;
  414. greenTotal += green * green * alpha;
  415. blueTotal += blue * blue * alpha;
  416. alphaTotal += alpha;
  417. count++;
  418. }
  419. return alphaTotal ? [Math.round(Math.sqrt(redTotal / alphaTotal)), Math.round(Math.sqrt(greenTotal / alphaTotal)), Math.round(Math.sqrt(blueTotal / alphaTotal)), Math.round(alphaTotal / count)] : [0, 0, 0, 0];
  420. }
  421. }, {
  422. key: "_dominantAlgorithm",
  423. value: function _dominantAlgorithm(arr, len, preparedStep) {
  424. var colorHash = {},
  425. divider = 24;
  426. for (var i = 0; i < len; i += preparedStep) {
  427. var red = arr[i],
  428. green = arr[i + 1],
  429. blue = arr[i + 2],
  430. alpha = arr[i + 3],
  431. key = Math.round(red / divider) + ',' + Math.round(green / divider) + ',' + Math.round(blue / divider);
  432. if (colorHash[key]) {
  433. colorHash[key] = [colorHash[key][0] + red * alpha, colorHash[key][1] + green * alpha, colorHash[key][2] + blue * alpha, colorHash[key][3] + alpha, colorHash[key][4] + 1];
  434. } else {
  435. colorHash[key] = [red * alpha, green * alpha, blue * alpha, alpha, 1];
  436. }
  437. }
  438. var buffer = Object.keys(colorHash).map(function (key) {
  439. return colorHash[key];
  440. }).sort(function (a, b) {
  441. var countA = a[4],
  442. countB = b[4];
  443. return countA > countB ? -1 : countA === countB ? 0 : 1;
  444. });
  445. var _buffer$ = _slicedToArray(buffer[0], 5),
  446. redTotal = _buffer$[0],
  447. greenTotal = _buffer$[1],
  448. blueTotal = _buffer$[2],
  449. alphaTotal = _buffer$[3],
  450. count = _buffer$[4];
  451. return alphaTotal ? [Math.round(redTotal / alphaTotal), Math.round(greenTotal / alphaTotal), Math.round(blueTotal / alphaTotal), Math.round(alphaTotal / count)] : [0, 0, 0, 0];
  452. }
  453. }, {
  454. key: "_bindImageEvents",
  455. value: function _bindImageEvents(resource, callback, options) {
  456. var _this = this;
  457. options = options || {};
  458. var data = options && options.data,
  459. defaultColor = this._getDefaultColor(options),
  460. onload = function onload() {
  461. unbindEvents();
  462. callback.call(resource, _this.getColor(resource, options), data);
  463. },
  464. onerror = function onerror() {
  465. unbindEvents();
  466. callback.call(resource, _this._prepareResult(defaultColor, new Error('Image error')), data);
  467. },
  468. onabort = function onabort() {
  469. unbindEvents();
  470. callback.call(resource, _this._prepareResult(defaultColor, new Error('Image abort')), data);
  471. },
  472. unbindEvents = function unbindEvents() {
  473. resource.removeEventListener('load', onload);
  474. resource.removeEventListener('error', onerror);
  475. resource.removeEventListener('abort', onabort);
  476. };
  477. resource.addEventListener('load', onload);
  478. resource.addEventListener('error', onerror);
  479. resource.addEventListener('abort', onabort);
  480. }
  481. }, {
  482. key: "_prepareResult",
  483. value: function _prepareResult(value, error) {
  484. var rgb = value.slice(0, 3),
  485. rgba = [].concat(rgb, value[3] / 255),
  486. isDark = this._isDark(value);
  487. return {
  488. error: error,
  489. value: value,
  490. rgb: 'rgb(' + rgb.join(',') + ')',
  491. rgba: 'rgba(' + rgba.join(',') + ')',
  492. hex: this._arrayToHex(rgb),
  493. hexa: this._arrayToHex(value),
  494. isDark: isDark,
  495. isLight: !isDark
  496. };
  497. }
  498. }, {
  499. key: "_getOriginalSize",
  500. value: function _getOriginalSize(resource) {
  501. if (resource instanceof HTMLImageElement) {
  502. return {
  503. width: resource.naturalWidth,
  504. height: resource.naturalHeight
  505. };
  506. }
  507. if (resource instanceof HTMLVideoElement) {
  508. return {
  509. width: resource.videoWidth,
  510. height: resource.videoHeight
  511. };
  512. }
  513. return {
  514. width: resource.width,
  515. height: resource.height
  516. };
  517. }
  518. }, {
  519. key: "_toHex",
  520. value: function _toHex(num) {
  521. var str = num.toString(16);
  522. return str.length === 1 ? '0' + str : str;
  523. }
  524. }, {
  525. key: "_arrayToHex",
  526. value: function _arrayToHex(arr) {
  527. return '#' + arr.map(this._toHex).join('');
  528. }
  529. }, {
  530. key: "_isDark",
  531. value: function _isDark(color) {
  532. // http://www.w3.org/TR/AERT#color-contrast
  533. var result = (color[0] * 299 + color[1] * 587 + color[2] * 114) / 1000;
  534. return result < 128;
  535. }
  536. }, {
  537. key: "_makeCanvas",
  538. value: function _makeCanvas() {
  539. return typeof window === 'undefined' ? new OffscreenCanvas(1, 1) : document.createElement('canvas');
  540. }
  541. }]);
  542. return FastAverageColor;
  543. }();
  544. return FastAverageColor;
  545. })));
  546. /***/ }),
  547. /***/ 9756:
  548. /***/ (function(module) {
  549. /**
  550. * Memize options object.
  551. *
  552. * @typedef MemizeOptions
  553. *
  554. * @property {number} [maxSize] Maximum size of the cache.
  555. */
  556. /**
  557. * Internal cache entry.
  558. *
  559. * @typedef MemizeCacheNode
  560. *
  561. * @property {?MemizeCacheNode|undefined} [prev] Previous node.
  562. * @property {?MemizeCacheNode|undefined} [next] Next node.
  563. * @property {Array<*>} args Function arguments for cache
  564. * entry.
  565. * @property {*} val Function result.
  566. */
  567. /**
  568. * Properties of the enhanced function for controlling cache.
  569. *
  570. * @typedef MemizeMemoizedFunction
  571. *
  572. * @property {()=>void} clear Clear the cache.
  573. */
  574. /**
  575. * Accepts a function to be memoized, and returns a new memoized function, with
  576. * optional options.
  577. *
  578. * @template {Function} F
  579. *
  580. * @param {F} fn Function to memoize.
  581. * @param {MemizeOptions} [options] Options object.
  582. *
  583. * @return {F & MemizeMemoizedFunction} Memoized function.
  584. */
  585. function memize( fn, options ) {
  586. var size = 0;
  587. /** @type {?MemizeCacheNode|undefined} */
  588. var head;
  589. /** @type {?MemizeCacheNode|undefined} */
  590. var tail;
  591. options = options || {};
  592. function memoized( /* ...args */ ) {
  593. var node = head,
  594. len = arguments.length,
  595. args, i;
  596. searchCache: while ( node ) {
  597. // Perform a shallow equality test to confirm that whether the node
  598. // under test is a candidate for the arguments passed. Two arrays
  599. // are shallowly equal if their length matches and each entry is
  600. // strictly equal between the two sets. Avoid abstracting to a
  601. // function which could incur an arguments leaking deoptimization.
  602. // Check whether node arguments match arguments length
  603. if ( node.args.length !== arguments.length ) {
  604. node = node.next;
  605. continue;
  606. }
  607. // Check whether node arguments match arguments values
  608. for ( i = 0; i < len; i++ ) {
  609. if ( node.args[ i ] !== arguments[ i ] ) {
  610. node = node.next;
  611. continue searchCache;
  612. }
  613. }
  614. // At this point we can assume we've found a match
  615. // Surface matched node to head if not already
  616. if ( node !== head ) {
  617. // As tail, shift to previous. Must only shift if not also
  618. // head, since if both head and tail, there is no previous.
  619. if ( node === tail ) {
  620. tail = node.prev;
  621. }
  622. // Adjust siblings to point to each other. If node was tail,
  623. // this also handles new tail's empty `next` assignment.
  624. /** @type {MemizeCacheNode} */ ( node.prev ).next = node.next;
  625. if ( node.next ) {
  626. node.next.prev = node.prev;
  627. }
  628. node.next = head;
  629. node.prev = null;
  630. /** @type {MemizeCacheNode} */ ( head ).prev = node;
  631. head = node;
  632. }
  633. // Return immediately
  634. return node.val;
  635. }
  636. // No cached value found. Continue to insertion phase:
  637. // Create a copy of arguments (avoid leaking deoptimization)
  638. args = new Array( len );
  639. for ( i = 0; i < len; i++ ) {
  640. args[ i ] = arguments[ i ];
  641. }
  642. node = {
  643. args: args,
  644. // Generate the result from original function
  645. val: fn.apply( null, args ),
  646. };
  647. // Don't need to check whether node is already head, since it would
  648. // have been returned above already if it was
  649. // Shift existing head down list
  650. if ( head ) {
  651. head.prev = node;
  652. node.next = head;
  653. } else {
  654. // If no head, follows that there's no tail (at initial or reset)
  655. tail = node;
  656. }
  657. // Trim tail if we're reached max size and are pending cache insertion
  658. if ( size === /** @type {MemizeOptions} */ ( options ).maxSize ) {
  659. tail = /** @type {MemizeCacheNode} */ ( tail ).prev;
  660. /** @type {MemizeCacheNode} */ ( tail ).next = null;
  661. } else {
  662. size++;
  663. }
  664. head = node;
  665. return node.val;
  666. }
  667. memoized.clear = function() {
  668. head = null;
  669. tail = null;
  670. size = 0;
  671. };
  672. if ( false ) {}
  673. // Ignore reason: There's not a clear solution to create an intersection of
  674. // the function with additional properties, where the goal is to retain the
  675. // function signature of the incoming argument and add control properties
  676. // on the return value.
  677. // @ts-ignore
  678. return memoized;
  679. }
  680. module.exports = memize;
  681. /***/ })
  682. /******/ });
  683. /************************************************************************/
  684. /******/ // The module cache
  685. /******/ var __webpack_module_cache__ = {};
  686. /******/
  687. /******/ // The require function
  688. /******/ function __webpack_require__(moduleId) {
  689. /******/ // Check if module is in cache
  690. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  691. /******/ if (cachedModule !== undefined) {
  692. /******/ return cachedModule.exports;
  693. /******/ }
  694. /******/ // Create a new module (and put it into the cache)
  695. /******/ var module = __webpack_module_cache__[moduleId] = {
  696. /******/ // no module.id needed
  697. /******/ // no module.loaded needed
  698. /******/ exports: {}
  699. /******/ };
  700. /******/
  701. /******/ // Execute the module function
  702. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  703. /******/
  704. /******/ // Return the exports of the module
  705. /******/ return module.exports;
  706. /******/ }
  707. /******/
  708. /************************************************************************/
  709. /******/ /* webpack/runtime/compat get default export */
  710. /******/ !function() {
  711. /******/ // getDefaultExport function for compatibility with non-harmony modules
  712. /******/ __webpack_require__.n = function(module) {
  713. /******/ var getter = module && module.__esModule ?
  714. /******/ function() { return module['default']; } :
  715. /******/ function() { return module; };
  716. /******/ __webpack_require__.d(getter, { a: getter });
  717. /******/ return getter;
  718. /******/ };
  719. /******/ }();
  720. /******/
  721. /******/ /* webpack/runtime/define property getters */
  722. /******/ !function() {
  723. /******/ // define getter functions for harmony exports
  724. /******/ __webpack_require__.d = function(exports, definition) {
  725. /******/ for(var key in definition) {
  726. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  727. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  728. /******/ }
  729. /******/ }
  730. /******/ };
  731. /******/ }();
  732. /******/
  733. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  734. /******/ !function() {
  735. /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
  736. /******/ }();
  737. /******/
  738. /******/ /* webpack/runtime/make namespace object */
  739. /******/ !function() {
  740. /******/ // define __esModule on exports
  741. /******/ __webpack_require__.r = function(exports) {
  742. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  743. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  744. /******/ }
  745. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  746. /******/ };
  747. /******/ }();
  748. /******/
  749. /************************************************************************/
  750. var __webpack_exports__ = {};
  751. // This entry need to be wrapped in an IIFE because it need to be in strict mode.
  752. !function() {
  753. "use strict";
  754. // ESM COMPAT FLAG
  755. __webpack_require__.r(__webpack_exports__);
  756. // EXPORTS
  757. __webpack_require__.d(__webpack_exports__, {
  758. "__experimentalGetCoreBlocks": function() { return /* binding */ __experimentalGetCoreBlocks; },
  759. "__experimentalRegisterExperimentalCoreBlocks": function() { return /* binding */ __experimentalRegisterExperimentalCoreBlocks; },
  760. "registerCoreBlocks": function() { return /* binding */ registerCoreBlocks; }
  761. });
  762. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/archives/index.js
  763. var archives_namespaceObject = {};
  764. __webpack_require__.r(archives_namespaceObject);
  765. __webpack_require__.d(archives_namespaceObject, {
  766. "metadata": function() { return metadata; },
  767. "name": function() { return archives_name; },
  768. "settings": function() { return settings; }
  769. });
  770. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/avatar/index.js
  771. var avatar_namespaceObject = {};
  772. __webpack_require__.r(avatar_namespaceObject);
  773. __webpack_require__.d(avatar_namespaceObject, {
  774. "metadata": function() { return avatar_metadata; },
  775. "name": function() { return avatar_name; },
  776. "settings": function() { return avatar_settings; }
  777. });
  778. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/audio/index.js
  779. var build_module_audio_namespaceObject = {};
  780. __webpack_require__.r(build_module_audio_namespaceObject);
  781. __webpack_require__.d(build_module_audio_namespaceObject, {
  782. "metadata": function() { return audio_metadata; },
  783. "name": function() { return audio_name; },
  784. "settings": function() { return audio_settings; }
  785. });
  786. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/button/index.js
  787. var build_module_button_namespaceObject = {};
  788. __webpack_require__.r(build_module_button_namespaceObject);
  789. __webpack_require__.d(build_module_button_namespaceObject, {
  790. "metadata": function() { return button_metadata; },
  791. "name": function() { return button_name; },
  792. "settings": function() { return button_settings; }
  793. });
  794. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/buttons/index.js
  795. var build_module_buttons_namespaceObject = {};
  796. __webpack_require__.r(build_module_buttons_namespaceObject);
  797. __webpack_require__.d(build_module_buttons_namespaceObject, {
  798. "metadata": function() { return buttons_metadata; },
  799. "name": function() { return buttons_name; },
  800. "settings": function() { return buttons_settings; }
  801. });
  802. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/calendar/index.js
  803. var build_module_calendar_namespaceObject = {};
  804. __webpack_require__.r(build_module_calendar_namespaceObject);
  805. __webpack_require__.d(build_module_calendar_namespaceObject, {
  806. "metadata": function() { return calendar_metadata; },
  807. "name": function() { return calendar_name; },
  808. "settings": function() { return calendar_settings; }
  809. });
  810. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/categories/index.js
  811. var categories_namespaceObject = {};
  812. __webpack_require__.r(categories_namespaceObject);
  813. __webpack_require__.d(categories_namespaceObject, {
  814. "metadata": function() { return categories_metadata; },
  815. "name": function() { return categories_name; },
  816. "settings": function() { return categories_settings; }
  817. });
  818. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/freeform/index.js
  819. var freeform_namespaceObject = {};
  820. __webpack_require__.r(freeform_namespaceObject);
  821. __webpack_require__.d(freeform_namespaceObject, {
  822. "metadata": function() { return freeform_metadata; },
  823. "name": function() { return freeform_name; },
  824. "settings": function() { return freeform_settings; }
  825. });
  826. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/code/index.js
  827. var build_module_code_namespaceObject = {};
  828. __webpack_require__.r(build_module_code_namespaceObject);
  829. __webpack_require__.d(build_module_code_namespaceObject, {
  830. "metadata": function() { return code_metadata; },
  831. "name": function() { return code_name; },
  832. "settings": function() { return code_settings; }
  833. });
  834. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/column/index.js
  835. var build_module_column_namespaceObject = {};
  836. __webpack_require__.r(build_module_column_namespaceObject);
  837. __webpack_require__.d(build_module_column_namespaceObject, {
  838. "metadata": function() { return column_metadata; },
  839. "name": function() { return column_name; },
  840. "settings": function() { return column_settings; }
  841. });
  842. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/columns/index.js
  843. var build_module_columns_namespaceObject = {};
  844. __webpack_require__.r(build_module_columns_namespaceObject);
  845. __webpack_require__.d(build_module_columns_namespaceObject, {
  846. "metadata": function() { return columns_metadata; },
  847. "name": function() { return columns_name; },
  848. "settings": function() { return columns_settings; }
  849. });
  850. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-author-name/index.js
  851. var build_module_comment_author_name_namespaceObject = {};
  852. __webpack_require__.r(build_module_comment_author_name_namespaceObject);
  853. __webpack_require__.d(build_module_comment_author_name_namespaceObject, {
  854. "metadata": function() { return comment_author_name_metadata; },
  855. "name": function() { return comment_author_name_name; },
  856. "settings": function() { return comment_author_name_settings; }
  857. });
  858. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-content/index.js
  859. var build_module_comment_content_namespaceObject = {};
  860. __webpack_require__.r(build_module_comment_content_namespaceObject);
  861. __webpack_require__.d(build_module_comment_content_namespaceObject, {
  862. "metadata": function() { return comment_content_metadata; },
  863. "name": function() { return comment_content_name; },
  864. "settings": function() { return comment_content_settings; }
  865. });
  866. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-date/index.js
  867. var comment_date_namespaceObject = {};
  868. __webpack_require__.r(comment_date_namespaceObject);
  869. __webpack_require__.d(comment_date_namespaceObject, {
  870. "metadata": function() { return comment_date_metadata; },
  871. "name": function() { return comment_date_name; },
  872. "settings": function() { return comment_date_settings; }
  873. });
  874. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/index.js
  875. var build_module_comment_edit_link_namespaceObject = {};
  876. __webpack_require__.r(build_module_comment_edit_link_namespaceObject);
  877. __webpack_require__.d(build_module_comment_edit_link_namespaceObject, {
  878. "metadata": function() { return comment_edit_link_metadata; },
  879. "name": function() { return comment_edit_link_name; },
  880. "settings": function() { return comment_edit_link_settings; }
  881. });
  882. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/index.js
  883. var build_module_comment_reply_link_namespaceObject = {};
  884. __webpack_require__.r(build_module_comment_reply_link_namespaceObject);
  885. __webpack_require__.d(build_module_comment_reply_link_namespaceObject, {
  886. "metadata": function() { return comment_reply_link_metadata; },
  887. "name": function() { return comment_reply_link_name; },
  888. "settings": function() { return comment_reply_link_settings; }
  889. });
  890. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-template/index.js
  891. var comment_template_namespaceObject = {};
  892. __webpack_require__.r(comment_template_namespaceObject);
  893. __webpack_require__.d(comment_template_namespaceObject, {
  894. "metadata": function() { return comment_template_metadata; },
  895. "name": function() { return comment_template_name; },
  896. "settings": function() { return comment_template_settings; }
  897. });
  898. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/index.js
  899. var comments_pagination_previous_namespaceObject = {};
  900. __webpack_require__.r(comments_pagination_previous_namespaceObject);
  901. __webpack_require__.d(comments_pagination_previous_namespaceObject, {
  902. "metadata": function() { return comments_pagination_previous_metadata; },
  903. "name": function() { return comments_pagination_previous_name; },
  904. "settings": function() { return comments_pagination_previous_settings; }
  905. });
  906. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-query-loop/index.js
  907. var comments_query_loop_namespaceObject = {};
  908. __webpack_require__.r(comments_query_loop_namespaceObject);
  909. __webpack_require__.d(comments_query_loop_namespaceObject, {
  910. "metadata": function() { return comments_query_loop_metadata; },
  911. "name": function() { return comments_query_loop_name; },
  912. "settings": function() { return comments_query_loop_settings; }
  913. });
  914. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination/index.js
  915. var comments_pagination_namespaceObject = {};
  916. __webpack_require__.r(comments_pagination_namespaceObject);
  917. __webpack_require__.d(comments_pagination_namespaceObject, {
  918. "metadata": function() { return comments_pagination_metadata; },
  919. "name": function() { return comments_pagination_name; },
  920. "settings": function() { return comments_pagination_settings; }
  921. });
  922. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/index.js
  923. var comments_pagination_next_namespaceObject = {};
  924. __webpack_require__.r(comments_pagination_next_namespaceObject);
  925. __webpack_require__.d(comments_pagination_next_namespaceObject, {
  926. "metadata": function() { return comments_pagination_next_metadata; },
  927. "name": function() { return comments_pagination_next_name; },
  928. "settings": function() { return comments_pagination_next_settings; }
  929. });
  930. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/index.js
  931. var comments_pagination_numbers_namespaceObject = {};
  932. __webpack_require__.r(comments_pagination_numbers_namespaceObject);
  933. __webpack_require__.d(comments_pagination_numbers_namespaceObject, {
  934. "metadata": function() { return comments_pagination_numbers_metadata; },
  935. "name": function() { return comments_pagination_numbers_name; },
  936. "settings": function() { return comments_pagination_numbers_settings; }
  937. });
  938. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-title/index.js
  939. var comments_title_namespaceObject = {};
  940. __webpack_require__.r(comments_title_namespaceObject);
  941. __webpack_require__.d(comments_title_namespaceObject, {
  942. "metadata": function() { return comments_title_metadata; },
  943. "name": function() { return comments_title_name; },
  944. "settings": function() { return comments_title_settings; }
  945. });
  946. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/cover/index.js
  947. var build_module_cover_namespaceObject = {};
  948. __webpack_require__.r(build_module_cover_namespaceObject);
  949. __webpack_require__.d(build_module_cover_namespaceObject, {
  950. "metadata": function() { return cover_metadata; },
  951. "name": function() { return cover_name; },
  952. "settings": function() { return cover_settings; }
  953. });
  954. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/embed/index.js
  955. var embed_namespaceObject = {};
  956. __webpack_require__.r(embed_namespaceObject);
  957. __webpack_require__.d(embed_namespaceObject, {
  958. "metadata": function() { return embed_metadata; },
  959. "name": function() { return embed_name; },
  960. "settings": function() { return embed_settings; }
  961. });
  962. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/file/index.js
  963. var build_module_file_namespaceObject = {};
  964. __webpack_require__.r(build_module_file_namespaceObject);
  965. __webpack_require__.d(build_module_file_namespaceObject, {
  966. "metadata": function() { return file_metadata; },
  967. "name": function() { return file_name; },
  968. "settings": function() { return file_settings; }
  969. });
  970. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/gallery/index.js
  971. var build_module_gallery_namespaceObject = {};
  972. __webpack_require__.r(build_module_gallery_namespaceObject);
  973. __webpack_require__.d(build_module_gallery_namespaceObject, {
  974. "metadata": function() { return gallery_metadata; },
  975. "name": function() { return gallery_name; },
  976. "settings": function() { return gallery_settings; }
  977. });
  978. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/group/index.js
  979. var build_module_group_namespaceObject = {};
  980. __webpack_require__.r(build_module_group_namespaceObject);
  981. __webpack_require__.d(build_module_group_namespaceObject, {
  982. "metadata": function() { return group_metadata; },
  983. "name": function() { return group_name; },
  984. "settings": function() { return group_settings; }
  985. });
  986. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/heading/index.js
  987. var build_module_heading_namespaceObject = {};
  988. __webpack_require__.r(build_module_heading_namespaceObject);
  989. __webpack_require__.d(build_module_heading_namespaceObject, {
  990. "metadata": function() { return heading_metadata; },
  991. "name": function() { return heading_name; },
  992. "settings": function() { return heading_settings; }
  993. });
  994. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/home-link/index.js
  995. var home_link_namespaceObject = {};
  996. __webpack_require__.r(home_link_namespaceObject);
  997. __webpack_require__.d(home_link_namespaceObject, {
  998. "metadata": function() { return home_link_metadata; },
  999. "name": function() { return home_link_name; },
  1000. "settings": function() { return home_link_settings; }
  1001. });
  1002. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/html/index.js
  1003. var build_module_html_namespaceObject = {};
  1004. __webpack_require__.r(build_module_html_namespaceObject);
  1005. __webpack_require__.d(build_module_html_namespaceObject, {
  1006. "metadata": function() { return html_metadata; },
  1007. "name": function() { return html_name; },
  1008. "settings": function() { return html_settings; }
  1009. });
  1010. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/image/index.js
  1011. var build_module_image_namespaceObject = {};
  1012. __webpack_require__.r(build_module_image_namespaceObject);
  1013. __webpack_require__.d(build_module_image_namespaceObject, {
  1014. "metadata": function() { return image_metadata; },
  1015. "name": function() { return image_name; },
  1016. "settings": function() { return image_settings; }
  1017. });
  1018. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js
  1019. var latest_comments_namespaceObject = {};
  1020. __webpack_require__.r(latest_comments_namespaceObject);
  1021. __webpack_require__.d(latest_comments_namespaceObject, {
  1022. "metadata": function() { return latest_comments_metadata; },
  1023. "name": function() { return latest_comments_name; },
  1024. "settings": function() { return latest_comments_settings; }
  1025. });
  1026. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js
  1027. var latest_posts_namespaceObject = {};
  1028. __webpack_require__.r(latest_posts_namespaceObject);
  1029. __webpack_require__.d(latest_posts_namespaceObject, {
  1030. "metadata": function() { return latest_posts_metadata; },
  1031. "name": function() { return latest_posts_name; },
  1032. "settings": function() { return latest_posts_settings; }
  1033. });
  1034. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/list/index.js
  1035. var build_module_list_namespaceObject = {};
  1036. __webpack_require__.r(build_module_list_namespaceObject);
  1037. __webpack_require__.d(build_module_list_namespaceObject, {
  1038. "metadata": function() { return list_metadata; },
  1039. "name": function() { return list_name; },
  1040. "settings": function() { return list_settings; }
  1041. });
  1042. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/loginout/index.js
  1043. var loginout_namespaceObject = {};
  1044. __webpack_require__.r(loginout_namespaceObject);
  1045. __webpack_require__.d(loginout_namespaceObject, {
  1046. "metadata": function() { return loginout_metadata; },
  1047. "name": function() { return loginout_name; },
  1048. "settings": function() { return loginout_settings; }
  1049. });
  1050. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/media-text/index.js
  1051. var media_text_namespaceObject = {};
  1052. __webpack_require__.r(media_text_namespaceObject);
  1053. __webpack_require__.d(media_text_namespaceObject, {
  1054. "metadata": function() { return media_text_metadata; },
  1055. "name": function() { return media_text_name; },
  1056. "settings": function() { return media_text_settings; }
  1057. });
  1058. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/missing/index.js
  1059. var missing_namespaceObject = {};
  1060. __webpack_require__.r(missing_namespaceObject);
  1061. __webpack_require__.d(missing_namespaceObject, {
  1062. "metadata": function() { return missing_metadata; },
  1063. "name": function() { return missing_name; },
  1064. "settings": function() { return missing_settings; }
  1065. });
  1066. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/more/index.js
  1067. var build_module_more_namespaceObject = {};
  1068. __webpack_require__.r(build_module_more_namespaceObject);
  1069. __webpack_require__.d(build_module_more_namespaceObject, {
  1070. "metadata": function() { return more_metadata; },
  1071. "name": function() { return more_name; },
  1072. "settings": function() { return more_settings; }
  1073. });
  1074. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation/index.js
  1075. var build_module_navigation_namespaceObject = {};
  1076. __webpack_require__.r(build_module_navigation_namespaceObject);
  1077. __webpack_require__.d(build_module_navigation_namespaceObject, {
  1078. "metadata": function() { return navigation_metadata; },
  1079. "name": function() { return navigation_name; },
  1080. "settings": function() { return navigation_settings; }
  1081. });
  1082. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-link/index.js
  1083. var navigation_link_namespaceObject = {};
  1084. __webpack_require__.r(navigation_link_namespaceObject);
  1085. __webpack_require__.d(navigation_link_namespaceObject, {
  1086. "metadata": function() { return navigation_link_metadata; },
  1087. "name": function() { return navigation_link_name; },
  1088. "settings": function() { return navigation_link_settings; }
  1089. });
  1090. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/index.js
  1091. var navigation_submenu_namespaceObject = {};
  1092. __webpack_require__.r(navigation_submenu_namespaceObject);
  1093. __webpack_require__.d(navigation_submenu_namespaceObject, {
  1094. "metadata": function() { return navigation_submenu_metadata; },
  1095. "name": function() { return navigation_submenu_name; },
  1096. "settings": function() { return navigation_submenu_settings; }
  1097. });
  1098. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/nextpage/index.js
  1099. var nextpage_namespaceObject = {};
  1100. __webpack_require__.r(nextpage_namespaceObject);
  1101. __webpack_require__.d(nextpage_namespaceObject, {
  1102. "metadata": function() { return nextpage_metadata; },
  1103. "name": function() { return nextpage_name; },
  1104. "settings": function() { return nextpage_settings; }
  1105. });
  1106. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pattern/index.js
  1107. var pattern_namespaceObject = {};
  1108. __webpack_require__.r(pattern_namespaceObject);
  1109. __webpack_require__.d(pattern_namespaceObject, {
  1110. "metadata": function() { return pattern_metadata; },
  1111. "name": function() { return pattern_name; },
  1112. "settings": function() { return pattern_settings; }
  1113. });
  1114. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/page-list/index.js
  1115. var page_list_namespaceObject = {};
  1116. __webpack_require__.r(page_list_namespaceObject);
  1117. __webpack_require__.d(page_list_namespaceObject, {
  1118. "metadata": function() { return page_list_metadata; },
  1119. "name": function() { return page_list_name; },
  1120. "settings": function() { return page_list_settings; }
  1121. });
  1122. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js
  1123. var build_module_paragraph_namespaceObject = {};
  1124. __webpack_require__.r(build_module_paragraph_namespaceObject);
  1125. __webpack_require__.d(build_module_paragraph_namespaceObject, {
  1126. "metadata": function() { return paragraph_metadata; },
  1127. "name": function() { return paragraph_name; },
  1128. "settings": function() { return paragraph_settings; }
  1129. });
  1130. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author/index.js
  1131. var build_module_post_author_namespaceObject = {};
  1132. __webpack_require__.r(build_module_post_author_namespaceObject);
  1133. __webpack_require__.d(build_module_post_author_namespaceObject, {
  1134. "metadata": function() { return post_author_metadata; },
  1135. "name": function() { return post_author_name; },
  1136. "settings": function() { return post_author_settings; }
  1137. });
  1138. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author-biography/index.js
  1139. var post_author_biography_namespaceObject = {};
  1140. __webpack_require__.r(post_author_biography_namespaceObject);
  1141. __webpack_require__.d(post_author_biography_namespaceObject, {
  1142. "metadata": function() { return post_author_biography_metadata; },
  1143. "name": function() { return post_author_biography_name; },
  1144. "settings": function() { return post_author_biography_settings; }
  1145. });
  1146. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments/index.js
  1147. var build_module_post_comments_namespaceObject = {};
  1148. __webpack_require__.r(build_module_post_comments_namespaceObject);
  1149. __webpack_require__.d(build_module_post_comments_namespaceObject, {
  1150. "metadata": function() { return post_comments_metadata; },
  1151. "name": function() { return post_comments_name; },
  1152. "settings": function() { return post_comments_settings; }
  1153. });
  1154. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-form/index.js
  1155. var build_module_post_comments_form_namespaceObject = {};
  1156. __webpack_require__.r(build_module_post_comments_form_namespaceObject);
  1157. __webpack_require__.d(build_module_post_comments_form_namespaceObject, {
  1158. "metadata": function() { return post_comments_form_metadata; },
  1159. "name": function() { return post_comments_form_name; },
  1160. "settings": function() { return post_comments_form_settings; }
  1161. });
  1162. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-content/index.js
  1163. var build_module_post_content_namespaceObject = {};
  1164. __webpack_require__.r(build_module_post_content_namespaceObject);
  1165. __webpack_require__.d(build_module_post_content_namespaceObject, {
  1166. "metadata": function() { return post_content_metadata; },
  1167. "name": function() { return post_content_name; },
  1168. "settings": function() { return post_content_settings; }
  1169. });
  1170. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-date/index.js
  1171. var build_module_post_date_namespaceObject = {};
  1172. __webpack_require__.r(build_module_post_date_namespaceObject);
  1173. __webpack_require__.d(build_module_post_date_namespaceObject, {
  1174. "metadata": function() { return post_date_metadata; },
  1175. "name": function() { return post_date_name; },
  1176. "settings": function() { return post_date_settings; }
  1177. });
  1178. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js
  1179. var build_module_post_excerpt_namespaceObject = {};
  1180. __webpack_require__.r(build_module_post_excerpt_namespaceObject);
  1181. __webpack_require__.d(build_module_post_excerpt_namespaceObject, {
  1182. "metadata": function() { return post_excerpt_metadata; },
  1183. "name": function() { return post_excerpt_name; },
  1184. "settings": function() { return post_excerpt_settings; }
  1185. });
  1186. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js
  1187. var build_module_post_featured_image_namespaceObject = {};
  1188. __webpack_require__.r(build_module_post_featured_image_namespaceObject);
  1189. __webpack_require__.d(build_module_post_featured_image_namespaceObject, {
  1190. "metadata": function() { return post_featured_image_metadata; },
  1191. "name": function() { return post_featured_image_name; },
  1192. "settings": function() { return post_featured_image_settings; }
  1193. });
  1194. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js
  1195. var post_navigation_link_namespaceObject = {};
  1196. __webpack_require__.r(post_navigation_link_namespaceObject);
  1197. __webpack_require__.d(post_navigation_link_namespaceObject, {
  1198. "metadata": function() { return post_navigation_link_metadata; },
  1199. "name": function() { return post_navigation_link_name; },
  1200. "settings": function() { return post_navigation_link_settings; }
  1201. });
  1202. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-template/index.js
  1203. var post_template_namespaceObject = {};
  1204. __webpack_require__.r(post_template_namespaceObject);
  1205. __webpack_require__.d(post_template_namespaceObject, {
  1206. "metadata": function() { return post_template_metadata; },
  1207. "name": function() { return post_template_name; },
  1208. "settings": function() { return post_template_settings; }
  1209. });
  1210. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-terms/index.js
  1211. var build_module_post_terms_namespaceObject = {};
  1212. __webpack_require__.r(build_module_post_terms_namespaceObject);
  1213. __webpack_require__.d(build_module_post_terms_namespaceObject, {
  1214. "metadata": function() { return post_terms_metadata; },
  1215. "name": function() { return post_terms_name; },
  1216. "settings": function() { return post_terms_settings; }
  1217. });
  1218. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-title/index.js
  1219. var build_module_post_title_namespaceObject = {};
  1220. __webpack_require__.r(build_module_post_title_namespaceObject);
  1221. __webpack_require__.d(build_module_post_title_namespaceObject, {
  1222. "metadata": function() { return post_title_metadata; },
  1223. "name": function() { return post_title_name; },
  1224. "settings": function() { return post_title_settings; }
  1225. });
  1226. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/preformatted/index.js
  1227. var build_module_preformatted_namespaceObject = {};
  1228. __webpack_require__.r(build_module_preformatted_namespaceObject);
  1229. __webpack_require__.d(build_module_preformatted_namespaceObject, {
  1230. "metadata": function() { return preformatted_metadata; },
  1231. "name": function() { return preformatted_name; },
  1232. "settings": function() { return preformatted_settings; }
  1233. });
  1234. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pullquote/index.js
  1235. var build_module_pullquote_namespaceObject = {};
  1236. __webpack_require__.r(build_module_pullquote_namespaceObject);
  1237. __webpack_require__.d(build_module_pullquote_namespaceObject, {
  1238. "metadata": function() { return pullquote_metadata; },
  1239. "name": function() { return pullquote_name; },
  1240. "settings": function() { return pullquote_settings; }
  1241. });
  1242. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query/index.js
  1243. var query_namespaceObject = {};
  1244. __webpack_require__.r(query_namespaceObject);
  1245. __webpack_require__.d(query_namespaceObject, {
  1246. "metadata": function() { return query_metadata; },
  1247. "name": function() { return query_name; },
  1248. "settings": function() { return query_settings; }
  1249. });
  1250. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-no-results/index.js
  1251. var query_no_results_namespaceObject = {};
  1252. __webpack_require__.r(query_no_results_namespaceObject);
  1253. __webpack_require__.d(query_no_results_namespaceObject, {
  1254. "metadata": function() { return query_no_results_metadata; },
  1255. "name": function() { return query_no_results_name; },
  1256. "settings": function() { return query_no_results_settings; }
  1257. });
  1258. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js
  1259. var build_module_query_pagination_namespaceObject = {};
  1260. __webpack_require__.r(build_module_query_pagination_namespaceObject);
  1261. __webpack_require__.d(build_module_query_pagination_namespaceObject, {
  1262. "metadata": function() { return query_pagination_metadata; },
  1263. "name": function() { return query_pagination_name; },
  1264. "settings": function() { return query_pagination_settings; }
  1265. });
  1266. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js
  1267. var build_module_query_pagination_next_namespaceObject = {};
  1268. __webpack_require__.r(build_module_query_pagination_next_namespaceObject);
  1269. __webpack_require__.d(build_module_query_pagination_next_namespaceObject, {
  1270. "metadata": function() { return query_pagination_next_metadata; },
  1271. "name": function() { return query_pagination_next_name; },
  1272. "settings": function() { return query_pagination_next_settings; }
  1273. });
  1274. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js
  1275. var build_module_query_pagination_numbers_namespaceObject = {};
  1276. __webpack_require__.r(build_module_query_pagination_numbers_namespaceObject);
  1277. __webpack_require__.d(build_module_query_pagination_numbers_namespaceObject, {
  1278. "metadata": function() { return query_pagination_numbers_metadata; },
  1279. "name": function() { return query_pagination_numbers_name; },
  1280. "settings": function() { return query_pagination_numbers_settings; }
  1281. });
  1282. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js
  1283. var build_module_query_pagination_previous_namespaceObject = {};
  1284. __webpack_require__.r(build_module_query_pagination_previous_namespaceObject);
  1285. __webpack_require__.d(build_module_query_pagination_previous_namespaceObject, {
  1286. "metadata": function() { return query_pagination_previous_metadata; },
  1287. "name": function() { return query_pagination_previous_name; },
  1288. "settings": function() { return query_pagination_previous_settings; }
  1289. });
  1290. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-title/index.js
  1291. var build_module_query_title_namespaceObject = {};
  1292. __webpack_require__.r(build_module_query_title_namespaceObject);
  1293. __webpack_require__.d(build_module_query_title_namespaceObject, {
  1294. "metadata": function() { return query_title_metadata; },
  1295. "name": function() { return query_title_name; },
  1296. "settings": function() { return query_title_settings; }
  1297. });
  1298. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/quote/index.js
  1299. var build_module_quote_namespaceObject = {};
  1300. __webpack_require__.r(build_module_quote_namespaceObject);
  1301. __webpack_require__.d(build_module_quote_namespaceObject, {
  1302. "metadata": function() { return quote_metadata; },
  1303. "name": function() { return quote_name; },
  1304. "settings": function() { return quote_settings; },
  1305. "settingsV1": function() { return quote_settingsV1; }
  1306. });
  1307. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/block/index.js
  1308. var block_namespaceObject = {};
  1309. __webpack_require__.r(block_namespaceObject);
  1310. __webpack_require__.d(block_namespaceObject, {
  1311. "metadata": function() { return block_metadata; },
  1312. "name": function() { return block_name; },
  1313. "settings": function() { return block_settings; }
  1314. });
  1315. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/read-more/index.js
  1316. var read_more_namespaceObject = {};
  1317. __webpack_require__.r(read_more_namespaceObject);
  1318. __webpack_require__.d(read_more_namespaceObject, {
  1319. "metadata": function() { return read_more_metadata; },
  1320. "name": function() { return read_more_name; },
  1321. "settings": function() { return read_more_settings; }
  1322. });
  1323. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/rss/index.js
  1324. var build_module_rss_namespaceObject = {};
  1325. __webpack_require__.r(build_module_rss_namespaceObject);
  1326. __webpack_require__.d(build_module_rss_namespaceObject, {
  1327. "metadata": function() { return rss_metadata; },
  1328. "name": function() { return rss_name; },
  1329. "settings": function() { return rss_settings; }
  1330. });
  1331. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/search/index.js
  1332. var build_module_search_namespaceObject = {};
  1333. __webpack_require__.r(build_module_search_namespaceObject);
  1334. __webpack_require__.d(build_module_search_namespaceObject, {
  1335. "metadata": function() { return search_metadata; },
  1336. "name": function() { return search_name; },
  1337. "settings": function() { return search_settings; }
  1338. });
  1339. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/separator/index.js
  1340. var build_module_separator_namespaceObject = {};
  1341. __webpack_require__.r(build_module_separator_namespaceObject);
  1342. __webpack_require__.d(build_module_separator_namespaceObject, {
  1343. "metadata": function() { return separator_metadata; },
  1344. "name": function() { return separator_name; },
  1345. "settings": function() { return separator_settings; }
  1346. });
  1347. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/shortcode/index.js
  1348. var build_module_shortcode_namespaceObject = {};
  1349. __webpack_require__.r(build_module_shortcode_namespaceObject);
  1350. __webpack_require__.d(build_module_shortcode_namespaceObject, {
  1351. "metadata": function() { return shortcode_metadata; },
  1352. "name": function() { return shortcode_name; },
  1353. "settings": function() { return shortcode_settings; }
  1354. });
  1355. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-logo/index.js
  1356. var build_module_site_logo_namespaceObject = {};
  1357. __webpack_require__.r(build_module_site_logo_namespaceObject);
  1358. __webpack_require__.d(build_module_site_logo_namespaceObject, {
  1359. "metadata": function() { return site_logo_metadata; },
  1360. "name": function() { return site_logo_name; },
  1361. "settings": function() { return site_logo_settings; }
  1362. });
  1363. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js
  1364. var site_tagline_namespaceObject = {};
  1365. __webpack_require__.r(site_tagline_namespaceObject);
  1366. __webpack_require__.d(site_tagline_namespaceObject, {
  1367. "metadata": function() { return site_tagline_metadata; },
  1368. "name": function() { return site_tagline_name; },
  1369. "settings": function() { return site_tagline_settings; }
  1370. });
  1371. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-title/index.js
  1372. var site_title_namespaceObject = {};
  1373. __webpack_require__.r(site_title_namespaceObject);
  1374. __webpack_require__.d(site_title_namespaceObject, {
  1375. "metadata": function() { return site_title_metadata; },
  1376. "name": function() { return site_title_name; },
  1377. "settings": function() { return site_title_settings; }
  1378. });
  1379. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-link/index.js
  1380. var social_link_namespaceObject = {};
  1381. __webpack_require__.r(social_link_namespaceObject);
  1382. __webpack_require__.d(social_link_namespaceObject, {
  1383. "metadata": function() { return social_link_metadata; },
  1384. "name": function() { return social_link_name; },
  1385. "settings": function() { return social_link_settings; }
  1386. });
  1387. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-links/index.js
  1388. var social_links_namespaceObject = {};
  1389. __webpack_require__.r(social_links_namespaceObject);
  1390. __webpack_require__.d(social_links_namespaceObject, {
  1391. "metadata": function() { return social_links_metadata; },
  1392. "name": function() { return social_links_name; },
  1393. "settings": function() { return social_links_settings; }
  1394. });
  1395. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/spacer/index.js
  1396. var spacer_namespaceObject = {};
  1397. __webpack_require__.r(spacer_namespaceObject);
  1398. __webpack_require__.d(spacer_namespaceObject, {
  1399. "metadata": function() { return spacer_metadata; },
  1400. "name": function() { return spacer_name; },
  1401. "settings": function() { return spacer_settings; }
  1402. });
  1403. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/table/index.js
  1404. var build_module_table_namespaceObject = {};
  1405. __webpack_require__.r(build_module_table_namespaceObject);
  1406. __webpack_require__.d(build_module_table_namespaceObject, {
  1407. "metadata": function() { return table_metadata; },
  1408. "name": function() { return table_name; },
  1409. "settings": function() { return table_settings; }
  1410. });
  1411. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js
  1412. var tag_cloud_namespaceObject = {};
  1413. __webpack_require__.r(tag_cloud_namespaceObject);
  1414. __webpack_require__.d(tag_cloud_namespaceObject, {
  1415. "metadata": function() { return tag_cloud_metadata; },
  1416. "name": function() { return tag_cloud_name; },
  1417. "settings": function() { return tag_cloud_settings; }
  1418. });
  1419. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/template-part/index.js
  1420. var template_part_namespaceObject = {};
  1421. __webpack_require__.r(template_part_namespaceObject);
  1422. __webpack_require__.d(template_part_namespaceObject, {
  1423. "metadata": function() { return template_part_metadata; },
  1424. "name": function() { return template_part_name; },
  1425. "settings": function() { return template_part_settings; }
  1426. });
  1427. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/term-description/index.js
  1428. var build_module_term_description_namespaceObject = {};
  1429. __webpack_require__.r(build_module_term_description_namespaceObject);
  1430. __webpack_require__.d(build_module_term_description_namespaceObject, {
  1431. "metadata": function() { return term_description_metadata; },
  1432. "name": function() { return term_description_name; },
  1433. "settings": function() { return term_description_settings; }
  1434. });
  1435. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js
  1436. var text_columns_namespaceObject = {};
  1437. __webpack_require__.r(text_columns_namespaceObject);
  1438. __webpack_require__.d(text_columns_namespaceObject, {
  1439. "metadata": function() { return text_columns_metadata; },
  1440. "name": function() { return text_columns_name; },
  1441. "settings": function() { return text_columns_settings; }
  1442. });
  1443. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/verse/index.js
  1444. var build_module_verse_namespaceObject = {};
  1445. __webpack_require__.r(build_module_verse_namespaceObject);
  1446. __webpack_require__.d(build_module_verse_namespaceObject, {
  1447. "metadata": function() { return verse_metadata; },
  1448. "name": function() { return verse_name; },
  1449. "settings": function() { return verse_settings; }
  1450. });
  1451. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/video/index.js
  1452. var build_module_video_namespaceObject = {};
  1453. __webpack_require__.r(build_module_video_namespaceObject);
  1454. __webpack_require__.d(build_module_video_namespaceObject, {
  1455. "metadata": function() { return video_metadata; },
  1456. "name": function() { return video_name; },
  1457. "settings": function() { return video_settings; }
  1458. });
  1459. ;// CONCATENATED MODULE: external ["wp","blocks"]
  1460. var external_wp_blocks_namespaceObject = window["wp"]["blocks"];
  1461. ;// CONCATENATED MODULE: external ["wp","element"]
  1462. var external_wp_element_namespaceObject = window["wp"]["element"];
  1463. ;// CONCATENATED MODULE: external ["wp","primitives"]
  1464. var external_wp_primitives_namespaceObject = window["wp"]["primitives"];
  1465. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/archive.js
  1466. /**
  1467. * WordPress dependencies
  1468. */
  1469. const archive = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  1470. viewBox: "0 0 24 24",
  1471. xmlns: "http://www.w3.org/2000/svg"
  1472. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  1473. d: "M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5zM8 12.8h8v-1.5H8v1.5zm0 3h8v-1.5H8v1.5z"
  1474. }));
  1475. /* harmony default export */ var library_archive = (archive);
  1476. ;// CONCATENATED MODULE: external ["wp","components"]
  1477. var external_wp_components_namespaceObject = window["wp"]["components"];
  1478. ;// CONCATENATED MODULE: external ["wp","i18n"]
  1479. var external_wp_i18n_namespaceObject = window["wp"]["i18n"];
  1480. ;// CONCATENATED MODULE: external ["wp","blockEditor"]
  1481. var external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
  1482. ;// CONCATENATED MODULE: external ["wp","serverSideRender"]
  1483. var external_wp_serverSideRender_namespaceObject = window["wp"]["serverSideRender"];
  1484. var external_wp_serverSideRender_default = /*#__PURE__*/__webpack_require__.n(external_wp_serverSideRender_namespaceObject);
  1485. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/archives/edit.js
  1486. /**
  1487. * WordPress dependencies
  1488. */
  1489. function ArchivesEdit(_ref) {
  1490. let {
  1491. attributes,
  1492. setAttributes
  1493. } = _ref;
  1494. const {
  1495. showPostCounts,
  1496. displayAsDropdown,
  1497. type
  1498. } = attributes;
  1499. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  1500. title: (0,external_wp_i18n_namespaceObject.__)('Archives settings')
  1501. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  1502. label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'),
  1503. checked: displayAsDropdown,
  1504. onChange: () => setAttributes({
  1505. displayAsDropdown: !displayAsDropdown
  1506. })
  1507. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  1508. label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'),
  1509. checked: showPostCounts,
  1510. onChange: () => setAttributes({
  1511. showPostCounts: !showPostCounts
  1512. })
  1513. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  1514. label: (0,external_wp_i18n_namespaceObject.__)('Group by:'),
  1515. options: [{
  1516. label: (0,external_wp_i18n_namespaceObject.__)('Year'),
  1517. value: 'yearly'
  1518. }, {
  1519. label: (0,external_wp_i18n_namespaceObject.__)('Month'),
  1520. value: 'monthly'
  1521. }, {
  1522. label: (0,external_wp_i18n_namespaceObject.__)('Week'),
  1523. value: 'weekly'
  1524. }, {
  1525. label: (0,external_wp_i18n_namespaceObject.__)('Day'),
  1526. value: 'daily'
  1527. }],
  1528. value: type,
  1529. onChange: value => setAttributes({
  1530. type: value
  1531. })
  1532. }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
  1533. block: "core/archives",
  1534. attributes: attributes
  1535. }))));
  1536. }
  1537. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/archives/index.js
  1538. /**
  1539. * WordPress dependencies
  1540. */
  1541. /**
  1542. * Internal dependencies
  1543. */
  1544. const metadata = {
  1545. $schema: "https://schemas.wp.org/trunk/block.json",
  1546. apiVersion: 2,
  1547. name: "core/archives",
  1548. title: "Archives",
  1549. category: "widgets",
  1550. description: "Display a date archive of your posts.",
  1551. textdomain: "default",
  1552. attributes: {
  1553. displayAsDropdown: {
  1554. type: "boolean",
  1555. "default": false
  1556. },
  1557. showPostCounts: {
  1558. type: "boolean",
  1559. "default": false
  1560. },
  1561. type: {
  1562. type: "string",
  1563. "default": "monthly"
  1564. }
  1565. },
  1566. supports: {
  1567. align: true,
  1568. html: false
  1569. },
  1570. editorStyle: "wp-block-archives-editor"
  1571. };
  1572. const {
  1573. name: archives_name
  1574. } = metadata;
  1575. const settings = {
  1576. icon: library_archive,
  1577. example: {},
  1578. edit: ArchivesEdit
  1579. };
  1580. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js
  1581. /**
  1582. * WordPress dependencies
  1583. */
  1584. const commentAuthorAvatar = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  1585. xmlns: "http://www.w3.org/2000/svg",
  1586. viewBox: "0 0 24 24"
  1587. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  1588. fillRule: "evenodd",
  1589. d: "M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",
  1590. clipRule: "evenodd"
  1591. }));
  1592. /* harmony default export */ var comment_author_avatar = (commentAuthorAvatar);
  1593. ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
  1594. function _extends() {
  1595. _extends = Object.assign ? Object.assign.bind() : function (target) {
  1596. for (var i = 1; i < arguments.length; i++) {
  1597. var source = arguments[i];
  1598. for (var key in source) {
  1599. if (Object.prototype.hasOwnProperty.call(source, key)) {
  1600. target[key] = source[key];
  1601. }
  1602. }
  1603. }
  1604. return target;
  1605. };
  1606. return _extends.apply(this, arguments);
  1607. }
  1608. // EXTERNAL MODULE: ./node_modules/classnames/index.js
  1609. var classnames = __webpack_require__(4403);
  1610. var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
  1611. ;// CONCATENATED MODULE: external ["wp","url"]
  1612. var external_wp_url_namespaceObject = window["wp"]["url"];
  1613. ;// CONCATENATED MODULE: external ["wp","coreData"]
  1614. var external_wp_coreData_namespaceObject = window["wp"]["coreData"];
  1615. ;// CONCATENATED MODULE: external ["wp","data"]
  1616. var external_wp_data_namespaceObject = window["wp"]["data"];
  1617. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/hooks.js
  1618. /**
  1619. * WordPress dependencies
  1620. */
  1621. function getAvatarSizes(sizes) {
  1622. const minSize = sizes ? sizes[0] : 24;
  1623. const maxSize = sizes ? sizes[sizes.length - 1] : 96;
  1624. const maxSizeBuffer = Math.floor(maxSize * 2.5);
  1625. return {
  1626. minSize,
  1627. maxSize: maxSizeBuffer
  1628. };
  1629. }
  1630. function useDefaultAvatar() {
  1631. const {
  1632. avatarURL: defaultAvatarUrl
  1633. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  1634. const {
  1635. getSettings
  1636. } = select(external_wp_blockEditor_namespaceObject.store);
  1637. const {
  1638. __experimentalDiscussionSettings
  1639. } = getSettings();
  1640. return __experimentalDiscussionSettings;
  1641. });
  1642. return defaultAvatarUrl;
  1643. }
  1644. function useCommentAvatar(_ref) {
  1645. let {
  1646. commentId
  1647. } = _ref;
  1648. const [avatars] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_avatar_urls', commentId);
  1649. const [authorName] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_name', commentId);
  1650. const avatarUrls = avatars ? Object.values(avatars) : null;
  1651. const sizes = avatars ? Object.keys(avatars) : null;
  1652. const {
  1653. minSize,
  1654. maxSize
  1655. } = getAvatarSizes(sizes);
  1656. const defaultAvatar = useDefaultAvatar();
  1657. return {
  1658. src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar,
  1659. minSize,
  1660. maxSize,
  1661. // translators: %s is the Author name.
  1662. alt: authorName ? // translators: %s is the Author name.
  1663. (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s Avatar'), authorName) : (0,external_wp_i18n_namespaceObject.__)('Default Avatar')
  1664. };
  1665. }
  1666. function useUserAvatar(_ref2) {
  1667. let {
  1668. userId,
  1669. postId,
  1670. postType
  1671. } = _ref2;
  1672. const {
  1673. authorDetails
  1674. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  1675. var _getEditedEntityRecor;
  1676. const {
  1677. getEditedEntityRecord,
  1678. getUser
  1679. } = select(external_wp_coreData_namespaceObject.store);
  1680. if (userId) {
  1681. return {
  1682. authorDetails: getUser(userId)
  1683. };
  1684. }
  1685. const _authorId = (_getEditedEntityRecor = getEditedEntityRecord('postType', postType, postId)) === null || _getEditedEntityRecor === void 0 ? void 0 : _getEditedEntityRecor.author;
  1686. return {
  1687. authorDetails: _authorId ? getUser(_authorId) : null
  1688. };
  1689. }, [postType, postId, userId]);
  1690. const avatarUrls = authorDetails && authorDetails !== null && authorDetails !== void 0 && authorDetails.avatar_urls ? Object.values(authorDetails.avatar_urls) : null;
  1691. const sizes = authorDetails && authorDetails !== null && authorDetails !== void 0 && authorDetails.avatar_urls ? Object.keys(authorDetails.avatar_urls) : null;
  1692. const {
  1693. minSize,
  1694. maxSize
  1695. } = getAvatarSizes(sizes);
  1696. const defaultAvatar = useDefaultAvatar();
  1697. return {
  1698. src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar,
  1699. minSize,
  1700. maxSize,
  1701. alt: authorDetails ? // translators: %s is the Author name.
  1702. (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s Avatar'), authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.name) : (0,external_wp_i18n_namespaceObject.__)('Default Avatar')
  1703. };
  1704. }
  1705. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/user-control.js
  1706. /**
  1707. * WordPress dependencies
  1708. */
  1709. const AUTHORS_QUERY = {
  1710. who: 'authors',
  1711. per_page: -1,
  1712. _fields: 'id,name',
  1713. context: 'view'
  1714. };
  1715. function UserControl(_ref) {
  1716. let {
  1717. value,
  1718. onChange
  1719. } = _ref;
  1720. const [filteredAuthorsList, setFilteredAuthorsList] = (0,external_wp_element_namespaceObject.useState)();
  1721. const authorsList = (0,external_wp_data_namespaceObject.useSelect)(select => {
  1722. const {
  1723. getUsers
  1724. } = select(external_wp_coreData_namespaceObject.store);
  1725. return getUsers(AUTHORS_QUERY);
  1726. }, []);
  1727. if (!authorsList) {
  1728. return null;
  1729. }
  1730. const options = authorsList.map(author => {
  1731. return {
  1732. label: author.name,
  1733. value: author.id
  1734. };
  1735. });
  1736. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ComboboxControl, {
  1737. label: (0,external_wp_i18n_namespaceObject.__)('User'),
  1738. help: (0,external_wp_i18n_namespaceObject.__)('Select the avatar user to display, if it is blank it will use the post/page author.'),
  1739. value: value,
  1740. onChange: onChange,
  1741. options: filteredAuthorsList || options,
  1742. onFilterValueChange: inputValue => setFilteredAuthorsList(options.filter(option => option.label.toLowerCase().startsWith(inputValue.toLowerCase())))
  1743. });
  1744. }
  1745. /* harmony default export */ var user_control = (UserControl);
  1746. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/edit.js
  1747. /**
  1748. * External dependencies
  1749. */
  1750. /**
  1751. * WordPress dependencies
  1752. */
  1753. /**
  1754. * Internal dependencies
  1755. */
  1756. const AvatarInspectorControls = _ref => {
  1757. let {
  1758. setAttributes,
  1759. avatar,
  1760. attributes,
  1761. selectUser
  1762. } = _ref;
  1763. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  1764. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  1765. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  1766. label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
  1767. onChange: newSize => setAttributes({
  1768. size: newSize
  1769. }),
  1770. min: avatar.minSize,
  1771. max: avatar.maxSize,
  1772. initialPosition: attributes === null || attributes === void 0 ? void 0 : attributes.size,
  1773. value: attributes === null || attributes === void 0 ? void 0 : attributes.size
  1774. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  1775. label: (0,external_wp_i18n_namespaceObject.__)('Link to user profile'),
  1776. onChange: () => setAttributes({
  1777. isLink: !attributes.isLink
  1778. }),
  1779. checked: attributes.isLink
  1780. }), attributes.isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  1781. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  1782. onChange: value => setAttributes({
  1783. linkTarget: value ? '_blank' : '_self'
  1784. }),
  1785. checked: attributes.linkTarget === '_blank'
  1786. }), selectUser && (0,external_wp_element_namespaceObject.createElement)(user_control, {
  1787. value: attributes === null || attributes === void 0 ? void 0 : attributes.userId,
  1788. onChange: value => {
  1789. setAttributes({
  1790. userId: value
  1791. });
  1792. }
  1793. })));
  1794. };
  1795. const ResizableAvatar = _ref2 => {
  1796. let {
  1797. setAttributes,
  1798. attributes,
  1799. avatar,
  1800. blockProps,
  1801. isSelected
  1802. } = _ref2;
  1803. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
  1804. const doubledSizedSrc = (0,external_wp_url_namespaceObject.addQueryArgs)((0,external_wp_url_namespaceObject.removeQueryArgs)(avatar === null || avatar === void 0 ? void 0 : avatar.src, ['s']), {
  1805. s: (attributes === null || attributes === void 0 ? void 0 : attributes.size) * 2
  1806. });
  1807. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
  1808. size: {
  1809. width: attributes.size,
  1810. height: attributes.size
  1811. },
  1812. showHandle: isSelected,
  1813. onResizeStop: (event, direction, elt, delta) => {
  1814. setAttributes({
  1815. size: parseInt(attributes.size + (delta.height || delta.width), 10)
  1816. });
  1817. },
  1818. lockAspectRatio: true,
  1819. enable: {
  1820. top: false,
  1821. right: !(0,external_wp_i18n_namespaceObject.isRTL)(),
  1822. bottom: true,
  1823. left: (0,external_wp_i18n_namespaceObject.isRTL)()
  1824. },
  1825. minWidth: avatar.minSize,
  1826. maxWidth: avatar.maxSize
  1827. }, (0,external_wp_element_namespaceObject.createElement)("img", _extends({
  1828. src: doubledSizedSrc,
  1829. alt: avatar.alt
  1830. }, borderProps, {
  1831. className: classnames_default()('avatar', 'avatar-' + attributes.size, 'photo', 'wp-block-avatar__image', borderProps.className),
  1832. style: { ...borderProps.style // Border radius, width and style.
  1833. }
  1834. }))));
  1835. };
  1836. const CommentEdit = _ref3 => {
  1837. let {
  1838. attributes,
  1839. context,
  1840. setAttributes,
  1841. isSelected
  1842. } = _ref3;
  1843. const {
  1844. commentId
  1845. } = context;
  1846. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  1847. const avatar = useCommentAvatar({
  1848. commentId
  1849. });
  1850. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(AvatarInspectorControls, {
  1851. avatar: avatar,
  1852. setAttributes: setAttributes,
  1853. attributes: attributes,
  1854. selectUser: false
  1855. }), attributes.isLink ? (0,external_wp_element_namespaceObject.createElement)("a", {
  1856. href: "#avatar-pseudo-link",
  1857. className: "wp-block-avatar__link",
  1858. onClick: event => event.preventDefault()
  1859. }, (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, {
  1860. attributes: attributes,
  1861. avatar: avatar,
  1862. blockProps: blockProps,
  1863. isSelected: isSelected,
  1864. setAttributes: setAttributes
  1865. })) : (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, {
  1866. attributes: attributes,
  1867. avatar: avatar,
  1868. blockProps: blockProps,
  1869. isSelected: isSelected,
  1870. setAttributes: setAttributes
  1871. }));
  1872. };
  1873. const UserEdit = _ref4 => {
  1874. let {
  1875. attributes,
  1876. context,
  1877. setAttributes,
  1878. isSelected
  1879. } = _ref4;
  1880. const {
  1881. postId,
  1882. postType
  1883. } = context;
  1884. const avatar = useUserAvatar({
  1885. userId: attributes === null || attributes === void 0 ? void 0 : attributes.userId,
  1886. postId,
  1887. postType
  1888. });
  1889. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  1890. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(AvatarInspectorControls, {
  1891. selectUser: true,
  1892. attributes: attributes,
  1893. avatar: avatar,
  1894. setAttributes: setAttributes
  1895. }), (0,external_wp_element_namespaceObject.createElement)("div", null, attributes.isLink ? (0,external_wp_element_namespaceObject.createElement)("a", {
  1896. href: "#avatar-pseudo-link",
  1897. className: "wp-block-avatar__link",
  1898. onClick: event => event.preventDefault()
  1899. }, (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, {
  1900. attributes: attributes,
  1901. avatar: avatar,
  1902. blockProps: blockProps,
  1903. isSelected: isSelected,
  1904. setAttributes: setAttributes
  1905. })) : (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, {
  1906. attributes: attributes,
  1907. avatar: avatar,
  1908. blockProps: blockProps,
  1909. isSelected: isSelected,
  1910. setAttributes: setAttributes
  1911. })));
  1912. };
  1913. function Edit(props) {
  1914. var _props$context, _props$context2;
  1915. // Don't show the Comment Edit controls if we have a comment ID set, or if we're in the Site Editor (where it is `null`).
  1916. if (props !== null && props !== void 0 && (_props$context = props.context) !== null && _props$context !== void 0 && _props$context.commentId || (props === null || props === void 0 ? void 0 : (_props$context2 = props.context) === null || _props$context2 === void 0 ? void 0 : _props$context2.commentId) === null) {
  1917. return (0,external_wp_element_namespaceObject.createElement)(CommentEdit, props);
  1918. }
  1919. return (0,external_wp_element_namespaceObject.createElement)(UserEdit, props);
  1920. }
  1921. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/index.js
  1922. /**
  1923. * WordPress dependencies
  1924. */
  1925. /**
  1926. * Internal dependencies
  1927. */
  1928. const avatar_metadata = {
  1929. $schema: "https://schemas.wp.org/trunk/block.json",
  1930. apiVersion: 2,
  1931. name: "core/avatar",
  1932. title: "Avatar",
  1933. category: "theme",
  1934. description: "Add a user's avatar.",
  1935. textdomain: "default",
  1936. attributes: {
  1937. userId: {
  1938. type: "number"
  1939. },
  1940. size: {
  1941. type: "number",
  1942. "default": 96
  1943. },
  1944. isLink: {
  1945. type: "boolean",
  1946. "default": false
  1947. },
  1948. linkTarget: {
  1949. type: "string",
  1950. "default": "_self"
  1951. }
  1952. },
  1953. usesContext: ["postType", "postId", "commentId"],
  1954. supports: {
  1955. html: false,
  1956. align: true,
  1957. alignWide: false,
  1958. spacing: {
  1959. margin: true
  1960. },
  1961. __experimentalBorder: {
  1962. __experimentalSkipSerialization: true,
  1963. radius: true,
  1964. width: true,
  1965. color: true,
  1966. style: true,
  1967. __experimentalDefaultControls: {
  1968. radius: true
  1969. }
  1970. },
  1971. color: {
  1972. text: false,
  1973. background: false,
  1974. __experimentalDuotone: "img"
  1975. }
  1976. },
  1977. editorStyle: "wp-block-avatar",
  1978. style: "wp-block-avatar"
  1979. };
  1980. const {
  1981. name: avatar_name
  1982. } = avatar_metadata;
  1983. const avatar_settings = {
  1984. icon: comment_author_avatar,
  1985. edit: Edit
  1986. };
  1987. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/audio.js
  1988. /**
  1989. * WordPress dependencies
  1990. */
  1991. const audio = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  1992. viewBox: "0 0 24 24",
  1993. xmlns: "http://www.w3.org/2000/svg"
  1994. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  1995. d: "M17.7 4.3c-1.2 0-2.8 0-3.8 1-.6.6-.9 1.5-.9 2.6V14c-.6-.6-1.5-1-2.5-1C8.6 13 7 14.6 7 16.5S8.6 20 10.5 20c1.5 0 2.8-1 3.3-2.3.5-.8.7-1.8.7-2.5V7.9c0-.7.2-1.2.5-1.6.6-.6 1.8-.6 2.8-.6h.3V4.3h-.4z"
  1996. }));
  1997. /* harmony default export */ var library_audio = (audio);
  1998. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/deprecated.js
  1999. /**
  2000. * WordPress dependencies
  2001. */
  2002. /* harmony default export */ var deprecated = ([{
  2003. attributes: {
  2004. src: {
  2005. type: 'string',
  2006. source: 'attribute',
  2007. selector: 'audio',
  2008. attribute: 'src'
  2009. },
  2010. caption: {
  2011. type: 'string',
  2012. source: 'html',
  2013. selector: 'figcaption'
  2014. },
  2015. id: {
  2016. type: 'number'
  2017. },
  2018. autoplay: {
  2019. type: 'boolean',
  2020. source: 'attribute',
  2021. selector: 'audio',
  2022. attribute: 'autoplay'
  2023. },
  2024. loop: {
  2025. type: 'boolean',
  2026. source: 'attribute',
  2027. selector: 'audio',
  2028. attribute: 'loop'
  2029. },
  2030. preload: {
  2031. type: 'string',
  2032. source: 'attribute',
  2033. selector: 'audio',
  2034. attribute: 'preload'
  2035. }
  2036. },
  2037. supports: {
  2038. align: true
  2039. },
  2040. save(_ref) {
  2041. let {
  2042. attributes
  2043. } = _ref;
  2044. const {
  2045. autoplay,
  2046. caption,
  2047. loop,
  2048. preload,
  2049. src
  2050. } = attributes;
  2051. return (0,external_wp_element_namespaceObject.createElement)("figure", null, (0,external_wp_element_namespaceObject.createElement)("audio", {
  2052. controls: "controls",
  2053. src: src,
  2054. autoPlay: autoplay,
  2055. loop: loop,
  2056. preload: preload
  2057. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  2058. tagName: "figcaption",
  2059. value: caption
  2060. }));
  2061. }
  2062. }]);
  2063. ;// CONCATENATED MODULE: external ["wp","blob"]
  2064. var external_wp_blob_namespaceObject = window["wp"]["blob"];
  2065. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/constants.js
  2066. const ASPECT_RATIOS = [// Common video resolutions.
  2067. {
  2068. ratio: '2.33',
  2069. className: 'wp-embed-aspect-21-9'
  2070. }, {
  2071. ratio: '2.00',
  2072. className: 'wp-embed-aspect-18-9'
  2073. }, {
  2074. ratio: '1.78',
  2075. className: 'wp-embed-aspect-16-9'
  2076. }, {
  2077. ratio: '1.33',
  2078. className: 'wp-embed-aspect-4-3'
  2079. }, // Vertical video and instagram square video support.
  2080. {
  2081. ratio: '1.00',
  2082. className: 'wp-embed-aspect-1-1'
  2083. }, {
  2084. ratio: '0.56',
  2085. className: 'wp-embed-aspect-9-16'
  2086. }, {
  2087. ratio: '0.50',
  2088. className: 'wp-embed-aspect-1-2'
  2089. }];
  2090. const WP_EMBED_TYPE = 'wp-embed';
  2091. ;// CONCATENATED MODULE: external "lodash"
  2092. var external_lodash_namespaceObject = window["lodash"];
  2093. // EXTERNAL MODULE: ./node_modules/classnames/dedupe.js
  2094. var dedupe = __webpack_require__(3827);
  2095. var dedupe_default = /*#__PURE__*/__webpack_require__.n(dedupe);
  2096. // EXTERNAL MODULE: ./node_modules/memize/index.js
  2097. var memize = __webpack_require__(9756);
  2098. var memize_default = /*#__PURE__*/__webpack_require__.n(memize);
  2099. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/util.js
  2100. /**
  2101. * Internal dependencies
  2102. */
  2103. /**
  2104. * External dependencies
  2105. */
  2106. /**
  2107. * WordPress dependencies
  2108. */
  2109. /**
  2110. * Internal dependencies
  2111. */
  2112. const util_metadata = {
  2113. $schema: "https://schemas.wp.org/trunk/block.json",
  2114. apiVersion: 2,
  2115. name: "core/embed",
  2116. title: "Embed",
  2117. category: "embed",
  2118. description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.",
  2119. textdomain: "default",
  2120. attributes: {
  2121. url: {
  2122. type: "string"
  2123. },
  2124. caption: {
  2125. type: "string",
  2126. source: "html",
  2127. selector: "figcaption"
  2128. },
  2129. type: {
  2130. type: "string"
  2131. },
  2132. providerNameSlug: {
  2133. type: "string"
  2134. },
  2135. allowResponsive: {
  2136. type: "boolean",
  2137. "default": true
  2138. },
  2139. responsive: {
  2140. type: "boolean",
  2141. "default": false
  2142. },
  2143. previewable: {
  2144. type: "boolean",
  2145. "default": true
  2146. }
  2147. },
  2148. supports: {
  2149. align: true
  2150. },
  2151. editorStyle: "wp-block-embed-editor",
  2152. style: "wp-block-embed"
  2153. };
  2154. const {
  2155. name: DEFAULT_EMBED_BLOCK
  2156. } = util_metadata;
  2157. /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
  2158. /**
  2159. * Returns the embed block's information by matching the provided service provider
  2160. *
  2161. * @param {string} provider The embed block's provider
  2162. * @return {WPBlockVariation} The embed block's information
  2163. */
  2164. const getEmbedInfoByProvider = provider => {
  2165. var _getBlockVariations;
  2166. return (_getBlockVariations = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations === void 0 ? void 0 : _getBlockVariations.find(_ref => {
  2167. let {
  2168. name
  2169. } = _ref;
  2170. return name === provider;
  2171. });
  2172. };
  2173. /**
  2174. * Returns true if any of the regular expressions match the URL.
  2175. *
  2176. * @param {string} url The URL to test.
  2177. * @param {Array} patterns The list of regular expressions to test agains.
  2178. * @return {boolean} True if any of the regular expressions match the URL.
  2179. */
  2180. const matchesPatterns = function (url) {
  2181. let patterns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  2182. return patterns.some(pattern => url.match(pattern));
  2183. };
  2184. /**
  2185. * Finds the block variation that should be used for the URL,
  2186. * based on the provided URL and the variation's patterns.
  2187. *
  2188. * @param {string} url The URL to test.
  2189. * @return {WPBlockVariation} The block variation that should be used for this URL
  2190. */
  2191. const findMoreSuitableBlock = url => {
  2192. var _getBlockVariations2;
  2193. return (_getBlockVariations2 = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations2 === void 0 ? void 0 : _getBlockVariations2.find(_ref2 => {
  2194. let {
  2195. patterns
  2196. } = _ref2;
  2197. return matchesPatterns(url, patterns);
  2198. });
  2199. };
  2200. const isFromWordPress = html => html && html.includes('class="wp-embedded-content"');
  2201. const getPhotoHtml = photo => {
  2202. // 100% width for the preview so it fits nicely into the document, some "thumbnails" are
  2203. // actually the full size photo. If thumbnails not found, use full image.
  2204. const imageUrl = photo.thumbnail_url || photo.url;
  2205. const photoPreview = (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_element_namespaceObject.createElement)("img", {
  2206. src: imageUrl,
  2207. alt: photo.title,
  2208. width: "100%"
  2209. }));
  2210. return (0,external_wp_element_namespaceObject.renderToString)(photoPreview);
  2211. };
  2212. /**
  2213. * Creates a more suitable embed block based on the passed in props
  2214. * and attributes generated from an embed block's preview.
  2215. *
  2216. * We require `attributesFromPreview` to be generated from the latest attributes
  2217. * and preview, and because of the way the react lifecycle operates, we can't
  2218. * guarantee that the attributes contained in the block's props are the latest
  2219. * versions, so we require that these are generated separately.
  2220. * See `getAttributesFromPreview` in the generated embed edit component.
  2221. *
  2222. * @param {Object} props The block's props.
  2223. * @param {Object} [attributesFromPreview] Attributes generated from the block's most up to date preview.
  2224. * @return {Object|undefined} A more suitable embed block if one exists.
  2225. */
  2226. const createUpgradedEmbedBlock = function (props) {
  2227. var _getBlockVariations3;
  2228. let attributesFromPreview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2229. const {
  2230. preview,
  2231. attributes = {}
  2232. } = props;
  2233. const {
  2234. url,
  2235. providerNameSlug,
  2236. type,
  2237. ...restAttributes
  2238. } = attributes;
  2239. if (!url || !(0,external_wp_blocks_namespaceObject.getBlockType)(DEFAULT_EMBED_BLOCK)) return;
  2240. const matchedBlock = findMoreSuitableBlock(url); // WordPress blocks can work on multiple sites, and so don't have patterns,
  2241. // so if we're in a WordPress block, assume the user has chosen it for a WordPress URL.
  2242. const isCurrentBlockWP = providerNameSlug === 'wordpress' || type === WP_EMBED_TYPE; // If current block is not WordPress and a more suitable block found
  2243. // that is different from the current one, create the new matched block.
  2244. const shouldCreateNewBlock = !isCurrentBlockWP && matchedBlock && (matchedBlock.attributes.providerNameSlug !== providerNameSlug || !providerNameSlug);
  2245. if (shouldCreateNewBlock) {
  2246. return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, {
  2247. url,
  2248. ...restAttributes,
  2249. ...matchedBlock.attributes
  2250. });
  2251. }
  2252. const wpVariation = (_getBlockVariations3 = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations3 === void 0 ? void 0 : _getBlockVariations3.find(_ref3 => {
  2253. let {
  2254. name
  2255. } = _ref3;
  2256. return name === 'wordpress';
  2257. }); // We can't match the URL for WordPress embeds, we have to check the HTML instead.
  2258. if (!wpVariation || !preview || !isFromWordPress(preview.html) || isCurrentBlockWP) {
  2259. return;
  2260. } // This is not the WordPress embed block so transform it into one.
  2261. return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, {
  2262. url,
  2263. ...wpVariation.attributes,
  2264. // By now we have the preview, but when the new block first renders, it
  2265. // won't have had all the attributes set, and so won't get the correct
  2266. // type and it won't render correctly. So, we pass through the current attributes
  2267. // here so that the initial render works when we switch to the WordPress
  2268. // block. This only affects the WordPress block because it can't be
  2269. // rendered in the usual Sandbox (it has a sandbox of its own) and it
  2270. // relies on the preview to set the correct render type.
  2271. ...attributesFromPreview
  2272. });
  2273. };
  2274. /**
  2275. * Removes all previously set aspect ratio related classes and return the rest
  2276. * existing class names.
  2277. *
  2278. * @param {string} existingClassNames Any existing class names.
  2279. * @return {string} The class names without any aspect ratio related class.
  2280. */
  2281. const removeAspectRatioClasses = existingClassNames => {
  2282. if (!existingClassNames) {
  2283. // Avoids extraneous work and also, by returning the same value as
  2284. // received, ensures the post is not dirtied by a change of the block
  2285. // attribute from `undefined` to an emtpy string.
  2286. return existingClassNames;
  2287. }
  2288. const aspectRatioClassNames = ASPECT_RATIOS.reduce((accumulator, _ref4) => {
  2289. let {
  2290. className
  2291. } = _ref4;
  2292. accumulator[className] = false;
  2293. return accumulator;
  2294. }, {
  2295. 'wp-has-aspect-ratio': false
  2296. });
  2297. return dedupe_default()(existingClassNames, aspectRatioClassNames);
  2298. };
  2299. /**
  2300. * Returns class names with any relevant responsive aspect ratio names.
  2301. *
  2302. * @param {string} html The preview HTML that possibly contains an iframe with width and height set.
  2303. * @param {string} existingClassNames Any existing class names.
  2304. * @param {boolean} allowResponsive If the responsive class names should be added, or removed.
  2305. * @return {string} Deduped class names.
  2306. */
  2307. function getClassNames(html, existingClassNames) {
  2308. let allowResponsive = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  2309. if (!allowResponsive) {
  2310. return removeAspectRatioClasses(existingClassNames);
  2311. }
  2312. const previewDocument = document.implementation.createHTMLDocument('');
  2313. previewDocument.body.innerHTML = html;
  2314. const iframe = previewDocument.body.querySelector('iframe'); // If we have a fixed aspect iframe, and it's a responsive embed block.
  2315. if (iframe && iframe.height && iframe.width) {
  2316. const aspectRatio = (iframe.width / iframe.height).toFixed(2); // Given the actual aspect ratio, find the widest ratio to support it.
  2317. for (let ratioIndex = 0; ratioIndex < ASPECT_RATIOS.length; ratioIndex++) {
  2318. const potentialRatio = ASPECT_RATIOS[ratioIndex];
  2319. if (aspectRatio >= potentialRatio.ratio) {
  2320. // Evaluate the difference between actual aspect ratio and closest match.
  2321. // If the difference is too big, do not scale the embed according to aspect ratio.
  2322. const ratioDiff = aspectRatio - potentialRatio.ratio;
  2323. if (ratioDiff > 0.1) {
  2324. // No close aspect ratio match found.
  2325. return removeAspectRatioClasses(existingClassNames);
  2326. } // Close aspect ratio match found.
  2327. return dedupe_default()(removeAspectRatioClasses(existingClassNames), potentialRatio.className, 'wp-has-aspect-ratio');
  2328. }
  2329. }
  2330. }
  2331. return existingClassNames;
  2332. }
  2333. /**
  2334. * Fallback behaviour for unembeddable URLs.
  2335. * Creates a paragraph block containing a link to the URL, and calls `onReplace`.
  2336. *
  2337. * @param {string} url The URL that could not be embedded.
  2338. * @param {Function} onReplace Function to call with the created fallback block.
  2339. */
  2340. function fallback(url, onReplace) {
  2341. const link = (0,external_wp_element_namespaceObject.createElement)("a", {
  2342. href: url
  2343. }, url);
  2344. onReplace((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  2345. content: (0,external_wp_element_namespaceObject.renderToString)(link)
  2346. }));
  2347. }
  2348. /***
  2349. * Gets block attributes based on the preview and responsive state.
  2350. *
  2351. * @param {Object} preview The preview data.
  2352. * @param {string} title The block's title, e.g. Twitter.
  2353. * @param {Object} currentClassNames The block's current class names.
  2354. * @param {boolean} isResponsive Boolean indicating if the block supports responsive content.
  2355. * @param {boolean} allowResponsive Apply responsive classes to fixed size content.
  2356. * @return {Object} Attributes and values.
  2357. */
  2358. const getAttributesFromPreview = memize_default()(function (preview, title, currentClassNames, isResponsive) {
  2359. let allowResponsive = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
  2360. if (!preview) {
  2361. return {};
  2362. }
  2363. const attributes = {}; // Some plugins only return HTML with no type info, so default this to 'rich'.
  2364. let {
  2365. type = 'rich'
  2366. } = preview; // If we got a provider name from the API, use it for the slug, otherwise we use the title,
  2367. // because not all embed code gives us a provider name.
  2368. const {
  2369. html,
  2370. provider_name: providerName
  2371. } = preview;
  2372. const providerNameSlug = (0,external_lodash_namespaceObject.kebabCase)((providerName || title).toLowerCase());
  2373. if (isFromWordPress(html)) {
  2374. type = WP_EMBED_TYPE;
  2375. }
  2376. if (html || 'photo' === type) {
  2377. attributes.type = type;
  2378. attributes.providerNameSlug = providerNameSlug;
  2379. }
  2380. attributes.className = getClassNames(html, currentClassNames, isResponsive && allowResponsive);
  2381. return attributes;
  2382. });
  2383. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/edit.js
  2384. /**
  2385. * External dependencies
  2386. */
  2387. /**
  2388. * WordPress dependencies
  2389. */
  2390. /**
  2391. * Internal dependencies
  2392. */
  2393. const ALLOWED_MEDIA_TYPES = ['audio'];
  2394. function AudioEdit(_ref) {
  2395. let {
  2396. attributes,
  2397. className,
  2398. noticeOperations,
  2399. setAttributes,
  2400. onReplace,
  2401. isSelected,
  2402. noticeUI,
  2403. insertBlocksAfter
  2404. } = _ref;
  2405. const {
  2406. id,
  2407. autoplay,
  2408. caption,
  2409. loop,
  2410. preload,
  2411. src
  2412. } = attributes;
  2413. const isTemporaryAudio = !id && (0,external_wp_blob_namespaceObject.isBlobURL)(src);
  2414. const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => {
  2415. const {
  2416. getSettings
  2417. } = select(external_wp_blockEditor_namespaceObject.store);
  2418. return getSettings().mediaUpload;
  2419. }, []);
  2420. (0,external_wp_element_namespaceObject.useEffect)(() => {
  2421. if (!id && (0,external_wp_blob_namespaceObject.isBlobURL)(src)) {
  2422. const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(src);
  2423. if (file) {
  2424. mediaUpload({
  2425. filesList: [file],
  2426. onFileChange: _ref2 => {
  2427. let [{
  2428. id: mediaId,
  2429. url
  2430. }] = _ref2;
  2431. setAttributes({
  2432. id: mediaId,
  2433. src: url
  2434. });
  2435. },
  2436. onError: e => {
  2437. setAttributes({
  2438. src: undefined,
  2439. id: undefined
  2440. });
  2441. noticeOperations.createErrorNotice(e);
  2442. },
  2443. allowedTypes: ALLOWED_MEDIA_TYPES
  2444. });
  2445. }
  2446. }
  2447. }, []);
  2448. function toggleAttribute(attribute) {
  2449. return newValue => {
  2450. setAttributes({
  2451. [attribute]: newValue
  2452. });
  2453. };
  2454. }
  2455. function onSelectURL(newSrc) {
  2456. // Set the block's src from the edit component's state, and switch off
  2457. // the editing UI.
  2458. if (newSrc !== src) {
  2459. // Check if there's an embed block that handles this URL.
  2460. const embedBlock = createUpgradedEmbedBlock({
  2461. attributes: {
  2462. url: newSrc
  2463. }
  2464. });
  2465. if (undefined !== embedBlock && onReplace) {
  2466. onReplace(embedBlock);
  2467. return;
  2468. }
  2469. setAttributes({
  2470. src: newSrc,
  2471. id: undefined
  2472. });
  2473. }
  2474. }
  2475. function onUploadError(message) {
  2476. noticeOperations.removeAllNotices();
  2477. noticeOperations.createErrorNotice(message);
  2478. }
  2479. function getAutoplayHelp(checked) {
  2480. return checked ? (0,external_wp_i18n_namespaceObject.__)('Autoplay may cause usability issues for some users.') : null;
  2481. }
  2482. function onSelectAudio(media) {
  2483. if (!media || !media.url) {
  2484. // In this case there was an error and we should continue in the editing state
  2485. // previous attributes should be removed because they may be temporary blob urls.
  2486. setAttributes({
  2487. src: undefined,
  2488. id: undefined
  2489. });
  2490. return;
  2491. } // Sets the block's attribute and updates the edit component from the
  2492. // selected media, then switches off the editing UI.
  2493. setAttributes({
  2494. src: media.url,
  2495. id: media.id
  2496. });
  2497. }
  2498. const classes = classnames_default()(className, {
  2499. 'is-transient': isTemporaryAudio
  2500. });
  2501. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  2502. className: classes
  2503. });
  2504. if (!src) {
  2505. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  2506. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  2507. icon: library_audio
  2508. }),
  2509. onSelect: onSelectAudio,
  2510. onSelectURL: onSelectURL,
  2511. accept: "audio/*",
  2512. allowedTypes: ALLOWED_MEDIA_TYPES,
  2513. value: attributes,
  2514. notices: noticeUI,
  2515. onError: onUploadError
  2516. }));
  2517. }
  2518. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  2519. group: "other"
  2520. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  2521. mediaId: id,
  2522. mediaURL: src,
  2523. allowedTypes: ALLOWED_MEDIA_TYPES,
  2524. accept: "audio/*",
  2525. onSelect: onSelectAudio,
  2526. onSelectURL: onSelectURL,
  2527. onError: onUploadError
  2528. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  2529. title: (0,external_wp_i18n_namespaceObject.__)('Audio settings')
  2530. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  2531. label: (0,external_wp_i18n_namespaceObject.__)('Autoplay'),
  2532. onChange: toggleAttribute('autoplay'),
  2533. checked: autoplay,
  2534. help: getAutoplayHelp
  2535. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  2536. label: (0,external_wp_i18n_namespaceObject.__)('Loop'),
  2537. onChange: toggleAttribute('loop'),
  2538. checked: loop
  2539. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  2540. label: (0,external_wp_i18n_namespaceObject._x)('Preload', 'noun; Audio block parameter'),
  2541. value: preload || '' // `undefined` is required for the preload attribute to be unset.
  2542. ,
  2543. onChange: value => setAttributes({
  2544. preload: value || undefined
  2545. }),
  2546. options: [{
  2547. value: '',
  2548. label: (0,external_wp_i18n_namespaceObject.__)('Browser default')
  2549. }, {
  2550. value: 'auto',
  2551. label: (0,external_wp_i18n_namespaceObject.__)('Auto')
  2552. }, {
  2553. value: 'metadata',
  2554. label: (0,external_wp_i18n_namespaceObject.__)('Metadata')
  2555. }, {
  2556. value: 'none',
  2557. label: (0,external_wp_i18n_namespaceObject._x)('None', 'Preload value')
  2558. }]
  2559. }))), (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, {
  2560. isDisabled: !isSelected
  2561. }, (0,external_wp_element_namespaceObject.createElement)("audio", {
  2562. controls: "controls",
  2563. src: src
  2564. })), isTemporaryAudio && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  2565. tagName: "figcaption",
  2566. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Audio caption text'),
  2567. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
  2568. value: caption,
  2569. onChange: value => setAttributes({
  2570. caption: value
  2571. }),
  2572. inlineToolbar: true,
  2573. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
  2574. })));
  2575. }
  2576. /* harmony default export */ var edit = ((0,external_wp_components_namespaceObject.withNotices)(AudioEdit));
  2577. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/save.js
  2578. /**
  2579. * WordPress dependencies
  2580. */
  2581. function save(_ref) {
  2582. let {
  2583. attributes
  2584. } = _ref;
  2585. const {
  2586. autoplay,
  2587. caption,
  2588. loop,
  2589. preload,
  2590. src
  2591. } = attributes;
  2592. return src && (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("audio", {
  2593. controls: "controls",
  2594. src: src,
  2595. autoPlay: autoplay,
  2596. loop: loop,
  2597. preload: preload
  2598. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  2599. tagName: "figcaption",
  2600. value: caption
  2601. }));
  2602. }
  2603. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/transforms.js
  2604. /**
  2605. * WordPress dependencies
  2606. */
  2607. const transforms = {
  2608. from: [{
  2609. type: 'files',
  2610. isMatch(files) {
  2611. return files.length === 1 && files[0].type.indexOf('audio/') === 0;
  2612. },
  2613. transform(files) {
  2614. const file = files[0]; // We don't need to upload the media directly here
  2615. // It's already done as part of the `componentDidMount`
  2616. // in the audio block.
  2617. const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/audio', {
  2618. src: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  2619. });
  2620. return block;
  2621. }
  2622. }, {
  2623. type: 'shortcode',
  2624. tag: 'audio',
  2625. attributes: {
  2626. src: {
  2627. type: 'string',
  2628. shortcode: _ref => {
  2629. let {
  2630. named: {
  2631. src,
  2632. mp3,
  2633. m4a,
  2634. ogg,
  2635. wav,
  2636. wma
  2637. }
  2638. } = _ref;
  2639. return src || mp3 || m4a || ogg || wav || wma;
  2640. }
  2641. },
  2642. loop: {
  2643. type: 'string',
  2644. shortcode: _ref2 => {
  2645. let {
  2646. named: {
  2647. loop
  2648. }
  2649. } = _ref2;
  2650. return loop;
  2651. }
  2652. },
  2653. autoplay: {
  2654. type: 'string',
  2655. shortcode: _ref3 => {
  2656. let {
  2657. named: {
  2658. autoplay
  2659. }
  2660. } = _ref3;
  2661. return autoplay;
  2662. }
  2663. },
  2664. preload: {
  2665. type: 'string',
  2666. shortcode: _ref4 => {
  2667. let {
  2668. named: {
  2669. preload
  2670. }
  2671. } = _ref4;
  2672. return preload;
  2673. }
  2674. }
  2675. }
  2676. }]
  2677. };
  2678. /* harmony default export */ var audio_transforms = (transforms);
  2679. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/index.js
  2680. /**
  2681. * WordPress dependencies
  2682. */
  2683. /**
  2684. * Internal dependencies
  2685. */
  2686. const audio_metadata = {
  2687. $schema: "https://schemas.wp.org/trunk/block.json",
  2688. apiVersion: 2,
  2689. name: "core/audio",
  2690. title: "Audio",
  2691. category: "media",
  2692. description: "Embed a simple audio player.",
  2693. keywords: ["music", "sound", "podcast", "recording"],
  2694. textdomain: "default",
  2695. attributes: {
  2696. src: {
  2697. type: "string",
  2698. source: "attribute",
  2699. selector: "audio",
  2700. attribute: "src"
  2701. },
  2702. caption: {
  2703. type: "string",
  2704. source: "html",
  2705. selector: "figcaption"
  2706. },
  2707. id: {
  2708. type: "number"
  2709. },
  2710. autoplay: {
  2711. type: "boolean",
  2712. source: "attribute",
  2713. selector: "audio",
  2714. attribute: "autoplay"
  2715. },
  2716. loop: {
  2717. type: "boolean",
  2718. source: "attribute",
  2719. selector: "audio",
  2720. attribute: "loop"
  2721. },
  2722. preload: {
  2723. type: "string",
  2724. source: "attribute",
  2725. selector: "audio",
  2726. attribute: "preload"
  2727. }
  2728. },
  2729. supports: {
  2730. anchor: true,
  2731. align: true
  2732. },
  2733. editorStyle: "wp-block-audio-editor",
  2734. style: "wp-block-audio"
  2735. };
  2736. const {
  2737. name: audio_name
  2738. } = audio_metadata;
  2739. const audio_settings = {
  2740. icon: library_audio,
  2741. example: {
  2742. attributes: {
  2743. src: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg'
  2744. }
  2745. },
  2746. transforms: audio_transforms,
  2747. deprecated: deprecated,
  2748. edit: edit,
  2749. save: save
  2750. };
  2751. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/button.js
  2752. /**
  2753. * WordPress dependencies
  2754. */
  2755. const button_button = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  2756. viewBox: "0 0 24 24",
  2757. xmlns: "http://www.w3.org/2000/svg"
  2758. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  2759. d: "M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 12.8h8v-1.5H8v1.5z"
  2760. }));
  2761. /* harmony default export */ var library_button = (button_button);
  2762. ;// CONCATENATED MODULE: external ["wp","compose"]
  2763. var external_wp_compose_namespaceObject = window["wp"]["compose"];
  2764. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/clean-empty-object.js
  2765. /**
  2766. * External dependencies
  2767. */
  2768. /**
  2769. * Removed empty nodes from nested objects.
  2770. *
  2771. * @param {Object} object
  2772. * @return {Object} Object cleaned from empty nodes.
  2773. */
  2774. const cleanEmptyObject = object => {
  2775. if (!(0,external_lodash_namespaceObject.isObject)(object) || Array.isArray(object)) {
  2776. return object;
  2777. }
  2778. const cleanedNestedObjects = (0,external_lodash_namespaceObject.pickBy)((0,external_lodash_namespaceObject.mapValues)(object, cleanEmptyObject), external_lodash_namespaceObject.identity);
  2779. return (0,external_lodash_namespaceObject.isEmpty)(cleanedNestedObjects) ? undefined : cleanedNestedObjects;
  2780. };
  2781. /* harmony default export */ var clean_empty_object = (cleanEmptyObject);
  2782. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/migrate-font-family.js
  2783. /**
  2784. * External dependencies
  2785. */
  2786. /**
  2787. * Internal dependencies
  2788. */
  2789. /**
  2790. * Migrates the current style.typography.fontFamily attribute,
  2791. * whose value was "var:preset|font-family|helvetica-arial",
  2792. * to the style.fontFamily attribute, whose value will be "helvetica-arial".
  2793. *
  2794. * @param {Object} attributes The current attributes
  2795. * @return {Object} The updated attributes.
  2796. */
  2797. /* harmony default export */ function migrate_font_family(attributes) {
  2798. var _attributes$style, _attributes$style$typ;
  2799. if (!(attributes !== null && attributes !== void 0 && (_attributes$style = attributes.style) !== null && _attributes$style !== void 0 && (_attributes$style$typ = _attributes$style.typography) !== null && _attributes$style$typ !== void 0 && _attributes$style$typ.fontFamily)) {
  2800. return attributes;
  2801. } // Clone first so when we delete the fontFamily
  2802. // below we're not modifying the original
  2803. // attributes. Because the deprecation may be discarded
  2804. // we don't want to alter the original attributes.
  2805. const atts = (0,external_lodash_namespaceObject.cloneDeep)(attributes);
  2806. const fontFamily = atts.style.typography.fontFamily.split('|').pop();
  2807. delete atts.style.typography.fontFamily;
  2808. atts.style = clean_empty_object(atts.style);
  2809. return { ...atts,
  2810. fontFamily
  2811. };
  2812. }
  2813. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/deprecated.js
  2814. /**
  2815. * External dependencies
  2816. */
  2817. /**
  2818. * WordPress dependencies
  2819. */
  2820. /**
  2821. * Internal dependencies
  2822. */
  2823. const migrateBorderRadius = attributes => {
  2824. var _newAttributes$style, _newAttributes$style$, _newAttributes$style2;
  2825. const {
  2826. borderRadius,
  2827. ...newAttributes
  2828. } = attributes; // We have to check old property `borderRadius` and if
  2829. // `styles.border.radius` is a `number`
  2830. const oldBorderRadius = [borderRadius, (_newAttributes$style = newAttributes.style) === null || _newAttributes$style === void 0 ? void 0 : (_newAttributes$style$ = _newAttributes$style.border) === null || _newAttributes$style$ === void 0 ? void 0 : _newAttributes$style$.radius].find(possibleBorderRadius => {
  2831. return typeof possibleBorderRadius === 'number' && possibleBorderRadius !== 0;
  2832. });
  2833. if (!oldBorderRadius) {
  2834. return newAttributes;
  2835. }
  2836. return { ...newAttributes,
  2837. style: { ...newAttributes.style,
  2838. border: { ...((_newAttributes$style2 = newAttributes.style) === null || _newAttributes$style2 === void 0 ? void 0 : _newAttributes$style2.border),
  2839. radius: `${oldBorderRadius}px`
  2840. }
  2841. }
  2842. };
  2843. };
  2844. const migrateCustomColorsAndGradients = attributes => {
  2845. if (!attributes.customTextColor && !attributes.customBackgroundColor && !attributes.customGradient) {
  2846. return attributes;
  2847. }
  2848. const style = {
  2849. color: {}
  2850. };
  2851. if (attributes.customTextColor) {
  2852. style.color.text = attributes.customTextColor;
  2853. }
  2854. if (attributes.customBackgroundColor) {
  2855. style.color.background = attributes.customBackgroundColor;
  2856. }
  2857. if (attributes.customGradient) {
  2858. style.color.gradient = attributes.customGradient;
  2859. }
  2860. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor', 'customBackgroundColor', 'customGradient']),
  2861. style
  2862. };
  2863. };
  2864. const oldColorsMigration = attributes => {
  2865. return migrateCustomColorsAndGradients((0,external_lodash_namespaceObject.omit)({ ...attributes,
  2866. customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined,
  2867. customBackgroundColor: attributes.color && '#' === attributes.color[0] ? attributes.color : undefined
  2868. }, ['color', 'textColor']));
  2869. };
  2870. const blockAttributes = {
  2871. url: {
  2872. type: 'string',
  2873. source: 'attribute',
  2874. selector: 'a',
  2875. attribute: 'href'
  2876. },
  2877. title: {
  2878. type: 'string',
  2879. source: 'attribute',
  2880. selector: 'a',
  2881. attribute: 'title'
  2882. },
  2883. text: {
  2884. type: 'string',
  2885. source: 'html',
  2886. selector: 'a'
  2887. }
  2888. };
  2889. const v10 = {
  2890. attributes: {
  2891. url: {
  2892. type: 'string',
  2893. source: 'attribute',
  2894. selector: 'a',
  2895. attribute: 'href'
  2896. },
  2897. title: {
  2898. type: 'string',
  2899. source: 'attribute',
  2900. selector: 'a',
  2901. attribute: 'title'
  2902. },
  2903. text: {
  2904. type: 'string',
  2905. source: 'html',
  2906. selector: 'a'
  2907. },
  2908. linkTarget: {
  2909. type: 'string',
  2910. source: 'attribute',
  2911. selector: 'a',
  2912. attribute: 'target'
  2913. },
  2914. rel: {
  2915. type: 'string',
  2916. source: 'attribute',
  2917. selector: 'a',
  2918. attribute: 'rel'
  2919. },
  2920. placeholder: {
  2921. type: 'string'
  2922. },
  2923. backgroundColor: {
  2924. type: 'string'
  2925. },
  2926. textColor: {
  2927. type: 'string'
  2928. },
  2929. gradient: {
  2930. type: 'string'
  2931. },
  2932. width: {
  2933. type: 'number'
  2934. }
  2935. },
  2936. supports: {
  2937. anchor: true,
  2938. align: true,
  2939. alignWide: false,
  2940. color: {
  2941. __experimentalSkipSerialization: true,
  2942. gradients: true
  2943. },
  2944. typography: {
  2945. fontSize: true,
  2946. __experimentalFontFamily: true
  2947. },
  2948. reusable: false,
  2949. spacing: {
  2950. __experimentalSkipSerialization: true,
  2951. padding: ['horizontal', 'vertical'],
  2952. __experimentalDefaultControls: {
  2953. padding: true
  2954. }
  2955. },
  2956. __experimentalBorder: {
  2957. radius: true,
  2958. __experimentalSkipSerialization: true
  2959. },
  2960. __experimentalSelector: '.wp-block-button__link'
  2961. },
  2962. save(_ref) {
  2963. var _style$border, _style$typography;
  2964. let {
  2965. attributes,
  2966. className
  2967. } = _ref;
  2968. const {
  2969. fontSize,
  2970. linkTarget,
  2971. rel,
  2972. style,
  2973. text,
  2974. title,
  2975. url,
  2976. width
  2977. } = attributes;
  2978. if (!text) {
  2979. return null;
  2980. }
  2981. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
  2982. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  2983. const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
  2984. const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, borderProps.className, {
  2985. // For backwards compatibility add style that isn't provided via
  2986. // block support.
  2987. 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius) === 0
  2988. });
  2989. const buttonStyle = { ...borderProps.style,
  2990. ...colorProps.style,
  2991. ...spacingProps.style
  2992. }; // The use of a `title` attribute here is soft-deprecated, but still applied
  2993. // if it had already been assigned, for the sake of backward-compatibility.
  2994. // A title will no longer be assigned for new or updated button block links.
  2995. const wrapperClasses = classnames_default()(className, {
  2996. [`has-custom-width wp-block-button__width-${width}`]: width,
  2997. [`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize)
  2998. });
  2999. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  3000. className: wrapperClasses
  3001. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3002. tagName: "a",
  3003. className: buttonClasses,
  3004. href: url,
  3005. title: title,
  3006. style: buttonStyle,
  3007. value: text,
  3008. target: linkTarget,
  3009. rel: rel
  3010. }));
  3011. },
  3012. migrate: migrate_font_family,
  3013. isEligible(_ref2) {
  3014. var _style$typography2;
  3015. let {
  3016. style
  3017. } = _ref2;
  3018. return style === null || style === void 0 ? void 0 : (_style$typography2 = style.typography) === null || _style$typography2 === void 0 ? void 0 : _style$typography2.fontFamily;
  3019. }
  3020. };
  3021. const deprecated_deprecated = [v10, {
  3022. supports: {
  3023. anchor: true,
  3024. align: true,
  3025. alignWide: false,
  3026. color: {
  3027. __experimentalSkipSerialization: true,
  3028. gradients: true
  3029. },
  3030. typography: {
  3031. fontSize: true,
  3032. __experimentalFontFamily: true
  3033. },
  3034. reusable: false,
  3035. __experimentalSelector: '.wp-block-button__link'
  3036. },
  3037. attributes: { ...blockAttributes,
  3038. linkTarget: {
  3039. type: 'string',
  3040. source: 'attribute',
  3041. selector: 'a',
  3042. attribute: 'target'
  3043. },
  3044. rel: {
  3045. type: 'string',
  3046. source: 'attribute',
  3047. selector: 'a',
  3048. attribute: 'rel'
  3049. },
  3050. placeholder: {
  3051. type: 'string'
  3052. },
  3053. backgroundColor: {
  3054. type: 'string'
  3055. },
  3056. textColor: {
  3057. type: 'string'
  3058. },
  3059. gradient: {
  3060. type: 'string'
  3061. },
  3062. width: {
  3063. type: 'number'
  3064. }
  3065. },
  3066. isEligible(_ref3) {
  3067. var _style$border2;
  3068. let {
  3069. style
  3070. } = _ref3;
  3071. return typeof (style === null || style === void 0 ? void 0 : (_style$border2 = style.border) === null || _style$border2 === void 0 ? void 0 : _style$border2.radius) === 'number';
  3072. },
  3073. save(_ref4) {
  3074. var _style$border3, _style$border4, _style$typography3;
  3075. let {
  3076. attributes,
  3077. className
  3078. } = _ref4;
  3079. const {
  3080. fontSize,
  3081. linkTarget,
  3082. rel,
  3083. style,
  3084. text,
  3085. title,
  3086. url,
  3087. width
  3088. } = attributes;
  3089. if (!text) {
  3090. return null;
  3091. }
  3092. const borderRadius = style === null || style === void 0 ? void 0 : (_style$border3 = style.border) === null || _style$border3 === void 0 ? void 0 : _style$border3.radius;
  3093. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  3094. const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, {
  3095. 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border4 = style.border) === null || _style$border4 === void 0 ? void 0 : _style$border4.radius) === 0
  3096. });
  3097. const buttonStyle = {
  3098. borderRadius: borderRadius ? borderRadius : undefined,
  3099. ...colorProps.style
  3100. }; // The use of a `title` attribute here is soft-deprecated, but still applied
  3101. // if it had already been assigned, for the sake of backward-compatibility.
  3102. // A title will no longer be assigned for new or updated button block links.
  3103. const wrapperClasses = classnames_default()(className, {
  3104. [`has-custom-width wp-block-button__width-${width}`]: width,
  3105. [`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography3 = style.typography) === null || _style$typography3 === void 0 ? void 0 : _style$typography3.fontSize)
  3106. });
  3107. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  3108. className: wrapperClasses
  3109. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3110. tagName: "a",
  3111. className: buttonClasses,
  3112. href: url,
  3113. title: title,
  3114. style: buttonStyle,
  3115. value: text,
  3116. target: linkTarget,
  3117. rel: rel
  3118. }));
  3119. },
  3120. migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius)
  3121. }, {
  3122. supports: {
  3123. anchor: true,
  3124. align: true,
  3125. alignWide: false,
  3126. color: {
  3127. __experimentalSkipSerialization: true
  3128. },
  3129. reusable: false,
  3130. __experimentalSelector: '.wp-block-button__link'
  3131. },
  3132. attributes: { ...blockAttributes,
  3133. linkTarget: {
  3134. type: 'string',
  3135. source: 'attribute',
  3136. selector: 'a',
  3137. attribute: 'target'
  3138. },
  3139. rel: {
  3140. type: 'string',
  3141. source: 'attribute',
  3142. selector: 'a',
  3143. attribute: 'rel'
  3144. },
  3145. placeholder: {
  3146. type: 'string'
  3147. },
  3148. borderRadius: {
  3149. type: 'number'
  3150. },
  3151. backgroundColor: {
  3152. type: 'string'
  3153. },
  3154. textColor: {
  3155. type: 'string'
  3156. },
  3157. gradient: {
  3158. type: 'string'
  3159. },
  3160. style: {
  3161. type: 'object'
  3162. },
  3163. width: {
  3164. type: 'number'
  3165. }
  3166. },
  3167. save(_ref5) {
  3168. let {
  3169. attributes,
  3170. className
  3171. } = _ref5;
  3172. const {
  3173. borderRadius,
  3174. linkTarget,
  3175. rel,
  3176. text,
  3177. title,
  3178. url,
  3179. width
  3180. } = attributes;
  3181. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  3182. const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, {
  3183. 'no-border-radius': borderRadius === 0
  3184. });
  3185. const buttonStyle = {
  3186. borderRadius: borderRadius ? borderRadius + 'px' : undefined,
  3187. ...colorProps.style
  3188. }; // The use of a `title` attribute here is soft-deprecated, but still applied
  3189. // if it had already been assigned, for the sake of backward-compatibility.
  3190. // A title will no longer be assigned for new or updated button block links.
  3191. const wrapperClasses = classnames_default()(className, {
  3192. [`has-custom-width wp-block-button__width-${width}`]: width
  3193. });
  3194. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  3195. className: wrapperClasses
  3196. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3197. tagName: "a",
  3198. className: buttonClasses,
  3199. href: url,
  3200. title: title,
  3201. style: buttonStyle,
  3202. value: text,
  3203. target: linkTarget,
  3204. rel: rel
  3205. }));
  3206. },
  3207. migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius)
  3208. }, {
  3209. supports: {
  3210. anchor: true,
  3211. align: true,
  3212. alignWide: false,
  3213. color: {
  3214. __experimentalSkipSerialization: true
  3215. },
  3216. reusable: false,
  3217. __experimentalSelector: '.wp-block-button__link'
  3218. },
  3219. attributes: { ...blockAttributes,
  3220. linkTarget: {
  3221. type: 'string',
  3222. source: 'attribute',
  3223. selector: 'a',
  3224. attribute: 'target'
  3225. },
  3226. rel: {
  3227. type: 'string',
  3228. source: 'attribute',
  3229. selector: 'a',
  3230. attribute: 'rel'
  3231. },
  3232. placeholder: {
  3233. type: 'string'
  3234. },
  3235. borderRadius: {
  3236. type: 'number'
  3237. },
  3238. backgroundColor: {
  3239. type: 'string'
  3240. },
  3241. textColor: {
  3242. type: 'string'
  3243. },
  3244. gradient: {
  3245. type: 'string'
  3246. },
  3247. style: {
  3248. type: 'object'
  3249. },
  3250. width: {
  3251. type: 'number'
  3252. }
  3253. },
  3254. save(_ref6) {
  3255. let {
  3256. attributes,
  3257. className
  3258. } = _ref6;
  3259. const {
  3260. borderRadius,
  3261. linkTarget,
  3262. rel,
  3263. text,
  3264. title,
  3265. url,
  3266. width
  3267. } = attributes;
  3268. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  3269. const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, {
  3270. 'no-border-radius': borderRadius === 0
  3271. });
  3272. const buttonStyle = {
  3273. borderRadius: borderRadius ? borderRadius + 'px' : undefined,
  3274. ...colorProps.style
  3275. }; // The use of a `title` attribute here is soft-deprecated, but still applied
  3276. // if it had already been assigned, for the sake of backward-compatibility.
  3277. // A title will no longer be assigned for new or updated button block links.
  3278. const wrapperClasses = classnames_default()(className, {
  3279. [`has-custom-width wp-block-button__width-${width}`]: width
  3280. });
  3281. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  3282. className: wrapperClasses
  3283. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3284. tagName: "a",
  3285. className: buttonClasses,
  3286. href: url,
  3287. title: title,
  3288. style: buttonStyle,
  3289. value: text,
  3290. target: linkTarget,
  3291. rel: rel
  3292. }));
  3293. },
  3294. migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius)
  3295. }, {
  3296. supports: {
  3297. align: true,
  3298. alignWide: false,
  3299. color: {
  3300. gradients: true
  3301. }
  3302. },
  3303. attributes: { ...blockAttributes,
  3304. linkTarget: {
  3305. type: 'string',
  3306. source: 'attribute',
  3307. selector: 'a',
  3308. attribute: 'target'
  3309. },
  3310. rel: {
  3311. type: 'string',
  3312. source: 'attribute',
  3313. selector: 'a',
  3314. attribute: 'rel'
  3315. },
  3316. placeholder: {
  3317. type: 'string'
  3318. },
  3319. borderRadius: {
  3320. type: 'number'
  3321. },
  3322. backgroundColor: {
  3323. type: 'string'
  3324. },
  3325. textColor: {
  3326. type: 'string'
  3327. },
  3328. gradient: {
  3329. type: 'string'
  3330. },
  3331. style: {
  3332. type: 'object'
  3333. }
  3334. },
  3335. save(_ref7) {
  3336. let {
  3337. attributes
  3338. } = _ref7;
  3339. const {
  3340. borderRadius,
  3341. linkTarget,
  3342. rel,
  3343. text,
  3344. title,
  3345. url
  3346. } = attributes;
  3347. const buttonClasses = classnames_default()('wp-block-button__link', {
  3348. 'no-border-radius': borderRadius === 0
  3349. });
  3350. const buttonStyle = {
  3351. borderRadius: borderRadius ? borderRadius + 'px' : undefined
  3352. };
  3353. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3354. tagName: "a",
  3355. className: buttonClasses,
  3356. href: url,
  3357. title: title,
  3358. style: buttonStyle,
  3359. value: text,
  3360. target: linkTarget,
  3361. rel: rel
  3362. });
  3363. },
  3364. migrate: migrateBorderRadius
  3365. }, {
  3366. supports: {
  3367. align: true,
  3368. alignWide: false
  3369. },
  3370. attributes: { ...blockAttributes,
  3371. linkTarget: {
  3372. type: 'string',
  3373. source: 'attribute',
  3374. selector: 'a',
  3375. attribute: 'target'
  3376. },
  3377. rel: {
  3378. type: 'string',
  3379. source: 'attribute',
  3380. selector: 'a',
  3381. attribute: 'rel'
  3382. },
  3383. placeholder: {
  3384. type: 'string'
  3385. },
  3386. borderRadius: {
  3387. type: 'number'
  3388. },
  3389. backgroundColor: {
  3390. type: 'string'
  3391. },
  3392. textColor: {
  3393. type: 'string'
  3394. },
  3395. customBackgroundColor: {
  3396. type: 'string'
  3397. },
  3398. customTextColor: {
  3399. type: 'string'
  3400. },
  3401. customGradient: {
  3402. type: 'string'
  3403. },
  3404. gradient: {
  3405. type: 'string'
  3406. }
  3407. },
  3408. isEligible: attributes => !!attributes.customTextColor || !!attributes.customBackgroundColor || !!attributes.customGradient,
  3409. migrate: (0,external_wp_compose_namespaceObject.compose)(migrateBorderRadius, migrateCustomColorsAndGradients),
  3410. save(_ref8) {
  3411. let {
  3412. attributes
  3413. } = _ref8;
  3414. const {
  3415. backgroundColor,
  3416. borderRadius,
  3417. customBackgroundColor,
  3418. customTextColor,
  3419. customGradient,
  3420. linkTarget,
  3421. gradient,
  3422. rel,
  3423. text,
  3424. textColor,
  3425. title,
  3426. url
  3427. } = attributes;
  3428. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  3429. const backgroundClass = !customGradient && (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  3430. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  3431. const buttonClasses = classnames_default()('wp-block-button__link', {
  3432. 'has-text-color': textColor || customTextColor,
  3433. [textClass]: textClass,
  3434. 'has-background': backgroundColor || customBackgroundColor || customGradient || gradient,
  3435. [backgroundClass]: backgroundClass,
  3436. 'no-border-radius': borderRadius === 0,
  3437. [gradientClass]: gradientClass
  3438. });
  3439. const buttonStyle = {
  3440. background: customGradient ? customGradient : undefined,
  3441. backgroundColor: backgroundClass || customGradient || gradient ? undefined : customBackgroundColor,
  3442. color: textClass ? undefined : customTextColor,
  3443. borderRadius: borderRadius ? borderRadius + 'px' : undefined
  3444. }; // The use of a `title` attribute here is soft-deprecated, but still applied
  3445. // if it had already been assigned, for the sake of backward-compatibility.
  3446. // A title will no longer be assigned for new or updated button block links.
  3447. return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3448. tagName: "a",
  3449. className: buttonClasses,
  3450. href: url,
  3451. title: title,
  3452. style: buttonStyle,
  3453. value: text,
  3454. target: linkTarget,
  3455. rel: rel
  3456. }));
  3457. }
  3458. }, {
  3459. attributes: { ...blockAttributes,
  3460. align: {
  3461. type: 'string',
  3462. default: 'none'
  3463. },
  3464. backgroundColor: {
  3465. type: 'string'
  3466. },
  3467. textColor: {
  3468. type: 'string'
  3469. },
  3470. customBackgroundColor: {
  3471. type: 'string'
  3472. },
  3473. customTextColor: {
  3474. type: 'string'
  3475. },
  3476. linkTarget: {
  3477. type: 'string',
  3478. source: 'attribute',
  3479. selector: 'a',
  3480. attribute: 'target'
  3481. },
  3482. rel: {
  3483. type: 'string',
  3484. source: 'attribute',
  3485. selector: 'a',
  3486. attribute: 'rel'
  3487. },
  3488. placeholder: {
  3489. type: 'string'
  3490. }
  3491. },
  3492. isEligible(attribute) {
  3493. return attribute.className && attribute.className.includes('is-style-squared');
  3494. },
  3495. migrate(attributes) {
  3496. let newClassName = attributes.className;
  3497. if (newClassName) {
  3498. newClassName = newClassName.replace(/is-style-squared[\s]?/, '').trim();
  3499. }
  3500. return migrateBorderRadius(migrateCustomColorsAndGradients({ ...attributes,
  3501. className: newClassName ? newClassName : undefined,
  3502. borderRadius: 0
  3503. }));
  3504. },
  3505. save(_ref9) {
  3506. let {
  3507. attributes
  3508. } = _ref9;
  3509. const {
  3510. backgroundColor,
  3511. customBackgroundColor,
  3512. customTextColor,
  3513. linkTarget,
  3514. rel,
  3515. text,
  3516. textColor,
  3517. title,
  3518. url
  3519. } = attributes;
  3520. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  3521. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  3522. const buttonClasses = classnames_default()('wp-block-button__link', {
  3523. 'has-text-color': textColor || customTextColor,
  3524. [textClass]: textClass,
  3525. 'has-background': backgroundColor || customBackgroundColor,
  3526. [backgroundClass]: backgroundClass
  3527. });
  3528. const buttonStyle = {
  3529. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  3530. color: textClass ? undefined : customTextColor
  3531. };
  3532. return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3533. tagName: "a",
  3534. className: buttonClasses,
  3535. href: url,
  3536. title: title,
  3537. style: buttonStyle,
  3538. value: text,
  3539. target: linkTarget,
  3540. rel: rel
  3541. }));
  3542. }
  3543. }, {
  3544. attributes: { ...blockAttributes,
  3545. align: {
  3546. type: 'string',
  3547. default: 'none'
  3548. },
  3549. backgroundColor: {
  3550. type: 'string'
  3551. },
  3552. textColor: {
  3553. type: 'string'
  3554. },
  3555. customBackgroundColor: {
  3556. type: 'string'
  3557. },
  3558. customTextColor: {
  3559. type: 'string'
  3560. }
  3561. },
  3562. migrate: oldColorsMigration,
  3563. save(_ref10) {
  3564. let {
  3565. attributes
  3566. } = _ref10;
  3567. const {
  3568. url,
  3569. text,
  3570. title,
  3571. backgroundColor,
  3572. textColor,
  3573. customBackgroundColor,
  3574. customTextColor
  3575. } = attributes;
  3576. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  3577. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  3578. const buttonClasses = classnames_default()('wp-block-button__link', {
  3579. 'has-text-color': textColor || customTextColor,
  3580. [textClass]: textClass,
  3581. 'has-background': backgroundColor || customBackgroundColor,
  3582. [backgroundClass]: backgroundClass
  3583. });
  3584. const buttonStyle = {
  3585. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  3586. color: textClass ? undefined : customTextColor
  3587. };
  3588. return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3589. tagName: "a",
  3590. className: buttonClasses,
  3591. href: url,
  3592. title: title,
  3593. style: buttonStyle,
  3594. value: text
  3595. }));
  3596. }
  3597. }, {
  3598. attributes: { ...blockAttributes,
  3599. color: {
  3600. type: 'string'
  3601. },
  3602. textColor: {
  3603. type: 'string'
  3604. },
  3605. align: {
  3606. type: 'string',
  3607. default: 'none'
  3608. }
  3609. },
  3610. save(_ref11) {
  3611. let {
  3612. attributes
  3613. } = _ref11;
  3614. const {
  3615. url,
  3616. text,
  3617. title,
  3618. align,
  3619. color,
  3620. textColor
  3621. } = attributes;
  3622. const buttonStyle = {
  3623. backgroundColor: color,
  3624. color: textColor
  3625. };
  3626. const linkClass = 'wp-block-button__link';
  3627. return (0,external_wp_element_namespaceObject.createElement)("div", {
  3628. className: `align${align}`
  3629. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3630. tagName: "a",
  3631. className: linkClass,
  3632. href: url,
  3633. title: title,
  3634. style: buttonStyle,
  3635. value: text
  3636. }));
  3637. },
  3638. migrate: oldColorsMigration
  3639. }, {
  3640. attributes: { ...blockAttributes,
  3641. color: {
  3642. type: 'string'
  3643. },
  3644. textColor: {
  3645. type: 'string'
  3646. },
  3647. align: {
  3648. type: 'string',
  3649. default: 'none'
  3650. }
  3651. },
  3652. save(_ref12) {
  3653. let {
  3654. attributes
  3655. } = _ref12;
  3656. const {
  3657. url,
  3658. text,
  3659. title,
  3660. align,
  3661. color,
  3662. textColor
  3663. } = attributes;
  3664. return (0,external_wp_element_namespaceObject.createElement)("div", {
  3665. className: `align${align}`,
  3666. style: {
  3667. backgroundColor: color
  3668. }
  3669. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3670. tagName: "a",
  3671. href: url,
  3672. title: title,
  3673. style: {
  3674. color: textColor
  3675. },
  3676. value: text
  3677. }));
  3678. },
  3679. migrate: oldColorsMigration
  3680. }];
  3681. /* harmony default export */ var button_deprecated = (deprecated_deprecated);
  3682. ;// CONCATENATED MODULE: external ["wp","keycodes"]
  3683. var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
  3684. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js
  3685. /**
  3686. * WordPress dependencies
  3687. */
  3688. const link_link = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  3689. xmlns: "http://www.w3.org/2000/svg",
  3690. viewBox: "0 0 24 24"
  3691. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  3692. d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"
  3693. }));
  3694. /* harmony default export */ var library_link = (link_link);
  3695. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js
  3696. /**
  3697. * WordPress dependencies
  3698. */
  3699. const linkOff = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  3700. xmlns: "http://www.w3.org/2000/svg",
  3701. viewBox: "0 0 24 24"
  3702. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  3703. d: "M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"
  3704. }));
  3705. /* harmony default export */ var link_off = (linkOff);
  3706. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/edit.js
  3707. /**
  3708. * External dependencies
  3709. */
  3710. /**
  3711. * WordPress dependencies
  3712. */
  3713. const NEW_TAB_REL = 'noreferrer noopener';
  3714. function WidthPanel(_ref) {
  3715. let {
  3716. selectedWidth,
  3717. setAttributes
  3718. } = _ref;
  3719. function handleChange(newWidth) {
  3720. // Check if we are toggling the width off
  3721. const width = selectedWidth === newWidth ? undefined : newWidth; // Update attributes.
  3722. setAttributes({
  3723. width
  3724. });
  3725. }
  3726. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  3727. title: (0,external_wp_i18n_namespaceObject.__)('Width settings')
  3728. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, {
  3729. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button width')
  3730. }, [25, 50, 75, 100].map(widthValue => {
  3731. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  3732. key: widthValue,
  3733. isSmall: true,
  3734. variant: widthValue === selectedWidth ? 'primary' : undefined,
  3735. onClick: () => handleChange(widthValue)
  3736. }, widthValue, "%");
  3737. })));
  3738. }
  3739. function ButtonEdit(props) {
  3740. var _style$border;
  3741. const {
  3742. attributes,
  3743. setAttributes,
  3744. className,
  3745. isSelected,
  3746. onReplace,
  3747. mergeBlocks
  3748. } = props;
  3749. const {
  3750. linkTarget,
  3751. placeholder,
  3752. rel,
  3753. style,
  3754. text,
  3755. url,
  3756. width
  3757. } = attributes;
  3758. const onSetLinkRel = (0,external_wp_element_namespaceObject.useCallback)(value => {
  3759. setAttributes({
  3760. rel: value
  3761. });
  3762. }, [setAttributes]);
  3763. function onToggleOpenInNewTab(value) {
  3764. const newLinkTarget = value ? '_blank' : undefined;
  3765. let updatedRel = rel;
  3766. if (newLinkTarget && !rel) {
  3767. updatedRel = NEW_TAB_REL;
  3768. } else if (!newLinkTarget && rel === NEW_TAB_REL) {
  3769. updatedRel = undefined;
  3770. }
  3771. setAttributes({
  3772. linkTarget: newLinkTarget,
  3773. rel: updatedRel
  3774. });
  3775. }
  3776. function setButtonText(newText) {
  3777. // Remove anchor tags from button text content.
  3778. setAttributes({
  3779. text: newText.replace(/<\/?a[^>]*>/g, '')
  3780. });
  3781. }
  3782. function onKeyDown(event) {
  3783. if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) {
  3784. startEditing(event);
  3785. } else if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primaryShift(event, 'k')) {
  3786. var _richTextRef$current;
  3787. unlink();
  3788. (_richTextRef$current = richTextRef.current) === null || _richTextRef$current === void 0 ? void 0 : _richTextRef$current.focus();
  3789. }
  3790. }
  3791. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
  3792. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
  3793. const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
  3794. const ref = (0,external_wp_element_namespaceObject.useRef)();
  3795. const richTextRef = (0,external_wp_element_namespaceObject.useRef)();
  3796. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  3797. ref,
  3798. onKeyDown
  3799. });
  3800. const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false);
  3801. const isURLSet = !!url;
  3802. const opensInNewTab = linkTarget === '_blank';
  3803. function startEditing(event) {
  3804. event.preventDefault();
  3805. setIsEditingURL(true);
  3806. }
  3807. function unlink() {
  3808. setAttributes({
  3809. url: undefined,
  3810. linkTarget: undefined,
  3811. rel: undefined
  3812. });
  3813. setIsEditingURL(false);
  3814. }
  3815. (0,external_wp_element_namespaceObject.useEffect)(() => {
  3816. if (!isSelected) {
  3817. setIsEditingURL(false);
  3818. }
  3819. }, [isSelected]);
  3820. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, {
  3821. className: classnames_default()(blockProps.className, {
  3822. [`has-custom-width wp-block-button__width-${width}`]: width,
  3823. [`has-custom-font-size`]: blockProps.style.fontSize
  3824. })
  3825. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  3826. ref: richTextRef,
  3827. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button text'),
  3828. placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Add text…'),
  3829. value: text,
  3830. onChange: value => setButtonText(value),
  3831. withoutInteractiveFormatting: true,
  3832. className: classnames_default()(className, 'wp-block-button__link', colorProps.className, borderProps.className, {
  3833. // For backwards compatibility add style that isn't
  3834. // provided via block support.
  3835. 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius) === 0
  3836. }),
  3837. style: { ...borderProps.style,
  3838. ...colorProps.style,
  3839. ...spacingProps.style
  3840. },
  3841. onSplit: value => (0,external_wp_blocks_namespaceObject.createBlock)('core/button', { ...attributes,
  3842. text: value
  3843. }),
  3844. onReplace: onReplace,
  3845. onMerge: mergeBlocks,
  3846. identifier: "text"
  3847. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  3848. group: "block"
  3849. }, !isURLSet && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  3850. name: "link",
  3851. icon: library_link,
  3852. title: (0,external_wp_i18n_namespaceObject.__)('Link'),
  3853. shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'),
  3854. onClick: startEditing
  3855. }), isURLSet && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  3856. name: "link",
  3857. icon: link_off,
  3858. title: (0,external_wp_i18n_namespaceObject.__)('Unlink'),
  3859. shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('k'),
  3860. onClick: unlink,
  3861. isActive: true
  3862. })), isSelected && (isEditingURL || isURLSet) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
  3863. position: "bottom center",
  3864. onClose: () => {
  3865. var _richTextRef$current2;
  3866. setIsEditingURL(false);
  3867. (_richTextRef$current2 = richTextRef.current) === null || _richTextRef$current2 === void 0 ? void 0 : _richTextRef$current2.focus();
  3868. },
  3869. anchorRef: ref === null || ref === void 0 ? void 0 : ref.current,
  3870. focusOnMount: isEditingURL ? 'firstElement' : false,
  3871. __unstableSlotName: '__unstable-block-tools-after'
  3872. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, {
  3873. className: "wp-block-navigation-link__inline-link-input",
  3874. value: {
  3875. url,
  3876. opensInNewTab
  3877. },
  3878. onChange: _ref2 => {
  3879. let {
  3880. url: newURL = '',
  3881. opensInNewTab: newOpensInNewTab
  3882. } = _ref2;
  3883. setAttributes({
  3884. url: newURL
  3885. });
  3886. if (opensInNewTab !== newOpensInNewTab) {
  3887. onToggleOpenInNewTab(newOpensInNewTab);
  3888. }
  3889. },
  3890. onRemove: () => {
  3891. var _richTextRef$current3;
  3892. unlink();
  3893. (_richTextRef$current3 = richTextRef.current) === null || _richTextRef$current3 === void 0 ? void 0 : _richTextRef$current3.focus();
  3894. },
  3895. forceIsEditingLink: isEditingURL
  3896. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(WidthPanel, {
  3897. selectedWidth: width,
  3898. setAttributes: setAttributes
  3899. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  3900. __experimentalGroup: "advanced"
  3901. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  3902. label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
  3903. value: rel || '',
  3904. onChange: onSetLinkRel
  3905. })));
  3906. }
  3907. /* harmony default export */ var button_edit = (ButtonEdit);
  3908. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/save.js
  3909. /**
  3910. * External dependencies
  3911. */
  3912. /**
  3913. * WordPress dependencies
  3914. */
  3915. function save_save(_ref) {
  3916. var _style$border, _style$typography;
  3917. let {
  3918. attributes,
  3919. className
  3920. } = _ref;
  3921. const {
  3922. fontSize,
  3923. linkTarget,
  3924. rel,
  3925. style,
  3926. text,
  3927. title,
  3928. url,
  3929. width
  3930. } = attributes;
  3931. if (!text) {
  3932. return null;
  3933. }
  3934. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
  3935. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  3936. const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
  3937. const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, borderProps.className, {
  3938. // For backwards compatibility add style that isn't provided via
  3939. // block support.
  3940. 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius) === 0
  3941. });
  3942. const buttonStyle = { ...borderProps.style,
  3943. ...colorProps.style,
  3944. ...spacingProps.style
  3945. }; // The use of a `title` attribute here is soft-deprecated, but still applied
  3946. // if it had already been assigned, for the sake of backward-compatibility.
  3947. // A title will no longer be assigned for new or updated button block links.
  3948. const wrapperClasses = classnames_default()(className, {
  3949. [`has-custom-width wp-block-button__width-${width}`]: width,
  3950. [`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize)
  3951. });
  3952. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  3953. className: wrapperClasses
  3954. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3955. tagName: "a",
  3956. className: buttonClasses,
  3957. href: url,
  3958. title: title,
  3959. style: buttonStyle,
  3960. value: text,
  3961. target: linkTarget,
  3962. rel: rel
  3963. }));
  3964. }
  3965. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/index.js
  3966. /**
  3967. * WordPress dependencies
  3968. */
  3969. /**
  3970. * Internal dependencies
  3971. */
  3972. const button_metadata = {
  3973. $schema: "https://schemas.wp.org/trunk/block.json",
  3974. apiVersion: 2,
  3975. name: "core/button",
  3976. title: "Button",
  3977. category: "design",
  3978. parent: ["core/buttons"],
  3979. description: "Prompt visitors to take action with a button-style link.",
  3980. keywords: ["link"],
  3981. textdomain: "default",
  3982. attributes: {
  3983. url: {
  3984. type: "string",
  3985. source: "attribute",
  3986. selector: "a",
  3987. attribute: "href"
  3988. },
  3989. title: {
  3990. type: "string",
  3991. source: "attribute",
  3992. selector: "a",
  3993. attribute: "title"
  3994. },
  3995. text: {
  3996. type: "string",
  3997. source: "html",
  3998. selector: "a"
  3999. },
  4000. linkTarget: {
  4001. type: "string",
  4002. source: "attribute",
  4003. selector: "a",
  4004. attribute: "target"
  4005. },
  4006. rel: {
  4007. type: "string",
  4008. source: "attribute",
  4009. selector: "a",
  4010. attribute: "rel"
  4011. },
  4012. placeholder: {
  4013. type: "string"
  4014. },
  4015. backgroundColor: {
  4016. type: "string"
  4017. },
  4018. textColor: {
  4019. type: "string"
  4020. },
  4021. gradient: {
  4022. type: "string"
  4023. },
  4024. width: {
  4025. type: "number"
  4026. }
  4027. },
  4028. supports: {
  4029. anchor: true,
  4030. align: true,
  4031. alignWide: false,
  4032. color: {
  4033. __experimentalSkipSerialization: true,
  4034. gradients: true,
  4035. __experimentalDefaultControls: {
  4036. background: true,
  4037. text: true
  4038. }
  4039. },
  4040. typography: {
  4041. fontSize: true,
  4042. __experimentalFontFamily: true,
  4043. __experimentalDefaultControls: {
  4044. fontSize: true
  4045. }
  4046. },
  4047. reusable: false,
  4048. spacing: {
  4049. __experimentalSkipSerialization: true,
  4050. padding: ["horizontal", "vertical"],
  4051. __experimentalDefaultControls: {
  4052. padding: true
  4053. }
  4054. },
  4055. __experimentalBorder: {
  4056. radius: true,
  4057. __experimentalSkipSerialization: true,
  4058. __experimentalDefaultControls: {
  4059. radius: true
  4060. }
  4061. },
  4062. __experimentalSelector: ".wp-block-button__link"
  4063. },
  4064. styles: [{
  4065. name: "fill",
  4066. label: "Fill",
  4067. isDefault: true
  4068. }, {
  4069. name: "outline",
  4070. label: "Outline"
  4071. }],
  4072. editorStyle: "wp-block-button-editor",
  4073. style: "wp-block-button"
  4074. };
  4075. const {
  4076. name: button_name
  4077. } = button_metadata;
  4078. const button_settings = {
  4079. icon: library_button,
  4080. example: {
  4081. attributes: {
  4082. className: 'is-style-fill',
  4083. text: (0,external_wp_i18n_namespaceObject.__)('Call to Action')
  4084. }
  4085. },
  4086. edit: button_edit,
  4087. save: save_save,
  4088. deprecated: button_deprecated,
  4089. merge: (a, _ref) => {
  4090. let {
  4091. text = ''
  4092. } = _ref;
  4093. return { ...a,
  4094. text: (a.text || '') + text
  4095. };
  4096. }
  4097. };
  4098. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/buttons.js
  4099. /**
  4100. * WordPress dependencies
  4101. */
  4102. const buttons = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  4103. viewBox: "0 0 24 24",
  4104. xmlns: "http://www.w3.org/2000/svg"
  4105. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  4106. d: "M17 3H7c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V5c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v4zm-8-1.2h5V6.2h-5v1.6zM17 13H7c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v4zm-8-1.2h5v-1.5h-5v1.5z"
  4107. }));
  4108. /* harmony default export */ var library_buttons = (buttons);
  4109. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/deprecated.js
  4110. /**
  4111. * External dependencies
  4112. */
  4113. /**
  4114. * WordPress dependencies
  4115. */
  4116. /**
  4117. * @param {Object} attributes Block's attributes.
  4118. */
  4119. const migrateWithLayout = attributes => {
  4120. if (!!attributes.layout) {
  4121. return attributes;
  4122. }
  4123. const {
  4124. contentJustification,
  4125. orientation,
  4126. ...updatedAttributes
  4127. } = attributes;
  4128. if (contentJustification || orientation) {
  4129. Object.assign(updatedAttributes, {
  4130. layout: {
  4131. type: 'flex',
  4132. ...(contentJustification && {
  4133. justifyContent: contentJustification
  4134. }),
  4135. ...(orientation && {
  4136. orientation
  4137. })
  4138. }
  4139. });
  4140. }
  4141. return updatedAttributes;
  4142. };
  4143. const buttons_deprecated_deprecated = [{
  4144. attributes: {
  4145. contentJustification: {
  4146. type: 'string'
  4147. },
  4148. orientation: {
  4149. type: 'string',
  4150. default: 'horizontal'
  4151. }
  4152. },
  4153. supports: {
  4154. anchor: true,
  4155. align: ['wide', 'full'],
  4156. __experimentalExposeControlsToChildren: true,
  4157. spacing: {
  4158. blockGap: true,
  4159. margin: ['top', 'bottom'],
  4160. __experimentalDefaultControls: {
  4161. blockGap: true
  4162. }
  4163. }
  4164. },
  4165. isEligible: _ref => {
  4166. let {
  4167. contentJustification,
  4168. orientation
  4169. } = _ref;
  4170. return !!contentJustification || !!orientation;
  4171. },
  4172. migrate: migrateWithLayout,
  4173. save(_ref2) {
  4174. let {
  4175. attributes: {
  4176. contentJustification,
  4177. orientation
  4178. }
  4179. } = _ref2;
  4180. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  4181. className: classnames_default()({
  4182. [`is-content-justification-${contentJustification}`]: contentJustification,
  4183. 'is-vertical': orientation === 'vertical'
  4184. })
  4185. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  4186. }
  4187. }, {
  4188. supports: {
  4189. align: ['center', 'left', 'right'],
  4190. anchor: true
  4191. },
  4192. save() {
  4193. return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  4194. },
  4195. isEligible(_ref3) {
  4196. let {
  4197. align
  4198. } = _ref3;
  4199. return align && ['center', 'left', 'right'].includes(align);
  4200. },
  4201. migrate(attributes) {
  4202. return migrateWithLayout({ ...attributes,
  4203. align: undefined,
  4204. // Floating Buttons blocks shouldn't have been supported in the
  4205. // first place. Most users using them probably expected them to
  4206. // act like content justification controls, so these blocks are
  4207. // migrated to use content justification.
  4208. // As for center-aligned Buttons blocks, the content justification
  4209. // equivalent will create an identical end result in most cases.
  4210. contentJustification: attributes.align
  4211. });
  4212. }
  4213. }];
  4214. /* harmony default export */ var buttons_deprecated = (buttons_deprecated_deprecated);
  4215. ;// CONCATENATED MODULE: external ["wp","richText"]
  4216. var external_wp_richText_namespaceObject = window["wp"]["richText"];
  4217. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/transforms.js
  4218. /**
  4219. * WordPress dependencies
  4220. */
  4221. /**
  4222. * Internal dependencies
  4223. */
  4224. const {
  4225. name: transforms_name
  4226. } = {
  4227. $schema: "https://schemas.wp.org/trunk/block.json",
  4228. apiVersion: 2,
  4229. name: "core/buttons",
  4230. title: "Buttons",
  4231. category: "design",
  4232. description: "Prompt visitors to take action with a group of button-style links.",
  4233. keywords: ["link"],
  4234. textdomain: "default",
  4235. supports: {
  4236. anchor: true,
  4237. align: ["wide", "full"],
  4238. __experimentalExposeControlsToChildren: true,
  4239. spacing: {
  4240. blockGap: true,
  4241. margin: ["top", "bottom"],
  4242. __experimentalDefaultControls: {
  4243. blockGap: true
  4244. }
  4245. },
  4246. __experimentalLayout: {
  4247. allowSwitching: false,
  4248. allowInheriting: false,
  4249. "default": {
  4250. type: "flex"
  4251. }
  4252. }
  4253. },
  4254. editorStyle: "wp-block-buttons-editor",
  4255. style: "wp-block-buttons"
  4256. };
  4257. const transforms_transforms = {
  4258. from: [{
  4259. type: 'block',
  4260. isMultiBlock: true,
  4261. blocks: ['core/button'],
  4262. transform: buttons => // Creates the buttons block.
  4263. (0,external_wp_blocks_namespaceObject.createBlock)(transforms_name, {}, // Loop the selected buttons.
  4264. buttons.map(attributes => // Create singular button in the buttons block.
  4265. (0,external_wp_blocks_namespaceObject.createBlock)('core/button', attributes)))
  4266. }, {
  4267. type: 'block',
  4268. isMultiBlock: true,
  4269. blocks: ['core/paragraph'],
  4270. transform: buttons => // Creates the buttons block.
  4271. (0,external_wp_blocks_namespaceObject.createBlock)(transforms_name, {}, // Loop the selected buttons.
  4272. buttons.map(attributes => {
  4273. const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, attributes.content); // Remove any HTML tags.
  4274. const text = element.innerText || ''; // Get first url.
  4275. const link = element.querySelector('a');
  4276. const url = link === null || link === void 0 ? void 0 : link.getAttribute('href'); // Create singular button in the buttons block.
  4277. return (0,external_wp_blocks_namespaceObject.createBlock)('core/button', {
  4278. text,
  4279. url
  4280. });
  4281. })),
  4282. isMatch: paragraphs => {
  4283. return paragraphs.every(attributes => {
  4284. const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, attributes.content);
  4285. const text = element.innerText || '';
  4286. const links = element.querySelectorAll('a');
  4287. return text.length <= 30 && links.length <= 1;
  4288. });
  4289. }
  4290. }]
  4291. };
  4292. /* harmony default export */ var buttons_transforms = (transforms_transforms);
  4293. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/edit.js
  4294. /**
  4295. * WordPress dependencies
  4296. */
  4297. /**
  4298. * Internal dependencies
  4299. */
  4300. const ALLOWED_BLOCKS = [button_name];
  4301. const DEFAULT_BLOCK = {
  4302. name: button_name,
  4303. attributesToCopy: ['backgroundColor', 'border', 'className', 'fontFamily', 'fontSize', 'gradient', 'style', 'textColor', 'width']
  4304. };
  4305. function ButtonsEdit(_ref) {
  4306. let {
  4307. attributes: {
  4308. layout = {}
  4309. }
  4310. } = _ref;
  4311. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  4312. const preferredStyle = (0,external_wp_data_namespaceObject.useSelect)(select => {
  4313. var _preferredStyleVariat;
  4314. const preferredStyleVariations = select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalPreferredStyleVariations;
  4315. return preferredStyleVariations === null || preferredStyleVariations === void 0 ? void 0 : (_preferredStyleVariat = preferredStyleVariations.value) === null || _preferredStyleVariat === void 0 ? void 0 : _preferredStyleVariat[button_name];
  4316. }, []);
  4317. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  4318. allowedBlocks: ALLOWED_BLOCKS,
  4319. __experimentalDefaultBlock: DEFAULT_BLOCK,
  4320. __experimentalDirectInsert: true,
  4321. template: [[button_name, {
  4322. className: preferredStyle && `is-style-${preferredStyle}`
  4323. }]],
  4324. __experimentalLayout: layout,
  4325. templateInsertUpdatesSelection: true
  4326. });
  4327. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
  4328. }
  4329. /* harmony default export */ var buttons_edit = (ButtonsEdit);
  4330. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/save.js
  4331. /**
  4332. * WordPress dependencies
  4333. */
  4334. function buttons_save_save() {
  4335. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save());
  4336. return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
  4337. }
  4338. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/index.js
  4339. /**
  4340. * WordPress dependencies
  4341. */
  4342. /**
  4343. * Internal dependencies
  4344. */
  4345. const buttons_metadata = {
  4346. $schema: "https://schemas.wp.org/trunk/block.json",
  4347. apiVersion: 2,
  4348. name: "core/buttons",
  4349. title: "Buttons",
  4350. category: "design",
  4351. description: "Prompt visitors to take action with a group of button-style links.",
  4352. keywords: ["link"],
  4353. textdomain: "default",
  4354. supports: {
  4355. anchor: true,
  4356. align: ["wide", "full"],
  4357. __experimentalExposeControlsToChildren: true,
  4358. spacing: {
  4359. blockGap: true,
  4360. margin: ["top", "bottom"],
  4361. __experimentalDefaultControls: {
  4362. blockGap: true
  4363. }
  4364. },
  4365. __experimentalLayout: {
  4366. allowSwitching: false,
  4367. allowInheriting: false,
  4368. "default": {
  4369. type: "flex"
  4370. }
  4371. }
  4372. },
  4373. editorStyle: "wp-block-buttons-editor",
  4374. style: "wp-block-buttons"
  4375. };
  4376. const {
  4377. name: buttons_name
  4378. } = buttons_metadata;
  4379. const buttons_settings = {
  4380. icon: library_buttons,
  4381. example: {
  4382. innerBlocks: [{
  4383. name: 'core/button',
  4384. attributes: {
  4385. text: (0,external_wp_i18n_namespaceObject.__)('Find out more')
  4386. }
  4387. }, {
  4388. name: 'core/button',
  4389. attributes: {
  4390. text: (0,external_wp_i18n_namespaceObject.__)('Contact us')
  4391. }
  4392. }]
  4393. },
  4394. deprecated: buttons_deprecated,
  4395. transforms: buttons_transforms,
  4396. edit: buttons_edit,
  4397. save: buttons_save_save
  4398. };
  4399. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/calendar.js
  4400. /**
  4401. * WordPress dependencies
  4402. */
  4403. const calendar = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  4404. viewBox: "0 0 24 24",
  4405. xmlns: "http://www.w3.org/2000/svg"
  4406. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  4407. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z"
  4408. }));
  4409. /* harmony default export */ var library_calendar = (calendar);
  4410. ;// CONCATENATED MODULE: external "moment"
  4411. var external_moment_namespaceObject = window["moment"];
  4412. var external_moment_default = /*#__PURE__*/__webpack_require__.n(external_moment_namespaceObject);
  4413. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/edit.js
  4414. /**
  4415. * External dependencies
  4416. */
  4417. /**
  4418. * WordPress dependencies
  4419. */
  4420. const getYearMonth = memize_default()(date => {
  4421. if (!date) {
  4422. return {};
  4423. }
  4424. const momentDate = external_moment_default()(date);
  4425. return {
  4426. year: momentDate.year(),
  4427. month: momentDate.month() + 1
  4428. };
  4429. });
  4430. function CalendarEdit(_ref) {
  4431. let {
  4432. attributes
  4433. } = _ref;
  4434. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  4435. const {
  4436. date,
  4437. hasPosts,
  4438. hasPostsResolved
  4439. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  4440. const {
  4441. getEntityRecords,
  4442. hasFinishedResolution
  4443. } = select(external_wp_coreData_namespaceObject.store);
  4444. const singlePublishedPostQuery = {
  4445. status: 'publish',
  4446. per_page: 1
  4447. };
  4448. const posts = getEntityRecords('postType', 'post', singlePublishedPostQuery);
  4449. const postsResolved = hasFinishedResolution('getEntityRecords', ['postType', 'post', singlePublishedPostQuery]);
  4450. let _date; // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
  4451. // Blocks can be loaded into a *non-post* block editor.
  4452. // eslint-disable-next-line @wordpress/data-no-store-string-literals
  4453. const editorSelectors = select('core/editor');
  4454. if (editorSelectors) {
  4455. const postType = editorSelectors.getEditedPostAttribute('type'); // Dates are used to overwrite year and month used on the calendar.
  4456. // This overwrite should only happen for 'post' post types.
  4457. // For other post types the calendar always displays the current month.
  4458. if (postType === 'post') {
  4459. _date = editorSelectors.getEditedPostAttribute('date');
  4460. }
  4461. }
  4462. return {
  4463. date: _date,
  4464. hasPostsResolved: postsResolved,
  4465. hasPosts: postsResolved && (posts === null || posts === void 0 ? void 0 : posts.length) === 1
  4466. };
  4467. }, []);
  4468. if (!hasPosts) {
  4469. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  4470. icon: library_calendar,
  4471. label: (0,external_wp_i18n_namespaceObject.__)('Calendar')
  4472. }, !hasPostsResolved ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null) : (0,external_wp_i18n_namespaceObject.__)('No published posts found.')));
  4473. }
  4474. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
  4475. block: "core/calendar",
  4476. attributes: { ...attributes,
  4477. ...getYearMonth(date)
  4478. }
  4479. })));
  4480. }
  4481. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/transforms.js
  4482. /**
  4483. * WordPress dependencies
  4484. */
  4485. const calendar_transforms_transforms = {
  4486. from: [{
  4487. type: 'block',
  4488. blocks: ['core/archives'],
  4489. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/calendar')
  4490. }],
  4491. to: [{
  4492. type: 'block',
  4493. blocks: ['core/archives'],
  4494. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/archives')
  4495. }]
  4496. };
  4497. /* harmony default export */ var calendar_transforms = (calendar_transforms_transforms);
  4498. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/index.js
  4499. /**
  4500. * WordPress dependencies
  4501. */
  4502. /**
  4503. * Internal dependencies
  4504. */
  4505. const calendar_metadata = {
  4506. $schema: "https://schemas.wp.org/trunk/block.json",
  4507. apiVersion: 2,
  4508. name: "core/calendar",
  4509. title: "Calendar",
  4510. category: "widgets",
  4511. description: "A calendar of your site\u2019s posts.",
  4512. keywords: ["posts", "archive"],
  4513. textdomain: "default",
  4514. attributes: {
  4515. month: {
  4516. type: "integer"
  4517. },
  4518. year: {
  4519. type: "integer"
  4520. }
  4521. },
  4522. supports: {
  4523. align: true
  4524. },
  4525. style: "wp-block-calendar"
  4526. };
  4527. const {
  4528. name: calendar_name
  4529. } = calendar_metadata;
  4530. const calendar_settings = {
  4531. icon: library_calendar,
  4532. example: {},
  4533. edit: CalendarEdit,
  4534. transforms: calendar_transforms
  4535. };
  4536. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/category.js
  4537. /**
  4538. * WordPress dependencies
  4539. */
  4540. const category = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  4541. viewBox: "0 0 24 24",
  4542. xmlns: "http://www.w3.org/2000/svg"
  4543. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  4544. d: "M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",
  4545. fillRule: "evenodd",
  4546. clipRule: "evenodd"
  4547. }));
  4548. /* harmony default export */ var library_category = (category);
  4549. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pin.js
  4550. /**
  4551. * WordPress dependencies
  4552. */
  4553. const pin = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  4554. xmlns: "http://www.w3.org/2000/svg",
  4555. viewBox: "0 0 24 24"
  4556. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  4557. d: "m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z"
  4558. }));
  4559. /* harmony default export */ var library_pin = (pin);
  4560. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/categories/edit.js
  4561. /**
  4562. * External dependencies
  4563. */
  4564. /**
  4565. * WordPress dependencies
  4566. */
  4567. function CategoriesEdit(_ref) {
  4568. let {
  4569. attributes: {
  4570. displayAsDropdown,
  4571. showHierarchy,
  4572. showPostCounts,
  4573. showOnlyTopLevel
  4574. },
  4575. setAttributes
  4576. } = _ref;
  4577. const selectId = (0,external_wp_compose_namespaceObject.useInstanceId)(CategoriesEdit, 'blocks-category-select');
  4578. const query = {
  4579. per_page: -1,
  4580. hide_empty: true,
  4581. context: 'view'
  4582. };
  4583. if (showOnlyTopLevel) {
  4584. query.parent = 0;
  4585. }
  4586. const {
  4587. records: categories,
  4588. isResolving
  4589. } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('taxonomy', 'category', query);
  4590. const getCategoriesList = parentId => {
  4591. if (!(categories !== null && categories !== void 0 && categories.length)) {
  4592. return [];
  4593. }
  4594. if (parentId === null) {
  4595. return categories;
  4596. }
  4597. return categories.filter(_ref2 => {
  4598. let {
  4599. parent
  4600. } = _ref2;
  4601. return parent === parentId;
  4602. });
  4603. };
  4604. const getCategoryListClassName = level => {
  4605. return `wp-block-categories__list wp-block-categories__list-level-${level}`;
  4606. };
  4607. const toggleAttribute = attributeName => newValue => setAttributes({
  4608. [attributeName]: newValue
  4609. });
  4610. const renderCategoryName = name => !name ? (0,external_wp_i18n_namespaceObject.__)('(Untitled)') : (0,external_lodash_namespaceObject.unescape)(name).trim();
  4611. const renderCategoryList = () => {
  4612. const parentId = showHierarchy ? 0 : null;
  4613. const categoriesList = getCategoriesList(parentId);
  4614. return (0,external_wp_element_namespaceObject.createElement)("ul", {
  4615. className: getCategoryListClassName(0)
  4616. }, categoriesList.map(category => renderCategoryListItem(category, 0)));
  4617. };
  4618. const renderCategoryListItem = (category, level) => {
  4619. const childCategories = getCategoriesList(category.id);
  4620. const {
  4621. id,
  4622. link,
  4623. count,
  4624. name
  4625. } = category;
  4626. return (0,external_wp_element_namespaceObject.createElement)("li", {
  4627. key: id
  4628. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  4629. href: link,
  4630. target: "_blank",
  4631. rel: "noreferrer noopener"
  4632. }, renderCategoryName(name)), showPostCounts && (0,external_wp_element_namespaceObject.createElement)("span", {
  4633. className: "wp-block-categories__post-count"
  4634. }, ` (${count})`), showHierarchy && !!childCategories.length && (0,external_wp_element_namespaceObject.createElement)("ul", {
  4635. className: getCategoryListClassName(level + 1)
  4636. }, childCategories.map(childCategory => renderCategoryListItem(childCategory, level + 1))));
  4637. };
  4638. const renderCategoryDropdown = () => {
  4639. const parentId = showHierarchy ? 0 : null;
  4640. const categoriesList = getCategoriesList(parentId);
  4641. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
  4642. as: "label",
  4643. htmlFor: selectId
  4644. }, (0,external_wp_i18n_namespaceObject.__)('Categories')), (0,external_wp_element_namespaceObject.createElement)("select", {
  4645. id: selectId,
  4646. className: "wp-block-categories__dropdown"
  4647. }, categoriesList.map(category => renderCategoryDropdownItem(category, 0))));
  4648. };
  4649. const renderCategoryDropdownItem = (category, level) => {
  4650. const {
  4651. id,
  4652. count,
  4653. name
  4654. } = category;
  4655. const childCategories = getCategoriesList(id);
  4656. return [(0,external_wp_element_namespaceObject.createElement)("option", {
  4657. key: id
  4658. }, (0,external_lodash_namespaceObject.times)(level * 3, () => '\xa0'), renderCategoryName(name), showPostCounts && ` (${count})`), showHierarchy && !!childCategories.length && childCategories.map(childCategory => renderCategoryDropdownItem(childCategory, level + 1))];
  4659. };
  4660. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  4661. title: (0,external_wp_i18n_namespaceObject.__)('Categories settings')
  4662. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  4663. label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'),
  4664. checked: displayAsDropdown,
  4665. onChange: toggleAttribute('displayAsDropdown')
  4666. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  4667. label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'),
  4668. checked: showPostCounts,
  4669. onChange: toggleAttribute('showPostCounts')
  4670. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  4671. label: (0,external_wp_i18n_namespaceObject.__)('Show only top level categories'),
  4672. checked: showOnlyTopLevel,
  4673. onChange: toggleAttribute('showOnlyTopLevel')
  4674. }), !showOnlyTopLevel && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  4675. label: (0,external_wp_i18n_namespaceObject.__)('Show hierarchy'),
  4676. checked: showHierarchy,
  4677. onChange: toggleAttribute('showHierarchy')
  4678. }))), isResolving && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  4679. icon: library_pin,
  4680. label: (0,external_wp_i18n_namespaceObject.__)('Categories')
  4681. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)), !isResolving && (categories === null || categories === void 0 ? void 0 : categories.length) === 0 && (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Your site does not have any posts, so there is nothing to display here at the moment.')), !isResolving && (categories === null || categories === void 0 ? void 0 : categories.length) > 0 && (displayAsDropdown ? renderCategoryDropdown() : renderCategoryList()));
  4682. }
  4683. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/categories/index.js
  4684. /**
  4685. * WordPress dependencies
  4686. */
  4687. /**
  4688. * Internal dependencies
  4689. */
  4690. const categories_metadata = {
  4691. $schema: "https://schemas.wp.org/trunk/block.json",
  4692. apiVersion: 2,
  4693. name: "core/categories",
  4694. title: "Categories",
  4695. category: "widgets",
  4696. description: "Display a list of all categories.",
  4697. textdomain: "default",
  4698. attributes: {
  4699. displayAsDropdown: {
  4700. type: "boolean",
  4701. "default": false
  4702. },
  4703. showHierarchy: {
  4704. type: "boolean",
  4705. "default": false
  4706. },
  4707. showPostCounts: {
  4708. type: "boolean",
  4709. "default": false
  4710. },
  4711. showOnlyTopLevel: {
  4712. type: "boolean",
  4713. "default": false
  4714. }
  4715. },
  4716. supports: {
  4717. align: true,
  4718. html: false
  4719. },
  4720. editorStyle: "wp-block-categories-editor",
  4721. style: "wp-block-categories"
  4722. };
  4723. const {
  4724. name: categories_name
  4725. } = categories_metadata;
  4726. const categories_settings = {
  4727. icon: library_category,
  4728. example: {},
  4729. edit: CategoriesEdit
  4730. };
  4731. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/classic.js
  4732. /**
  4733. * WordPress dependencies
  4734. */
  4735. const classic = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  4736. viewBox: "0 0 24 24",
  4737. xmlns: "http://www.w3.org/2000/svg"
  4738. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  4739. d: "M20 6H4c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H4c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h16c.3 0 .5.2.5.5v9zM10 10H8v2h2v-2zm-5 2h2v-2H5v2zm8-2h-2v2h2v-2zm-5 6h8v-2H8v2zm6-4h2v-2h-2v2zm3 0h2v-2h-2v2zm0 4h2v-2h-2v2zM5 16h2v-2H5v2z"
  4740. }));
  4741. /* harmony default export */ var library_classic = (classic);
  4742. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/convert-to-blocks-button.js
  4743. /**
  4744. * WordPress dependencies
  4745. */
  4746. const ConvertToBlocksButton = _ref => {
  4747. let {
  4748. clientId
  4749. } = _ref;
  4750. const {
  4751. replaceBlocks
  4752. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  4753. const block = (0,external_wp_data_namespaceObject.useSelect)(select => {
  4754. return select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId);
  4755. }, [clientId]);
  4756. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  4757. onClick: () => replaceBlocks(block.clientId, (0,external_wp_blocks_namespaceObject.rawHandler)({
  4758. HTML: (0,external_wp_blocks_namespaceObject.serialize)(block)
  4759. }))
  4760. }, (0,external_wp_i18n_namespaceObject.__)('Convert to blocks'));
  4761. };
  4762. /* harmony default export */ var convert_to_blocks_button = (ConvertToBlocksButton);
  4763. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/edit.js
  4764. /**
  4765. * External dependencies
  4766. */
  4767. /**
  4768. * WordPress dependencies
  4769. */
  4770. /**
  4771. * Internal dependencies
  4772. */
  4773. const {
  4774. wp: edit_wp
  4775. } = window;
  4776. function isTmceEmpty(editor) {
  4777. // When tinyMce is empty the content seems to be:
  4778. // <p><br data-mce-bogus="1"></p>
  4779. // avoid expensive checks for large documents
  4780. const body = editor.getBody();
  4781. if (body.childNodes.length > 1) {
  4782. return false;
  4783. } else if (body.childNodes.length === 0) {
  4784. return true;
  4785. }
  4786. if (body.childNodes[0].childNodes.length > 1) {
  4787. return false;
  4788. }
  4789. return /^\n?$/.test(body.innerText || body.textContent);
  4790. }
  4791. function ClassicEdit(_ref) {
  4792. let {
  4793. clientId,
  4794. attributes: {
  4795. content
  4796. },
  4797. setAttributes,
  4798. onReplace
  4799. } = _ref;
  4800. const {
  4801. getMultiSelectedBlockClientIds
  4802. } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
  4803. const didMount = (0,external_wp_element_namespaceObject.useRef)(false);
  4804. (0,external_wp_element_namespaceObject.useEffect)(() => {
  4805. if (!didMount.current) {
  4806. return;
  4807. }
  4808. const editor = window.tinymce.get(`editor-${clientId}`);
  4809. const currentContent = editor === null || editor === void 0 ? void 0 : editor.getContent();
  4810. if (currentContent !== content) {
  4811. editor.setContent(content || '');
  4812. }
  4813. }, [content]);
  4814. (0,external_wp_element_namespaceObject.useEffect)(() => {
  4815. const {
  4816. baseURL,
  4817. suffix
  4818. } = window.wpEditorL10n.tinymce;
  4819. didMount.current = true;
  4820. window.tinymce.EditorManager.overrideDefaults({
  4821. base_url: baseURL,
  4822. suffix
  4823. });
  4824. function onSetup(editor) {
  4825. let bookmark;
  4826. if (content) {
  4827. editor.on('loadContent', () => editor.setContent(content));
  4828. }
  4829. editor.on('blur', () => {
  4830. var _getMultiSelectedBloc;
  4831. bookmark = editor.selection.getBookmark(2, true); // There is an issue with Chrome and the editor.focus call in core at https://core.trac.wordpress.org/browser/trunk/src/js/_enqueues/lib/link.js#L451.
  4832. // This causes a scroll to the top of editor content on return from some content updating dialogs so tracking
  4833. // scroll position until this is fixed in core.
  4834. const scrollContainer = document.querySelector('.interface-interface-skeleton__content');
  4835. const scrollPosition = scrollContainer.scrollTop; // Only update attributes if we aren't multi-selecting blocks.
  4836. // Updating during multi-selection can overwrite attributes of other blocks.
  4837. if (!((_getMultiSelectedBloc = getMultiSelectedBlockClientIds()) !== null && _getMultiSelectedBloc !== void 0 && _getMultiSelectedBloc.length)) {
  4838. setAttributes({
  4839. content: editor.getContent()
  4840. });
  4841. }
  4842. editor.once('focus', () => {
  4843. if (bookmark) {
  4844. editor.selection.moveToBookmark(bookmark);
  4845. if (scrollContainer.scrollTop !== scrollPosition) {
  4846. scrollContainer.scrollTop = scrollPosition;
  4847. }
  4848. }
  4849. });
  4850. return false;
  4851. });
  4852. editor.on('mousedown touchstart', () => {
  4853. bookmark = null;
  4854. });
  4855. const debouncedOnChange = (0,external_lodash_namespaceObject.debounce)(() => {
  4856. const value = editor.getContent();
  4857. if (value !== editor._lastChange) {
  4858. editor._lastChange = value;
  4859. setAttributes({
  4860. content: value
  4861. });
  4862. }
  4863. }, 250);
  4864. editor.on('Paste Change input Undo Redo', debouncedOnChange); // We need to cancel the debounce call because when we remove
  4865. // the editor (onUnmount) this callback is executed in
  4866. // another tick. This results in setting the content to empty.
  4867. editor.on('remove', debouncedOnChange.cancel);
  4868. editor.on('keydown', event => {
  4869. if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'z')) {
  4870. // Prevent the gutenberg undo kicking in so TinyMCE undo stack works as expected.
  4871. event.stopPropagation();
  4872. }
  4873. if ((event.keyCode === external_wp_keycodes_namespaceObject.BACKSPACE || event.keyCode === external_wp_keycodes_namespaceObject.DELETE) && isTmceEmpty(editor)) {
  4874. // Delete the block.
  4875. onReplace([]);
  4876. event.preventDefault();
  4877. event.stopImmediatePropagation();
  4878. }
  4879. const {
  4880. altKey
  4881. } = event;
  4882. /*
  4883. * Prevent Mousetrap from kicking in: TinyMCE already uses its own
  4884. * `alt+f10` shortcut to focus its toolbar.
  4885. */
  4886. if (altKey && event.keyCode === external_wp_keycodes_namespaceObject.F10) {
  4887. event.stopPropagation();
  4888. }
  4889. });
  4890. editor.on('init', () => {
  4891. const rootNode = editor.getBody(); // Create the toolbar by refocussing the editor.
  4892. if (rootNode.ownerDocument.activeElement === rootNode) {
  4893. rootNode.blur();
  4894. editor.focus();
  4895. }
  4896. });
  4897. }
  4898. function initialize() {
  4899. const {
  4900. settings
  4901. } = window.wpEditorL10n.tinymce;
  4902. edit_wp.oldEditor.initialize(`editor-${clientId}`, {
  4903. tinymce: { ...settings,
  4904. inline: true,
  4905. content_css: false,
  4906. fixed_toolbar_container: `#toolbar-${clientId}`,
  4907. setup: onSetup
  4908. }
  4909. });
  4910. }
  4911. function onReadyStateChange() {
  4912. if (document.readyState === 'complete') {
  4913. initialize();
  4914. }
  4915. }
  4916. if (document.readyState === 'complete') {
  4917. initialize();
  4918. } else {
  4919. document.addEventListener('readystatechange', onReadyStateChange);
  4920. }
  4921. return () => {
  4922. document.removeEventListener('readystatechange', onReadyStateChange);
  4923. edit_wp.oldEditor.remove(`editor-${clientId}`);
  4924. };
  4925. }, []);
  4926. function focus() {
  4927. const editor = window.tinymce.get(`editor-${clientId}`);
  4928. if (editor) {
  4929. editor.focus();
  4930. }
  4931. }
  4932. function onToolbarKeyDown(event) {
  4933. // Prevent WritingFlow from kicking in and allow arrows navigation on the toolbar.
  4934. event.stopPropagation(); // Prevent Mousetrap from moving focus to the top toolbar when pressing `alt+f10` on this block toolbar.
  4935. event.nativeEvent.stopImmediatePropagation();
  4936. } // Disable reasons:
  4937. //
  4938. // jsx-a11y/no-static-element-interactions
  4939. // - the toolbar itself is non-interactive, but must capture events
  4940. // from the KeyboardShortcuts component to stop their propagation.
  4941. /* eslint-disable jsx-a11y/no-static-element-interactions */
  4942. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(convert_to_blocks_button, {
  4943. clientId: clientId
  4944. }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)("div", {
  4945. key: "toolbar",
  4946. id: `toolbar-${clientId}`,
  4947. className: "block-library-classic__toolbar",
  4948. onClick: focus,
  4949. "data-placeholder": (0,external_wp_i18n_namespaceObject.__)('Classic'),
  4950. onKeyDown: onToolbarKeyDown
  4951. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  4952. key: "editor",
  4953. id: `editor-${clientId}`,
  4954. className: "wp-block-freeform block-library-rich-text__tinymce"
  4955. })));
  4956. /* eslint-enable jsx-a11y/no-static-element-interactions */
  4957. }
  4958. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/save.js
  4959. /**
  4960. * WordPress dependencies
  4961. */
  4962. function freeform_save_save(_ref) {
  4963. let {
  4964. attributes
  4965. } = _ref;
  4966. const {
  4967. content
  4968. } = attributes;
  4969. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, content);
  4970. }
  4971. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/index.js
  4972. /**
  4973. * WordPress dependencies
  4974. */
  4975. /**
  4976. * Internal dependencies
  4977. */
  4978. const freeform_metadata = {
  4979. $schema: "https://schemas.wp.org/trunk/block.json",
  4980. apiVersion: 2,
  4981. name: "core/freeform",
  4982. title: "Classic",
  4983. category: "text",
  4984. description: "Use the classic WordPress editor.",
  4985. textdomain: "default",
  4986. attributes: {
  4987. content: {
  4988. type: "string",
  4989. source: "html"
  4990. }
  4991. },
  4992. supports: {
  4993. className: false,
  4994. customClassName: false,
  4995. reusable: false
  4996. },
  4997. editorStyle: "wp-block-freeform-editor"
  4998. };
  4999. const {
  5000. name: freeform_name
  5001. } = freeform_metadata;
  5002. const freeform_settings = {
  5003. icon: library_classic,
  5004. edit: ClassicEdit,
  5005. save: freeform_save_save
  5006. };
  5007. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/code.js
  5008. /**
  5009. * WordPress dependencies
  5010. */
  5011. const code = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  5012. viewBox: "0 0 24 24",
  5013. xmlns: "http://www.w3.org/2000/svg"
  5014. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  5015. d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"
  5016. }));
  5017. /* harmony default export */ var library_code = (code);
  5018. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/edit.js
  5019. /**
  5020. * WordPress dependencies
  5021. */
  5022. function CodeEdit(_ref) {
  5023. let {
  5024. attributes,
  5025. setAttributes,
  5026. onRemove
  5027. } = _ref;
  5028. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  5029. return (0,external_wp_element_namespaceObject.createElement)("pre", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  5030. tagName: "code",
  5031. value: attributes.content,
  5032. onChange: content => setAttributes({
  5033. content
  5034. }),
  5035. onRemove: onRemove,
  5036. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write code…'),
  5037. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Code'),
  5038. preserveWhiteSpace: true,
  5039. __unstablePastePlainText: true
  5040. }));
  5041. }
  5042. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/utils.js
  5043. /**
  5044. * External dependencies
  5045. */
  5046. /**
  5047. * Escapes ampersands, shortcodes, and links.
  5048. *
  5049. * @param {string} content The content of a code block.
  5050. * @return {string} The given content with some characters escaped.
  5051. */
  5052. function utils_escape(content) {
  5053. return (0,external_lodash_namespaceObject.flow)(escapeOpeningSquareBrackets, escapeProtocolInIsolatedUrls)(content || '');
  5054. }
  5055. /**
  5056. * Returns the given content with all opening shortcode characters converted
  5057. * into their HTML entity counterpart (i.e. [ => &#91;). For instance, a
  5058. * shortcode like [embed] becomes &#91;embed]
  5059. *
  5060. * This function replicates the escaping of HTML tags, where a tag like
  5061. * <strong> becomes &lt;strong>.
  5062. *
  5063. * @param {string} content The content of a code block.
  5064. * @return {string} The given content with its opening shortcode characters
  5065. * converted into their HTML entity counterpart
  5066. * (i.e. [ => &#91;)
  5067. */
  5068. function escapeOpeningSquareBrackets(content) {
  5069. return content.replace(/\[/g, '&#91;');
  5070. }
  5071. /**
  5072. * Converts the first two forward slashes of any isolated URL into their HTML
  5073. * counterparts (i.e. // => &#47;&#47;). For instance, https://youtube.com/watch?x
  5074. * becomes https:&#47;&#47;youtube.com/watch?x.
  5075. *
  5076. * An isolated URL is a URL that sits in its own line, surrounded only by spacing
  5077. * characters.
  5078. *
  5079. * See https://github.com/WordPress/wordpress-develop/blob/5.1.1/src/wp-includes/class-wp-embed.php#L403
  5080. *
  5081. * @param {string} content The content of a code block.
  5082. * @return {string} The given content with its ampersands converted into
  5083. * their HTML entity counterpart (i.e. & => &amp;)
  5084. */
  5085. function escapeProtocolInIsolatedUrls(content) {
  5086. return content.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m, '$1&#47;&#47;$2');
  5087. }
  5088. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/save.js
  5089. /**
  5090. * WordPress dependencies
  5091. */
  5092. /**
  5093. * Internal dependencies
  5094. */
  5095. function code_save_save(_ref) {
  5096. let {
  5097. attributes
  5098. } = _ref;
  5099. return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  5100. tagName: "code",
  5101. value: utils_escape(attributes.content)
  5102. }));
  5103. }
  5104. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/transforms.js
  5105. /**
  5106. * WordPress dependencies
  5107. */
  5108. const code_transforms_transforms = {
  5109. from: [{
  5110. type: 'enter',
  5111. regExp: /^```$/,
  5112. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/code')
  5113. }, {
  5114. type: 'block',
  5115. blocks: ['core/html', 'core/paragraph'],
  5116. transform: _ref => {
  5117. let {
  5118. content
  5119. } = _ref;
  5120. return (0,external_wp_blocks_namespaceObject.createBlock)('core/code', {
  5121. content
  5122. });
  5123. }
  5124. }, {
  5125. type: 'raw',
  5126. isMatch: node => node.nodeName === 'PRE' && node.children.length === 1 && node.firstChild.nodeName === 'CODE',
  5127. schema: {
  5128. pre: {
  5129. children: {
  5130. code: {
  5131. children: {
  5132. '#text': {}
  5133. }
  5134. }
  5135. }
  5136. }
  5137. }
  5138. }]
  5139. };
  5140. /* harmony default export */ var code_transforms = (code_transforms_transforms);
  5141. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/index.js
  5142. /**
  5143. * WordPress dependencies
  5144. */
  5145. /**
  5146. * Internal dependencies
  5147. */
  5148. const code_metadata = {
  5149. $schema: "https://schemas.wp.org/trunk/block.json",
  5150. apiVersion: 2,
  5151. name: "core/code",
  5152. title: "Code",
  5153. category: "text",
  5154. description: "Display code snippets that respect your spacing and tabs.",
  5155. textdomain: "default",
  5156. attributes: {
  5157. content: {
  5158. type: "string",
  5159. source: "html",
  5160. selector: "code"
  5161. }
  5162. },
  5163. supports: {
  5164. anchor: true,
  5165. typography: {
  5166. fontSize: true,
  5167. lineHeight: true,
  5168. __experimentalFontStyle: true,
  5169. __experimentalFontWeight: true,
  5170. __experimentalLetterSpacing: true,
  5171. __experimentalTextTransform: true,
  5172. __experimentalDefaultControls: {
  5173. fontSize: true
  5174. }
  5175. },
  5176. spacing: {
  5177. margin: ["top", "bottom"],
  5178. padding: true
  5179. },
  5180. __experimentalBorder: {
  5181. radius: true,
  5182. color: true,
  5183. width: true,
  5184. style: true,
  5185. __experimentalDefaultControls: {
  5186. width: true,
  5187. color: true
  5188. }
  5189. },
  5190. color: {
  5191. text: true,
  5192. background: true,
  5193. gradients: true,
  5194. __experimentalDefaultControls: {
  5195. background: true,
  5196. text: true
  5197. }
  5198. }
  5199. },
  5200. style: "wp-block-code"
  5201. };
  5202. const {
  5203. name: code_name
  5204. } = code_metadata;
  5205. const code_settings = {
  5206. icon: library_code,
  5207. example: {
  5208. attributes: {
  5209. /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */
  5210. // translators: Preserve \n markers for line breaks
  5211. content: (0,external_wp_i18n_namespaceObject.__)('// A "block" is the abstract term used\n// to describe units of markup that\n// when composed together, form the\n// content or layout of a page.\nregisterBlockType( name, settings );')
  5212. /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */
  5213. }
  5214. },
  5215. transforms: code_transforms,
  5216. edit: CodeEdit,
  5217. save: code_save_save
  5218. };
  5219. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/column.js
  5220. /**
  5221. * WordPress dependencies
  5222. */
  5223. const column = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  5224. xmlns: "http://www.w3.org/2000/svg",
  5225. viewBox: "0 0 24 24"
  5226. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  5227. d: "M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z"
  5228. }));
  5229. /* harmony default export */ var library_column = (column);
  5230. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/deprecated.js
  5231. /**
  5232. * External dependencies
  5233. */
  5234. /**
  5235. * WordPress dependencies
  5236. */
  5237. const column_deprecated_deprecated = [{
  5238. attributes: {
  5239. verticalAlignment: {
  5240. type: 'string'
  5241. },
  5242. width: {
  5243. type: 'number',
  5244. min: 0,
  5245. max: 100
  5246. }
  5247. },
  5248. isEligible(_ref) {
  5249. let {
  5250. width
  5251. } = _ref;
  5252. return isFinite(width);
  5253. },
  5254. migrate(attributes) {
  5255. return { ...attributes,
  5256. width: `${attributes.width}%`
  5257. };
  5258. },
  5259. save(_ref2) {
  5260. let {
  5261. attributes
  5262. } = _ref2;
  5263. const {
  5264. verticalAlignment,
  5265. width
  5266. } = attributes;
  5267. const wrapperClasses = classnames_default()({
  5268. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment
  5269. });
  5270. const style = {
  5271. flexBasis: width + '%'
  5272. };
  5273. return (0,external_wp_element_namespaceObject.createElement)("div", {
  5274. className: wrapperClasses,
  5275. style: style
  5276. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  5277. }
  5278. }];
  5279. /* harmony default export */ var column_deprecated = (column_deprecated_deprecated);
  5280. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/edit.js
  5281. /**
  5282. * External dependencies
  5283. */
  5284. /**
  5285. * WordPress dependencies
  5286. */
  5287. function ColumnEdit(_ref) {
  5288. let {
  5289. attributes: {
  5290. verticalAlignment,
  5291. width,
  5292. templateLock = false,
  5293. allowedBlocks
  5294. },
  5295. setAttributes,
  5296. clientId
  5297. } = _ref;
  5298. const classes = classnames_default()('block-core-columns', {
  5299. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment
  5300. });
  5301. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  5302. availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || ['%', 'px', 'em', 'rem', 'vw']
  5303. });
  5304. const {
  5305. columnsIds,
  5306. hasChildBlocks,
  5307. rootClientId
  5308. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  5309. const {
  5310. getBlockOrder,
  5311. getBlockRootClientId
  5312. } = select(external_wp_blockEditor_namespaceObject.store);
  5313. const rootId = getBlockRootClientId(clientId);
  5314. return {
  5315. hasChildBlocks: getBlockOrder(clientId).length > 0,
  5316. rootClientId: rootId,
  5317. columnsIds: getBlockOrder(rootId)
  5318. };
  5319. }, [clientId]);
  5320. const {
  5321. updateBlockAttributes
  5322. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  5323. const updateAlignment = value => {
  5324. // Update own alignment.
  5325. setAttributes({
  5326. verticalAlignment: value
  5327. }); // Reset parent Columns block.
  5328. updateBlockAttributes(rootClientId, {
  5329. verticalAlignment: null
  5330. });
  5331. };
  5332. const widthWithUnit = Number.isFinite(width) ? width + '%' : width;
  5333. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  5334. className: classes,
  5335. style: widthWithUnit ? {
  5336. flexBasis: widthWithUnit
  5337. } : undefined
  5338. });
  5339. const columnsCount = columnsIds.length;
  5340. const currentColumnPosition = columnsIds.indexOf(clientId) + 1;
  5341. const label = (0,external_wp_i18n_namespaceObject.sprintf)(
  5342. /* translators: 1: Block label (i.e. "Block: Column"), 2: Position of the selected block, 3: Total number of sibling blocks of the same type */
  5343. (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$d of %3$d)'), blockProps['aria-label'], currentColumnPosition, columnsCount);
  5344. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ ...blockProps,
  5345. 'aria-label': label
  5346. }, {
  5347. templateLock,
  5348. allowedBlocks,
  5349. renderAppender: hasChildBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender
  5350. });
  5351. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, {
  5352. onChange: updateAlignment,
  5353. value: verticalAlignment
  5354. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  5355. title: (0,external_wp_i18n_namespaceObject.__)('Column settings')
  5356. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  5357. label: (0,external_wp_i18n_namespaceObject.__)('Width'),
  5358. labelPosition: "edge",
  5359. __unstableInputWidth: "80px",
  5360. value: width || '',
  5361. onChange: nextWidth => {
  5362. nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth;
  5363. setAttributes({
  5364. width: nextWidth
  5365. });
  5366. },
  5367. units: units
  5368. }))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
  5369. }
  5370. /* harmony default export */ var column_edit = (ColumnEdit);
  5371. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/save.js
  5372. /**
  5373. * External dependencies
  5374. */
  5375. /**
  5376. * WordPress dependencies
  5377. */
  5378. function column_save_save(_ref) {
  5379. let {
  5380. attributes
  5381. } = _ref;
  5382. const {
  5383. verticalAlignment,
  5384. width
  5385. } = attributes;
  5386. const wrapperClasses = classnames_default()({
  5387. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment
  5388. });
  5389. let style;
  5390. if (width && /\d/.test(width)) {
  5391. // Numbers are handled for backward compatibility as they can be still provided with templates.
  5392. let flexBasis = Number.isFinite(width) ? width + '%' : width; // In some cases we need to round the width to a shorter float.
  5393. if (!Number.isFinite(width) && width !== null && width !== void 0 && width.endsWith('%')) {
  5394. const multiplier = 1000000000000; // Shrink the number back to a reasonable float.
  5395. flexBasis = Math.round(Number.parseFloat(width) * multiplier) / multiplier + '%';
  5396. }
  5397. style = {
  5398. flexBasis
  5399. };
  5400. }
  5401. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
  5402. className: wrapperClasses,
  5403. style
  5404. });
  5405. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  5406. return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
  5407. }
  5408. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/index.js
  5409. /**
  5410. * WordPress dependencies
  5411. */
  5412. /**
  5413. * Internal dependencies
  5414. */
  5415. const column_metadata = {
  5416. $schema: "https://schemas.wp.org/trunk/block.json",
  5417. apiVersion: 2,
  5418. name: "core/column",
  5419. title: "Column",
  5420. category: "text",
  5421. parent: ["core/columns"],
  5422. description: "A single column within a columns block.",
  5423. textdomain: "default",
  5424. attributes: {
  5425. verticalAlignment: {
  5426. type: "string"
  5427. },
  5428. width: {
  5429. type: "string"
  5430. },
  5431. allowedBlocks: {
  5432. type: "array"
  5433. },
  5434. templateLock: {
  5435. type: ["string", "boolean"],
  5436. "enum": ["all", "insert", false]
  5437. }
  5438. },
  5439. supports: {
  5440. anchor: true,
  5441. reusable: false,
  5442. html: false,
  5443. color: {
  5444. gradients: true,
  5445. link: true,
  5446. __experimentalDefaultControls: {
  5447. background: true,
  5448. text: true
  5449. }
  5450. },
  5451. spacing: {
  5452. blockGap: true,
  5453. padding: true,
  5454. __experimentalDefaultControls: {
  5455. padding: true
  5456. }
  5457. },
  5458. __experimentalLayout: true
  5459. }
  5460. };
  5461. const {
  5462. name: column_name
  5463. } = column_metadata;
  5464. const column_settings = {
  5465. icon: library_column,
  5466. edit: column_edit,
  5467. save: column_save_save,
  5468. deprecated: column_deprecated
  5469. };
  5470. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/columns.js
  5471. /**
  5472. * WordPress dependencies
  5473. */
  5474. const columns = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  5475. viewBox: "0 0 24 24",
  5476. xmlns: "http://www.w3.org/2000/svg"
  5477. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  5478. d: "M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-4.1 1.5v10H10v-10h4.9zM5.5 17V8c0-.3.2-.5.5-.5h2.5v10H6c-.3 0-.5-.2-.5-.5zm14 0c0 .3-.2.5-.5.5h-2.6v-10H19c.3 0 .5.2.5.5v9z"
  5479. }));
  5480. /* harmony default export */ var library_columns = (columns);
  5481. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/deprecated.js
  5482. /**
  5483. * External dependencies
  5484. */
  5485. /**
  5486. * WordPress dependencies
  5487. */
  5488. /**
  5489. * Given an HTML string for a deprecated columns inner block, returns the
  5490. * column index to which the migrated inner block should be assigned. Returns
  5491. * undefined if the inner block was not assigned to a column.
  5492. *
  5493. * @param {string} originalContent Deprecated Columns inner block HTML.
  5494. *
  5495. * @return {?number} Column to which inner block is to be assigned.
  5496. */
  5497. function getDeprecatedLayoutColumn(originalContent) {
  5498. let {
  5499. doc
  5500. } = getDeprecatedLayoutColumn;
  5501. if (!doc) {
  5502. doc = document.implementation.createHTMLDocument('');
  5503. getDeprecatedLayoutColumn.doc = doc;
  5504. }
  5505. let columnMatch;
  5506. doc.body.innerHTML = originalContent;
  5507. for (const classListItem of doc.body.firstChild.classList) {
  5508. if (columnMatch = classListItem.match(/^layout-column-(\d+)$/)) {
  5509. return Number(columnMatch[1]) - 1;
  5510. }
  5511. }
  5512. }
  5513. const migrateCustomColors = attributes => {
  5514. if (!attributes.customTextColor && !attributes.customBackgroundColor) {
  5515. return attributes;
  5516. }
  5517. const style = {
  5518. color: {}
  5519. };
  5520. if (attributes.customTextColor) {
  5521. style.color.text = attributes.customTextColor;
  5522. }
  5523. if (attributes.customBackgroundColor) {
  5524. style.color.background = attributes.customBackgroundColor;
  5525. }
  5526. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor', 'customBackgroundColor']),
  5527. style,
  5528. isStackedOnMobile: true
  5529. };
  5530. };
  5531. /* harmony default export */ var columns_deprecated = ([{
  5532. attributes: {
  5533. verticalAlignment: {
  5534. type: 'string'
  5535. },
  5536. backgroundColor: {
  5537. type: 'string'
  5538. },
  5539. customBackgroundColor: {
  5540. type: 'string'
  5541. },
  5542. customTextColor: {
  5543. type: 'string'
  5544. },
  5545. textColor: {
  5546. type: 'string'
  5547. }
  5548. },
  5549. migrate: migrateCustomColors,
  5550. save(_ref) {
  5551. let {
  5552. attributes
  5553. } = _ref;
  5554. const {
  5555. verticalAlignment,
  5556. backgroundColor,
  5557. customBackgroundColor,
  5558. textColor,
  5559. customTextColor
  5560. } = attributes;
  5561. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  5562. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  5563. const className = classnames_default()({
  5564. 'has-background': backgroundColor || customBackgroundColor,
  5565. 'has-text-color': textColor || customTextColor,
  5566. [backgroundClass]: backgroundClass,
  5567. [textClass]: textClass,
  5568. [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment
  5569. });
  5570. const style = {
  5571. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  5572. color: textClass ? undefined : customTextColor
  5573. };
  5574. return (0,external_wp_element_namespaceObject.createElement)("div", {
  5575. className: className ? className : undefined,
  5576. style: style
  5577. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  5578. }
  5579. }, {
  5580. attributes: {
  5581. columns: {
  5582. type: 'number',
  5583. default: 2
  5584. }
  5585. },
  5586. isEligible(attributes, innerBlocks) {
  5587. // Since isEligible is called on every valid instance of the
  5588. // Columns block and a deprecation is the unlikely case due to
  5589. // its subsequent migration, optimize for the `false` condition
  5590. // by performing a naive, inaccurate pass at inner blocks.
  5591. const isFastPassEligible = innerBlocks.some(innerBlock => /layout-column-\d+/.test(innerBlock.originalContent));
  5592. if (!isFastPassEligible) {
  5593. return false;
  5594. } // Only if the fast pass is considered eligible is the more
  5595. // accurate, durable, slower condition performed.
  5596. return innerBlocks.some(innerBlock => getDeprecatedLayoutColumn(innerBlock.originalContent) !== undefined);
  5597. },
  5598. migrate(attributes, innerBlocks) {
  5599. const columns = innerBlocks.reduce((accumulator, innerBlock) => {
  5600. const {
  5601. originalContent
  5602. } = innerBlock;
  5603. let columnIndex = getDeprecatedLayoutColumn(originalContent);
  5604. if (columnIndex === undefined) {
  5605. columnIndex = 0;
  5606. }
  5607. if (!accumulator[columnIndex]) {
  5608. accumulator[columnIndex] = [];
  5609. }
  5610. accumulator[columnIndex].push(innerBlock);
  5611. return accumulator;
  5612. }, []);
  5613. const migratedInnerBlocks = columns.map(columnBlocks => (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {}, columnBlocks));
  5614. return [{ ...(0,external_lodash_namespaceObject.omit)(attributes, ['columns']),
  5615. isStackedOnMobile: true
  5616. }, migratedInnerBlocks];
  5617. },
  5618. save(_ref2) {
  5619. let {
  5620. attributes
  5621. } = _ref2;
  5622. const {
  5623. columns
  5624. } = attributes;
  5625. return (0,external_wp_element_namespaceObject.createElement)("div", {
  5626. className: `has-${columns}-columns`
  5627. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  5628. }
  5629. }, {
  5630. attributes: {
  5631. columns: {
  5632. type: 'number',
  5633. default: 2
  5634. }
  5635. },
  5636. migrate(attributes, innerBlocks) {
  5637. attributes = { ...(0,external_lodash_namespaceObject.omit)(attributes, ['columns']),
  5638. isStackedOnMobile: true
  5639. };
  5640. return [attributes, innerBlocks];
  5641. },
  5642. save(_ref3) {
  5643. let {
  5644. attributes
  5645. } = _ref3;
  5646. const {
  5647. verticalAlignment,
  5648. columns
  5649. } = attributes;
  5650. const wrapperClasses = classnames_default()(`has-${columns}-columns`, {
  5651. [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment
  5652. });
  5653. return (0,external_wp_element_namespaceObject.createElement)("div", {
  5654. className: wrapperClasses
  5655. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  5656. }
  5657. }]);
  5658. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/utils.js
  5659. /**
  5660. * External dependencies
  5661. */
  5662. /**
  5663. * Returns a column width attribute value rounded to standard precision.
  5664. * Returns `undefined` if the value is not a valid finite number.
  5665. *
  5666. * @param {?number} value Raw value.
  5667. *
  5668. * @return {number} Value rounded to standard precision.
  5669. */
  5670. const toWidthPrecision = value => {
  5671. const unitlessValue = parseFloat(value);
  5672. return Number.isFinite(unitlessValue) ? parseFloat(unitlessValue.toFixed(2)) : undefined;
  5673. };
  5674. /**
  5675. * Returns an effective width for a given block. An effective width is equal to
  5676. * its attribute value if set, or a computed value assuming equal distribution.
  5677. *
  5678. * @param {WPBlock} block Block object.
  5679. * @param {number} totalBlockCount Total number of blocks in Columns.
  5680. *
  5681. * @return {number} Effective column width.
  5682. */
  5683. function getEffectiveColumnWidth(block, totalBlockCount) {
  5684. const {
  5685. width = 100 / totalBlockCount
  5686. } = block.attributes;
  5687. return toWidthPrecision(width);
  5688. }
  5689. /**
  5690. * Returns the total width occupied by the given set of column blocks.
  5691. *
  5692. * @param {WPBlock[]} blocks Block objects.
  5693. * @param {?number} totalBlockCount Total number of blocks in Columns.
  5694. * Defaults to number of blocks passed.
  5695. *
  5696. * @return {number} Total width occupied by blocks.
  5697. */
  5698. function getTotalColumnsWidth(blocks) {
  5699. let totalBlockCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : blocks.length;
  5700. return (0,external_lodash_namespaceObject.sumBy)(blocks, block => getEffectiveColumnWidth(block, totalBlockCount));
  5701. }
  5702. /**
  5703. * Returns an object of `clientId` → `width` of effective column widths.
  5704. *
  5705. * @param {WPBlock[]} blocks Block objects.
  5706. * @param {?number} totalBlockCount Total number of blocks in Columns.
  5707. * Defaults to number of blocks passed.
  5708. *
  5709. * @return {Object<string,number>} Column widths.
  5710. */
  5711. function getColumnWidths(blocks) {
  5712. let totalBlockCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : blocks.length;
  5713. return blocks.reduce((accumulator, block) => {
  5714. const width = getEffectiveColumnWidth(block, totalBlockCount);
  5715. return Object.assign(accumulator, {
  5716. [block.clientId]: width
  5717. });
  5718. }, {});
  5719. }
  5720. /**
  5721. * Returns an object of `clientId` → `width` of column widths as redistributed
  5722. * proportional to their current widths, constrained or expanded to fit within
  5723. * the given available width.
  5724. *
  5725. * @param {WPBlock[]} blocks Block objects.
  5726. * @param {number} availableWidth Maximum width to fit within.
  5727. * @param {?number} totalBlockCount Total number of blocks in Columns.
  5728. * Defaults to number of blocks passed.
  5729. *
  5730. * @return {Object<string,number>} Redistributed column widths.
  5731. */
  5732. function getRedistributedColumnWidths(blocks, availableWidth) {
  5733. let totalBlockCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : blocks.length;
  5734. const totalWidth = getTotalColumnsWidth(blocks, totalBlockCount);
  5735. return (0,external_lodash_namespaceObject.mapValues)(getColumnWidths(blocks, totalBlockCount), width => {
  5736. const newWidth = availableWidth * width / totalWidth;
  5737. return toWidthPrecision(newWidth);
  5738. });
  5739. }
  5740. /**
  5741. * Returns true if column blocks within the provided set are assigned with
  5742. * explicit widths, or false otherwise.
  5743. *
  5744. * @param {WPBlock[]} blocks Block objects.
  5745. *
  5746. * @return {boolean} Whether columns have explicit widths.
  5747. */
  5748. function hasExplicitPercentColumnWidths(blocks) {
  5749. return blocks.every(block => {
  5750. var _blockWidth$endsWith;
  5751. const blockWidth = block.attributes.width;
  5752. return Number.isFinite(blockWidth !== null && blockWidth !== void 0 && (_blockWidth$endsWith = blockWidth.endsWith) !== null && _blockWidth$endsWith !== void 0 && _blockWidth$endsWith.call(blockWidth, '%') ? parseFloat(blockWidth) : blockWidth);
  5753. });
  5754. }
  5755. /**
  5756. * Returns a copy of the given set of blocks with new widths assigned from the
  5757. * provided object of redistributed column widths.
  5758. *
  5759. * @param {WPBlock[]} blocks Block objects.
  5760. * @param {Object<string,number>} widths Redistributed column widths.
  5761. *
  5762. * @return {WPBlock[]} blocks Mapped block objects.
  5763. */
  5764. function getMappedColumnWidths(blocks, widths) {
  5765. return blocks.map(block => (0,external_lodash_namespaceObject.merge)({}, block, {
  5766. attributes: {
  5767. width: `${widths[block.clientId]}%`
  5768. }
  5769. }));
  5770. }
  5771. /**
  5772. * Returns an array with columns widths values, parsed or no depends on `withParsing` flag.
  5773. *
  5774. * @param {WPBlock[]} blocks Block objects.
  5775. * @param {?boolean} withParsing Whether value has to be parsed.
  5776. *
  5777. * @return {Array<number,string>} Column widths.
  5778. */
  5779. function getWidths(blocks) {
  5780. let withParsing = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  5781. return blocks.map(innerColumn => {
  5782. const innerColumnWidth = innerColumn.attributes.width || 100 / blocks.length;
  5783. return withParsing ? parseFloat(innerColumnWidth) : innerColumnWidth;
  5784. });
  5785. }
  5786. /**
  5787. * Returns a column width with unit.
  5788. *
  5789. * @param {string} width Column width.
  5790. * @param {string} unit Column width unit.
  5791. *
  5792. * @return {string} Column width with unit.
  5793. */
  5794. function getWidthWithUnit(width, unit) {
  5795. width = 0 > parseFloat(width) ? '0' : width;
  5796. if (isPercentageUnit(unit)) {
  5797. width = Math.min(width, 100);
  5798. }
  5799. return `${width}${unit}`;
  5800. }
  5801. /**
  5802. * Returns a boolean whether passed unit is percentage
  5803. *
  5804. * @param {string} unit Column width unit.
  5805. *
  5806. * @return {boolean} Whether unit is '%'.
  5807. */
  5808. function isPercentageUnit(unit) {
  5809. return unit === '%';
  5810. }
  5811. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/edit.js
  5812. /**
  5813. * External dependencies
  5814. */
  5815. /**
  5816. * WordPress dependencies
  5817. */
  5818. /**
  5819. * Internal dependencies
  5820. */
  5821. /**
  5822. * Allowed blocks constant is passed to InnerBlocks precisely as specified here.
  5823. * The contents of the array should never change.
  5824. * The array should contain the name of each block that is allowed.
  5825. * In columns block, the only block we allow is 'core/column'.
  5826. *
  5827. * @constant
  5828. * @type {string[]}
  5829. */
  5830. const edit_ALLOWED_BLOCKS = ['core/column'];
  5831. function ColumnsEditContainer(_ref) {
  5832. let {
  5833. attributes,
  5834. setAttributes,
  5835. updateAlignment,
  5836. updateColumns,
  5837. clientId
  5838. } = _ref;
  5839. const {
  5840. isStackedOnMobile,
  5841. verticalAlignment
  5842. } = attributes;
  5843. const {
  5844. count
  5845. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  5846. return {
  5847. count: select(external_wp_blockEditor_namespaceObject.store).getBlockCount(clientId)
  5848. };
  5849. }, [clientId]);
  5850. const classes = classnames_default()({
  5851. [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  5852. [`is-not-stacked-on-mobile`]: !isStackedOnMobile
  5853. });
  5854. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  5855. className: classes
  5856. });
  5857. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  5858. allowedBlocks: edit_ALLOWED_BLOCKS,
  5859. orientation: 'horizontal',
  5860. renderAppender: false
  5861. });
  5862. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, {
  5863. onChange: updateAlignment,
  5864. value: verticalAlignment
  5865. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  5866. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  5867. value: count,
  5868. onChange: value => updateColumns(count, value),
  5869. min: 1,
  5870. max: Math.max(6, count)
  5871. }), count > 6 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
  5872. status: "warning",
  5873. isDismissible: false
  5874. }, (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  5875. label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'),
  5876. checked: isStackedOnMobile,
  5877. onChange: () => setAttributes({
  5878. isStackedOnMobile: !isStackedOnMobile
  5879. })
  5880. }))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
  5881. }
  5882. const ColumnsEditContainerWrapper = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps, registry) => ({
  5883. /**
  5884. * Update all child Column blocks with a new vertical alignment setting
  5885. * based on whatever alignment is passed in. This allows change to parent
  5886. * to overide anything set on a individual column basis.
  5887. *
  5888. * @param {string} verticalAlignment the vertical alignment setting
  5889. */
  5890. updateAlignment(verticalAlignment) {
  5891. const {
  5892. clientId,
  5893. setAttributes
  5894. } = ownProps;
  5895. const {
  5896. updateBlockAttributes
  5897. } = dispatch(external_wp_blockEditor_namespaceObject.store);
  5898. const {
  5899. getBlockOrder
  5900. } = registry.select(external_wp_blockEditor_namespaceObject.store); // Update own alignment.
  5901. setAttributes({
  5902. verticalAlignment
  5903. }); // Update all child Column Blocks to match.
  5904. const innerBlockClientIds = getBlockOrder(clientId);
  5905. innerBlockClientIds.forEach(innerBlockClientId => {
  5906. updateBlockAttributes(innerBlockClientId, {
  5907. verticalAlignment
  5908. });
  5909. });
  5910. },
  5911. /**
  5912. * Updates the column count, including necessary revisions to child Column
  5913. * blocks to grant required or redistribute available space.
  5914. *
  5915. * @param {number} previousColumns Previous column count.
  5916. * @param {number} newColumns New column count.
  5917. */
  5918. updateColumns(previousColumns, newColumns) {
  5919. const {
  5920. clientId
  5921. } = ownProps;
  5922. const {
  5923. replaceInnerBlocks
  5924. } = dispatch(external_wp_blockEditor_namespaceObject.store);
  5925. const {
  5926. getBlocks
  5927. } = registry.select(external_wp_blockEditor_namespaceObject.store);
  5928. let innerBlocks = getBlocks(clientId);
  5929. const hasExplicitWidths = hasExplicitPercentColumnWidths(innerBlocks); // Redistribute available width for existing inner blocks.
  5930. const isAddingColumn = newColumns > previousColumns;
  5931. if (isAddingColumn && hasExplicitWidths) {
  5932. // If adding a new column, assign width to the new column equal to
  5933. // as if it were `1 / columns` of the total available space.
  5934. const newColumnWidth = toWidthPrecision(100 / newColumns); // Redistribute in consideration of pending block insertion as
  5935. // constraining the available working width.
  5936. const widths = getRedistributedColumnWidths(innerBlocks, 100 - newColumnWidth);
  5937. innerBlocks = [...getMappedColumnWidths(innerBlocks, widths), ...(0,external_lodash_namespaceObject.times)(newColumns - previousColumns, () => {
  5938. return (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {
  5939. width: `${newColumnWidth}%`
  5940. });
  5941. })];
  5942. } else if (isAddingColumn) {
  5943. innerBlocks = [...innerBlocks, ...(0,external_lodash_namespaceObject.times)(newColumns - previousColumns, () => {
  5944. return (0,external_wp_blocks_namespaceObject.createBlock)('core/column');
  5945. })];
  5946. } else {
  5947. // The removed column will be the last of the inner blocks.
  5948. innerBlocks = (0,external_lodash_namespaceObject.dropRight)(innerBlocks, previousColumns - newColumns);
  5949. if (hasExplicitWidths) {
  5950. // Redistribute as if block is already removed.
  5951. const widths = getRedistributedColumnWidths(innerBlocks, 100);
  5952. innerBlocks = getMappedColumnWidths(innerBlocks, widths);
  5953. }
  5954. }
  5955. replaceInnerBlocks(clientId, innerBlocks);
  5956. }
  5957. }))(ColumnsEditContainer);
  5958. function Placeholder(_ref2) {
  5959. let {
  5960. clientId,
  5961. name,
  5962. setAttributes
  5963. } = _ref2;
  5964. const {
  5965. blockType,
  5966. defaultVariation,
  5967. variations
  5968. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  5969. const {
  5970. getBlockVariations,
  5971. getBlockType,
  5972. getDefaultBlockVariation
  5973. } = select(external_wp_blocks_namespaceObject.store);
  5974. return {
  5975. blockType: getBlockType(name),
  5976. defaultVariation: getDefaultBlockVariation(name, 'block'),
  5977. variations: getBlockVariations(name, 'block')
  5978. };
  5979. }, [name]);
  5980. const {
  5981. replaceInnerBlocks
  5982. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  5983. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  5984. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker, {
  5985. icon: (0,external_lodash_namespaceObject.get)(blockType, ['icon', 'src']),
  5986. label: (0,external_lodash_namespaceObject.get)(blockType, ['title']),
  5987. variations: variations,
  5988. onSelect: function () {
  5989. let nextVariation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultVariation;
  5990. if (nextVariation.attributes) {
  5991. setAttributes(nextVariation.attributes);
  5992. }
  5993. if (nextVariation.innerBlocks) {
  5994. replaceInnerBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(nextVariation.innerBlocks), true);
  5995. }
  5996. },
  5997. allowSkip: true
  5998. }));
  5999. }
  6000. const ColumnsEdit = props => {
  6001. const {
  6002. clientId
  6003. } = props;
  6004. const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlocks(clientId).length > 0, [clientId]);
  6005. const Component = hasInnerBlocks ? ColumnsEditContainerWrapper : Placeholder;
  6006. return (0,external_wp_element_namespaceObject.createElement)(Component, props);
  6007. };
  6008. /* harmony default export */ var columns_edit = (ColumnsEdit);
  6009. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/save.js
  6010. /**
  6011. * External dependencies
  6012. */
  6013. /**
  6014. * WordPress dependencies
  6015. */
  6016. function columns_save_save(_ref) {
  6017. let {
  6018. attributes
  6019. } = _ref;
  6020. const {
  6021. isStackedOnMobile,
  6022. verticalAlignment
  6023. } = attributes;
  6024. const className = classnames_default()({
  6025. [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  6026. [`is-not-stacked-on-mobile`]: !isStackedOnMobile
  6027. });
  6028. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
  6029. className
  6030. });
  6031. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  6032. return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
  6033. }
  6034. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/variations.js
  6035. /**
  6036. * WordPress dependencies
  6037. */
  6038. /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
  6039. /**
  6040. * Template option choices for predefined columns layouts.
  6041. *
  6042. * @type {WPBlockVariation[]}
  6043. */
  6044. const variations = [{
  6045. name: 'one-column-full',
  6046. title: (0,external_wp_i18n_namespaceObject.__)('100'),
  6047. description: (0,external_wp_i18n_namespaceObject.__)('One column'),
  6048. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  6049. width: "48",
  6050. height: "48",
  6051. viewBox: "0 0 48 48",
  6052. xmlns: "http://www.w3.org/2000/svg"
  6053. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  6054. fillRule: "evenodd",
  6055. clipRule: "evenodd",
  6056. d: "m39.0625 14h-30.0625v20.0938h30.0625zm-30.0625-2c-1.10457 0-2 .8954-2 2v20.0938c0 1.1045.89543 2 2 2h30.0625c1.1046 0 2-.8955 2-2v-20.0938c0-1.1046-.8954-2-2-2z"
  6057. })),
  6058. innerBlocks: [['core/column']],
  6059. scope: ['block']
  6060. }, {
  6061. name: 'two-columns-equal',
  6062. title: (0,external_wp_i18n_namespaceObject.__)('50 / 50'),
  6063. description: (0,external_wp_i18n_namespaceObject.__)('Two columns; equal split'),
  6064. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  6065. width: "48",
  6066. height: "48",
  6067. viewBox: "0 0 48 48",
  6068. xmlns: "http://www.w3.org/2000/svg"
  6069. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  6070. fillRule: "evenodd",
  6071. clipRule: "evenodd",
  6072. d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H25V34H39ZM23 34H9V14H23V34Z"
  6073. })),
  6074. isDefault: true,
  6075. innerBlocks: [['core/column'], ['core/column']],
  6076. scope: ['block']
  6077. }, {
  6078. name: 'two-columns-one-third-two-thirds',
  6079. title: (0,external_wp_i18n_namespaceObject.__)('30 / 70'),
  6080. description: (0,external_wp_i18n_namespaceObject.__)('Two columns; one-third, two-thirds split'),
  6081. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  6082. width: "48",
  6083. height: "48",
  6084. viewBox: "0 0 48 48",
  6085. xmlns: "http://www.w3.org/2000/svg"
  6086. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  6087. fillRule: "evenodd",
  6088. clipRule: "evenodd",
  6089. d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H20V34H39ZM18 34H9V14H18V34Z"
  6090. })),
  6091. innerBlocks: [['core/column', {
  6092. width: '33.33%'
  6093. }], ['core/column', {
  6094. width: '66.66%'
  6095. }]],
  6096. scope: ['block']
  6097. }, {
  6098. name: 'two-columns-two-thirds-one-third',
  6099. title: (0,external_wp_i18n_namespaceObject.__)('70 / 30'),
  6100. description: (0,external_wp_i18n_namespaceObject.__)('Two columns; two-thirds, one-third split'),
  6101. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  6102. width: "48",
  6103. height: "48",
  6104. viewBox: "0 0 48 48",
  6105. xmlns: "http://www.w3.org/2000/svg"
  6106. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  6107. fillRule: "evenodd",
  6108. clipRule: "evenodd",
  6109. d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H30V34H39ZM28 34H9V14H28V34Z"
  6110. })),
  6111. innerBlocks: [['core/column', {
  6112. width: '66.66%'
  6113. }], ['core/column', {
  6114. width: '33.33%'
  6115. }]],
  6116. scope: ['block']
  6117. }, {
  6118. name: 'three-columns-equal',
  6119. title: (0,external_wp_i18n_namespaceObject.__)('33 / 33 / 33'),
  6120. description: (0,external_wp_i18n_namespaceObject.__)('Three columns; equal split'),
  6121. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  6122. width: "48",
  6123. height: "48",
  6124. viewBox: "0 0 48 48",
  6125. xmlns: "http://www.w3.org/2000/svg"
  6126. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  6127. fillRule: "evenodd",
  6128. d: "M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM28.5 34h-9V14h9v20zm2 0V14H39v20h-8.5zm-13 0H9V14h8.5v20z"
  6129. })),
  6130. innerBlocks: [['core/column'], ['core/column'], ['core/column']],
  6131. scope: ['block']
  6132. }, {
  6133. name: 'three-columns-wider-center',
  6134. title: (0,external_wp_i18n_namespaceObject.__)('25 / 50 / 25'),
  6135. description: (0,external_wp_i18n_namespaceObject.__)('Three columns; wide center column'),
  6136. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  6137. width: "48",
  6138. height: "48",
  6139. viewBox: "0 0 48 48",
  6140. xmlns: "http://www.w3.org/2000/svg"
  6141. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  6142. fillRule: "evenodd",
  6143. d: "M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM31 34H17V14h14v20zm2 0V14h6v20h-6zm-18 0H9V14h6v20z"
  6144. })),
  6145. innerBlocks: [['core/column', {
  6146. width: '25%'
  6147. }], ['core/column', {
  6148. width: '50%'
  6149. }], ['core/column', {
  6150. width: '25%'
  6151. }]],
  6152. scope: ['block']
  6153. }];
  6154. /* harmony default export */ var columns_variations = (variations);
  6155. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/transforms.js
  6156. /**
  6157. * WordPress dependencies
  6158. */
  6159. const MAXIMUM_SELECTED_BLOCKS = 6;
  6160. const columns_transforms_transforms = {
  6161. from: [{
  6162. type: 'block',
  6163. isMultiBlock: true,
  6164. blocks: ['*'],
  6165. __experimentalConvert: blocks => {
  6166. const columnWidth = +(100 / blocks.length).toFixed(2);
  6167. const innerBlocksTemplate = blocks.map(_ref => {
  6168. let {
  6169. name,
  6170. attributes,
  6171. innerBlocks
  6172. } = _ref;
  6173. return ['core/column', {
  6174. width: `${columnWidth}%`
  6175. }, [[name, { ...attributes
  6176. }, innerBlocks]]];
  6177. });
  6178. return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', {}, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate));
  6179. },
  6180. isMatch: _ref2 => {
  6181. let {
  6182. length: selectedBlocksLength
  6183. } = _ref2;
  6184. return selectedBlocksLength && selectedBlocksLength <= MAXIMUM_SELECTED_BLOCKS;
  6185. }
  6186. }, {
  6187. type: 'block',
  6188. blocks: ['core/media-text'],
  6189. priority: 1,
  6190. transform: (attributes, innerBlocks) => {
  6191. const {
  6192. align,
  6193. backgroundColor,
  6194. textColor,
  6195. style,
  6196. mediaAlt: alt,
  6197. mediaId: id,
  6198. mediaPosition,
  6199. mediaSizeSlug: sizeSlug,
  6200. mediaType,
  6201. mediaUrl: url,
  6202. mediaWidth,
  6203. verticalAlignment
  6204. } = attributes;
  6205. let media;
  6206. if (mediaType === 'image' || !mediaType) {
  6207. const imageAttrs = {
  6208. id,
  6209. alt,
  6210. url,
  6211. sizeSlug
  6212. };
  6213. const linkAttrs = {
  6214. href: attributes.href,
  6215. linkClass: attributes.linkClass,
  6216. linkDestination: attributes.linkDestination,
  6217. linkTarget: attributes.linkTarget,
  6218. rel: attributes.rel
  6219. };
  6220. media = ['core/image', { ...imageAttrs,
  6221. ...linkAttrs
  6222. }];
  6223. } else {
  6224. media = ['core/video', {
  6225. id,
  6226. src: url
  6227. }];
  6228. }
  6229. const innerBlocksTemplate = [['core/column', {
  6230. width: `${mediaWidth}%`
  6231. }, [media]], ['core/column', {
  6232. width: `${100 - mediaWidth}%`
  6233. }, innerBlocks]];
  6234. if (mediaPosition === 'right') {
  6235. innerBlocksTemplate.reverse();
  6236. }
  6237. return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', {
  6238. align,
  6239. backgroundColor,
  6240. textColor,
  6241. style,
  6242. verticalAlignment
  6243. }, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate));
  6244. }
  6245. }]
  6246. };
  6247. /* harmony default export */ var columns_transforms = (columns_transforms_transforms);
  6248. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/index.js
  6249. /**
  6250. * WordPress dependencies
  6251. */
  6252. /**
  6253. * Internal dependencies
  6254. */
  6255. const columns_metadata = {
  6256. $schema: "https://schemas.wp.org/trunk/block.json",
  6257. apiVersion: 2,
  6258. name: "core/columns",
  6259. title: "Columns",
  6260. category: "design",
  6261. description: "Display content in multiple columns, with blocks added to each column.",
  6262. textdomain: "default",
  6263. attributes: {
  6264. verticalAlignment: {
  6265. type: "string"
  6266. },
  6267. isStackedOnMobile: {
  6268. type: "boolean",
  6269. "default": true
  6270. }
  6271. },
  6272. supports: {
  6273. anchor: true,
  6274. align: ["wide", "full"],
  6275. html: false,
  6276. color: {
  6277. gradients: true,
  6278. link: true,
  6279. __experimentalDefaultControls: {
  6280. background: true,
  6281. text: true
  6282. }
  6283. },
  6284. spacing: {
  6285. blockGap: {
  6286. __experimentalDefault: "2em"
  6287. },
  6288. margin: ["top", "bottom"],
  6289. padding: true,
  6290. __experimentalDefaultControls: {
  6291. padding: true
  6292. }
  6293. },
  6294. __experimentalLayout: {
  6295. allowSwitching: false,
  6296. allowInheriting: false,
  6297. allowEditing: false,
  6298. "default": {
  6299. type: "flex",
  6300. flexWrap: "nowrap"
  6301. }
  6302. },
  6303. __experimentalBorder: {
  6304. color: true,
  6305. radius: true,
  6306. style: true,
  6307. width: true,
  6308. __experimentalDefaultControls: {
  6309. color: true,
  6310. radius: true,
  6311. style: true,
  6312. width: true
  6313. }
  6314. }
  6315. },
  6316. editorStyle: "wp-block-columns-editor",
  6317. style: "wp-block-columns"
  6318. };
  6319. const {
  6320. name: columns_name
  6321. } = columns_metadata;
  6322. const columns_settings = {
  6323. icon: library_columns,
  6324. variations: columns_variations,
  6325. example: {
  6326. viewportWidth: 600,
  6327. // Columns collapse "@media (max-width: 599px)".
  6328. innerBlocks: [{
  6329. name: 'core/column',
  6330. innerBlocks: [{
  6331. name: 'core/paragraph',
  6332. attributes: {
  6333. /* translators: example text. */
  6334. content: (0,external_wp_i18n_namespaceObject.__)('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.')
  6335. }
  6336. }, {
  6337. name: 'core/image',
  6338. attributes: {
  6339. url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg'
  6340. }
  6341. }, {
  6342. name: 'core/paragraph',
  6343. attributes: {
  6344. /* translators: example text. */
  6345. content: (0,external_wp_i18n_namespaceObject.__)('Suspendisse commodo neque lacus, a dictum orci interdum et.')
  6346. }
  6347. }]
  6348. }, {
  6349. name: 'core/column',
  6350. innerBlocks: [{
  6351. name: 'core/paragraph',
  6352. attributes: {
  6353. /* translators: example text. */
  6354. content: (0,external_wp_i18n_namespaceObject.__)('Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit.')
  6355. }
  6356. }, {
  6357. name: 'core/paragraph',
  6358. attributes: {
  6359. /* translators: example text. */
  6360. content: (0,external_wp_i18n_namespaceObject.__)('Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.')
  6361. }
  6362. }]
  6363. }]
  6364. },
  6365. deprecated: columns_deprecated,
  6366. edit: columns_edit,
  6367. save: columns_save_save,
  6368. transforms: columns_transforms
  6369. };
  6370. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-author-name.js
  6371. /**
  6372. * WordPress dependencies
  6373. */
  6374. const commentAuthorName = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  6375. viewBox: "0 0 24 24",
  6376. xmlns: "http://www.w3.org/2000/svg"
  6377. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  6378. d: "M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z",
  6379. fillRule: "evenodd",
  6380. clipRule: "evenodd"
  6381. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  6382. d: "M15 15V15C15 13.8954 14.1046 13 13 13L11 13C9.89543 13 9 13.8954 9 15V15",
  6383. fillRule: "evenodd",
  6384. clipRule: "evenodd"
  6385. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Circle, {
  6386. cx: "12",
  6387. cy: "9",
  6388. r: "2",
  6389. fillRule: "evenodd",
  6390. clipRule: "evenodd"
  6391. }));
  6392. /* harmony default export */ var comment_author_name = (commentAuthorName);
  6393. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-name/edit.js
  6394. /**
  6395. * External dependencies
  6396. */
  6397. /**
  6398. * WordPress dependencies
  6399. */
  6400. /**
  6401. * Renders the `core/comment-author-name` block on the editor.
  6402. *
  6403. * @param {Object} props React props.
  6404. * @param {Object} props.setAttributes Callback for updating block attributes.
  6405. * @param {Object} props.attributes Block attributes.
  6406. * @param {string} props.attributes.isLink Whether the author name should be linked.
  6407. * @param {string} props.attributes.linkTarget Target of the link.
  6408. * @param {string} props.attributes.textAlign Text alignment.
  6409. * @param {Object} props.context Inherited context.
  6410. * @param {string} props.context.commentId The comment ID.
  6411. *
  6412. * @return {JSX.Element} React element.
  6413. */
  6414. function edit_Edit(_ref) {
  6415. let {
  6416. attributes: {
  6417. isLink,
  6418. linkTarget,
  6419. textAlign
  6420. },
  6421. context: {
  6422. commentId
  6423. },
  6424. setAttributes
  6425. } = _ref;
  6426. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  6427. className: classnames_default()({
  6428. [`has-text-align-${textAlign}`]: textAlign
  6429. })
  6430. });
  6431. let displayName = (0,external_wp_data_namespaceObject.useSelect)(select => {
  6432. const {
  6433. getEntityRecord
  6434. } = select(external_wp_coreData_namespaceObject.store);
  6435. const comment = getEntityRecord('root', 'comment', commentId);
  6436. const authorName = comment === null || comment === void 0 ? void 0 : comment.author_name; // eslint-disable-line camelcase
  6437. if (comment && !authorName) {
  6438. var _user$name;
  6439. const user = getEntityRecord('root', 'user', comment.author);
  6440. return (_user$name = user === null || user === void 0 ? void 0 : user.name) !== null && _user$name !== void 0 ? _user$name : (0,external_wp_i18n_namespaceObject.__)('Anonymous');
  6441. }
  6442. return authorName !== null && authorName !== void 0 ? authorName : '';
  6443. }, [commentId]);
  6444. const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  6445. group: "block"
  6446. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  6447. value: textAlign,
  6448. onChange: newAlign => setAttributes({
  6449. textAlign: newAlign
  6450. })
  6451. }));
  6452. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  6453. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  6454. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  6455. label: (0,external_wp_i18n_namespaceObject.__)('Link to authors URL'),
  6456. onChange: () => setAttributes({
  6457. isLink: !isLink
  6458. }),
  6459. checked: isLink
  6460. }), isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  6461. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  6462. onChange: value => setAttributes({
  6463. linkTarget: value ? '_blank' : '_self'
  6464. }),
  6465. checked: linkTarget === '_blank'
  6466. })));
  6467. if (!commentId || !displayName) {
  6468. displayName = (0,external_wp_i18n_namespaceObject._x)('Comment Author', 'block title');
  6469. }
  6470. const displayAuthor = isLink ? (0,external_wp_element_namespaceObject.createElement)("a", {
  6471. href: "#comment-author-pseudo-link",
  6472. onClick: event => event.preventDefault()
  6473. }, displayName) : displayName;
  6474. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, inspectorControls, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, displayAuthor));
  6475. }
  6476. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-name/deprecated.js
  6477. /**
  6478. * Internal dependencies
  6479. */
  6480. const v1 = {
  6481. attributes: {
  6482. isLink: {
  6483. type: 'boolean',
  6484. default: false
  6485. },
  6486. linkTarget: {
  6487. type: 'string',
  6488. default: '_self'
  6489. }
  6490. },
  6491. supports: {
  6492. html: false,
  6493. color: {
  6494. gradients: true,
  6495. link: true
  6496. },
  6497. typography: {
  6498. fontSize: true,
  6499. lineHeight: true,
  6500. __experimentalFontFamily: true,
  6501. __experimentalFontWeight: true,
  6502. __experimentalFontStyle: true,
  6503. __experimentalTextTransform: true,
  6504. __experimentalLetterSpacing: true
  6505. }
  6506. },
  6507. save() {
  6508. return null;
  6509. },
  6510. migrate: migrate_font_family,
  6511. isEligible(_ref) {
  6512. var _style$typography;
  6513. let {
  6514. style
  6515. } = _ref;
  6516. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  6517. }
  6518. };
  6519. /**
  6520. * New deprecations need to be placed first
  6521. * for them to have higher priority.
  6522. *
  6523. * Old deprecations may need to be updated as well.
  6524. *
  6525. * See block-deprecation.md
  6526. */
  6527. /* harmony default export */ var comment_author_name_deprecated = ([v1]);
  6528. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-name/index.js
  6529. /**
  6530. * WordPress dependencies
  6531. */
  6532. /**
  6533. * Internal dependencies
  6534. */
  6535. const comment_author_name_metadata = {
  6536. $schema: "https://schemas.wp.org/trunk/block.json",
  6537. apiVersion: 2,
  6538. name: "core/comment-author-name",
  6539. title: "Comment Author Name",
  6540. category: "theme",
  6541. ancestor: ["core/comment-template"],
  6542. description: "Displays the name of the author of the comment.",
  6543. textdomain: "default",
  6544. attributes: {
  6545. isLink: {
  6546. type: "boolean",
  6547. "default": true
  6548. },
  6549. linkTarget: {
  6550. type: "string",
  6551. "default": "_self"
  6552. },
  6553. textAlign: {
  6554. type: "string"
  6555. }
  6556. },
  6557. usesContext: ["commentId"],
  6558. supports: {
  6559. html: false,
  6560. spacing: {
  6561. margin: true,
  6562. padding: true
  6563. },
  6564. color: {
  6565. gradients: true,
  6566. link: true,
  6567. __experimentalDefaultControls: {
  6568. background: true,
  6569. text: true,
  6570. link: true
  6571. }
  6572. },
  6573. typography: {
  6574. fontSize: true,
  6575. lineHeight: true,
  6576. __experimentalFontFamily: true,
  6577. __experimentalFontWeight: true,
  6578. __experimentalFontStyle: true,
  6579. __experimentalTextTransform: true,
  6580. __experimentalLetterSpacing: true
  6581. }
  6582. }
  6583. };
  6584. const {
  6585. name: comment_author_name_name
  6586. } = comment_author_name_metadata;
  6587. const comment_author_name_settings = {
  6588. icon: comment_author_name,
  6589. edit: edit_Edit,
  6590. deprecated: comment_author_name_deprecated
  6591. };
  6592. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-content.js
  6593. /**
  6594. * WordPress dependencies
  6595. */
  6596. const commentContent = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  6597. viewBox: "0 0 24 24",
  6598. xmlns: "http://www.w3.org/2000/svg"
  6599. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  6600. fillRule: "evenodd",
  6601. clipRule: "evenodd",
  6602. d: "M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z"
  6603. }));
  6604. /* harmony default export */ var comment_content = (commentContent);
  6605. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-content/edit.js
  6606. /**
  6607. * External dependencies
  6608. */
  6609. /**
  6610. * WordPress dependencies
  6611. */
  6612. /**
  6613. * Renders the `core/comment-content` block on the editor.
  6614. *
  6615. * @param {Object} props React props.
  6616. * @param {Object} props.setAttributes Callback for updating block attributes.
  6617. * @param {Object} props.attributes Block attributes.
  6618. * @param {string} props.attributes.textAlign The `textAlign` attribute.
  6619. * @param {Object} props.context Inherited context.
  6620. * @param {string} props.context.commentId The comment ID.
  6621. *
  6622. * @return {JSX.Element} React element.
  6623. */
  6624. function comment_content_edit_Edit(_ref) {
  6625. let {
  6626. setAttributes,
  6627. attributes: {
  6628. textAlign
  6629. },
  6630. context: {
  6631. commentId
  6632. }
  6633. } = _ref;
  6634. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  6635. className: classnames_default()({
  6636. [`has-text-align-${textAlign}`]: textAlign
  6637. })
  6638. });
  6639. const [content] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'content', commentId);
  6640. const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  6641. group: "block"
  6642. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  6643. value: textAlign,
  6644. onChange: newAlign => setAttributes({
  6645. textAlign: newAlign
  6646. })
  6647. }));
  6648. if (!commentId || !content) {
  6649. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject._x)('Comment Content', 'block title'))));
  6650. }
  6651. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, {
  6652. key: "html"
  6653. }, content.rendered))));
  6654. }
  6655. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-content/index.js
  6656. /**
  6657. * WordPress dependencies
  6658. */
  6659. /**
  6660. * Internal dependencies
  6661. */
  6662. const comment_content_metadata = {
  6663. $schema: "https://schemas.wp.org/trunk/block.json",
  6664. apiVersion: 2,
  6665. name: "core/comment-content",
  6666. title: "Comment Content",
  6667. category: "theme",
  6668. ancestor: ["core/comment-template"],
  6669. description: "Displays the contents of a comment.",
  6670. textdomain: "default",
  6671. usesContext: ["commentId"],
  6672. attributes: {
  6673. textAlign: {
  6674. type: "string"
  6675. }
  6676. },
  6677. supports: {
  6678. color: {
  6679. gradients: true,
  6680. link: true,
  6681. __experimentalDefaultControls: {
  6682. background: true,
  6683. text: true
  6684. }
  6685. },
  6686. typography: {
  6687. fontSize: true,
  6688. lineHeight: true,
  6689. __experimentalFontFamily: true,
  6690. __experimentalFontWeight: true,
  6691. __experimentalFontStyle: true,
  6692. __experimentalTextTransform: true,
  6693. __experimentalLetterSpacing: true
  6694. },
  6695. spacing: {
  6696. padding: ["horizontal", "vertical"],
  6697. __experimentalDefaultControls: {
  6698. padding: true
  6699. }
  6700. },
  6701. html: false
  6702. }
  6703. };
  6704. const {
  6705. name: comment_content_name
  6706. } = comment_content_metadata;
  6707. const comment_content_settings = {
  6708. icon: comment_content,
  6709. edit: comment_content_edit_Edit
  6710. };
  6711. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-date.js
  6712. /**
  6713. * WordPress dependencies
  6714. */
  6715. const postDate = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  6716. xmlns: "http://www.w3.org/2000/svg",
  6717. viewBox: "0 0 24 24"
  6718. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  6719. d: "M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z"
  6720. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  6721. d: "M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"
  6722. }));
  6723. /* harmony default export */ var post_date = (postDate);
  6724. ;// CONCATENATED MODULE: external ["wp","date"]
  6725. var external_wp_date_namespaceObject = window["wp"]["date"];
  6726. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-date/edit.js
  6727. /**
  6728. * WordPress dependencies
  6729. */
  6730. /**
  6731. * Renders the `core/comment-date` block on the editor.
  6732. *
  6733. * @param {Object} props React props.
  6734. * @param {Object} props.setAttributes Callback for updating block attributes.
  6735. * @param {Object} props.attributes Block attributes.
  6736. * @param {string} props.attributes.format Format of the date.
  6737. * @param {string} props.attributes.isLink Whether the author name should be linked.
  6738. * @param {Object} props.context Inherited context.
  6739. * @param {string} props.context.commentId The comment ID.
  6740. *
  6741. * @return {JSX.Element} React element.
  6742. */
  6743. function comment_date_edit_Edit(_ref) {
  6744. let {
  6745. attributes: {
  6746. format,
  6747. isLink
  6748. },
  6749. context: {
  6750. commentId
  6751. },
  6752. setAttributes
  6753. } = _ref;
  6754. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  6755. let [date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'date', commentId);
  6756. const [siteFormat = (0,external_wp_date_namespaceObject.__experimentalGetSettings)().formats.date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'date_format');
  6757. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  6758. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  6759. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalDateFormatPicker, {
  6760. format: format,
  6761. defaultFormat: siteFormat,
  6762. onChange: nextFormat => setAttributes({
  6763. format: nextFormat
  6764. })
  6765. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  6766. label: (0,external_wp_i18n_namespaceObject.__)('Link to comment'),
  6767. onChange: () => setAttributes({
  6768. isLink: !isLink
  6769. }),
  6770. checked: isLink
  6771. })));
  6772. if (!commentId || !date) {
  6773. date = (0,external_wp_i18n_namespaceObject._x)('Comment Date', 'block title');
  6774. }
  6775. let commentDate = date instanceof Date ? (0,external_wp_element_namespaceObject.createElement)("time", {
  6776. dateTime: (0,external_wp_date_namespaceObject.dateI18n)('c', date)
  6777. }, (0,external_wp_date_namespaceObject.dateI18n)(format || siteFormat, date)) : (0,external_wp_element_namespaceObject.createElement)("time", null, date);
  6778. if (isLink) {
  6779. commentDate = (0,external_wp_element_namespaceObject.createElement)("a", {
  6780. href: "#comment-date-pseudo-link",
  6781. onClick: event => event.preventDefault()
  6782. }, commentDate);
  6783. }
  6784. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, commentDate));
  6785. }
  6786. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-date/deprecated.js
  6787. /**
  6788. * Internal dependencies
  6789. */
  6790. const deprecated_v1 = {
  6791. attributes: {
  6792. format: {
  6793. type: 'string'
  6794. },
  6795. isLink: {
  6796. type: 'boolean',
  6797. default: false
  6798. }
  6799. },
  6800. supports: {
  6801. html: false,
  6802. color: {
  6803. gradients: true,
  6804. link: true
  6805. },
  6806. typography: {
  6807. fontSize: true,
  6808. lineHeight: true,
  6809. __experimentalFontFamily: true,
  6810. __experimentalFontWeight: true,
  6811. __experimentalFontStyle: true,
  6812. __experimentalTextTransform: true,
  6813. __experimentalLetterSpacing: true
  6814. }
  6815. },
  6816. save() {
  6817. return null;
  6818. },
  6819. migrate: migrate_font_family,
  6820. isEligible(_ref) {
  6821. var _style$typography;
  6822. let {
  6823. style
  6824. } = _ref;
  6825. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  6826. }
  6827. };
  6828. /**
  6829. * New deprecations need to be placed first
  6830. * for them to have higher priority.
  6831. *
  6832. * Old deprecations may need to be updated as well.
  6833. *
  6834. * See block-deprecation.md
  6835. */
  6836. /* harmony default export */ var comment_date_deprecated = ([deprecated_v1]);
  6837. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-date/index.js
  6838. /**
  6839. * WordPress dependencies
  6840. */
  6841. /**
  6842. * Internal dependencies
  6843. */
  6844. const comment_date_metadata = {
  6845. $schema: "https://schemas.wp.org/trunk/block.json",
  6846. apiVersion: 2,
  6847. name: "core/comment-date",
  6848. title: "Comment Date",
  6849. category: "theme",
  6850. ancestor: ["core/comment-template"],
  6851. description: "Displays the date on which the comment was posted.",
  6852. textdomain: "default",
  6853. attributes: {
  6854. format: {
  6855. type: "string"
  6856. },
  6857. isLink: {
  6858. type: "boolean",
  6859. "default": true
  6860. }
  6861. },
  6862. usesContext: ["commentId"],
  6863. supports: {
  6864. html: false,
  6865. color: {
  6866. gradients: true,
  6867. link: true,
  6868. __experimentalDefaultControls: {
  6869. background: true,
  6870. text: true,
  6871. link: true
  6872. }
  6873. },
  6874. typography: {
  6875. fontSize: true,
  6876. lineHeight: true,
  6877. __experimentalFontFamily: true,
  6878. __experimentalFontWeight: true,
  6879. __experimentalFontStyle: true,
  6880. __experimentalTextTransform: true,
  6881. __experimentalLetterSpacing: true,
  6882. __experimentalDefaultControls: {
  6883. fontSize: true
  6884. }
  6885. }
  6886. }
  6887. };
  6888. const {
  6889. name: comment_date_name
  6890. } = comment_date_metadata;
  6891. const comment_date_settings = {
  6892. icon: post_date,
  6893. edit: comment_date_edit_Edit,
  6894. deprecated: comment_date_deprecated
  6895. };
  6896. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-edit-link.js
  6897. /**
  6898. * WordPress dependencies
  6899. */
  6900. const commentEditLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  6901. width: "24",
  6902. height: "24",
  6903. viewBox: "0 0 24 24",
  6904. xmlns: "http://www.w3.org/2000/svg"
  6905. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  6906. d: "m6.249 11.065.44-.44h3.186l-1.5 1.5H7.31l-1.957 1.96A.792.792 0 0 1 4 13.524V5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v1.5L12.5 8V5.5h-7v6.315l.749-.75ZM20 19.75H7v-1.5h13v1.5Zm0-12.653-8.967 9.064L8 17l.867-2.935L17.833 5 20 7.097Z"
  6907. }));
  6908. /* harmony default export */ var comment_edit_link = (commentEditLink);
  6909. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/edit.js
  6910. /**
  6911. * External dependencies
  6912. */
  6913. /**
  6914. * WordPress dependencies
  6915. */
  6916. function comment_edit_link_edit_Edit(_ref) {
  6917. let {
  6918. attributes: {
  6919. linkTarget,
  6920. textAlign
  6921. },
  6922. setAttributes
  6923. } = _ref;
  6924. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  6925. className: classnames_default()({
  6926. [`has-text-align-${textAlign}`]: textAlign
  6927. })
  6928. });
  6929. const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  6930. group: "block"
  6931. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  6932. value: textAlign,
  6933. onChange: newAlign => setAttributes({
  6934. textAlign: newAlign
  6935. })
  6936. }));
  6937. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  6938. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  6939. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  6940. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  6941. onChange: value => setAttributes({
  6942. linkTarget: value ? '_blank' : '_self'
  6943. }),
  6944. checked: linkTarget === '_blank'
  6945. })));
  6946. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
  6947. href: "#edit-comment-pseudo-link",
  6948. onClick: event => event.preventDefault()
  6949. }, (0,external_wp_i18n_namespaceObject.__)('Edit'))));
  6950. }
  6951. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/index.js
  6952. /**
  6953. * WordPress dependencies
  6954. */
  6955. /**
  6956. * Internal dependencies
  6957. */
  6958. const comment_edit_link_metadata = {
  6959. $schema: "https://schemas.wp.org/trunk/block.json",
  6960. apiVersion: 2,
  6961. name: "core/comment-edit-link",
  6962. title: "Comment Edit Link",
  6963. category: "theme",
  6964. ancestor: ["core/comment-template"],
  6965. description: "Displays a link to edit the comment in the WordPress Dashboard. This link is only visible to users with the edit comment capability.",
  6966. textdomain: "default",
  6967. usesContext: ["commentId"],
  6968. attributes: {
  6969. linkTarget: {
  6970. type: "string",
  6971. "default": "_self"
  6972. },
  6973. textAlign: {
  6974. type: "string"
  6975. }
  6976. },
  6977. supports: {
  6978. html: false,
  6979. color: {
  6980. link: true,
  6981. gradients: true,
  6982. text: false,
  6983. __experimentalDefaultControls: {
  6984. background: true,
  6985. link: true
  6986. }
  6987. },
  6988. typography: {
  6989. fontSize: true,
  6990. lineHeight: true,
  6991. __experimentalFontFamily: true,
  6992. __experimentalFontWeight: true,
  6993. __experimentalFontStyle: true,
  6994. __experimentalTextTransform: true,
  6995. __experimentalLetterSpacing: true
  6996. }
  6997. }
  6998. };
  6999. const {
  7000. name: comment_edit_link_name
  7001. } = comment_edit_link_metadata;
  7002. const comment_edit_link_settings = {
  7003. icon: comment_edit_link,
  7004. edit: comment_edit_link_edit_Edit
  7005. };
  7006. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-reply-link.js
  7007. /**
  7008. * WordPress dependencies
  7009. */
  7010. const commentReplyLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  7011. width: "24",
  7012. height: "24",
  7013. viewBox: "0 0 24 24",
  7014. xmlns: "http://www.w3.org/2000/svg"
  7015. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  7016. d: "M6.68822 10.625L6.24878 11.0649L5.5 11.8145L5.5 5.5L12.5 5.5V8L14 6.5V5C14 4.44772 13.5523 4 13 4H5C4.44772 4 4 4.44771 4 5V13.5247C4 13.8173 4.16123 14.086 4.41935 14.2237C4.72711 14.3878 5.10601 14.3313 5.35252 14.0845L7.31 12.125H8.375L9.875 10.625H7.31H6.68822ZM14.5605 10.4983L11.6701 13.75H16.9975C17.9963 13.75 18.7796 14.1104 19.3553 14.7048C19.9095 15.2771 20.2299 16.0224 20.4224 16.7443C20.7645 18.0276 20.7543 19.4618 20.7487 20.2544C20.7481 20.345 20.7475 20.4272 20.7475 20.4999L19.2475 20.5001C19.2475 20.4191 19.248 20.3319 19.2484 20.2394V20.2394C19.2526 19.4274 19.259 18.2035 18.973 17.1307C18.8156 16.5401 18.586 16.0666 18.2778 15.7483C17.9909 15.4521 17.5991 15.25 16.9975 15.25H11.8106L14.5303 17.9697L13.4696 19.0303L8.96956 14.5303L13.4394 9.50171L14.5605 10.4983Z"
  7017. }));
  7018. /* harmony default export */ var comment_reply_link = (commentReplyLink);
  7019. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/edit.js
  7020. /**
  7021. * External dependencies
  7022. */
  7023. /**
  7024. * WordPress dependencies
  7025. */
  7026. /**
  7027. * Renders the `core/comment-reply-link` block on the editor.
  7028. *
  7029. * @param {Object} props React props.
  7030. * @param {Object} props.setAttributes Callback for updating block attributes.
  7031. * @param {Object} props.attributes Block attributes.
  7032. * @param {string} props.attributes.textAlign The `textAlign` attribute.
  7033. *
  7034. * @return {JSX.Element} React element.
  7035. */
  7036. function comment_reply_link_edit_Edit(_ref) {
  7037. let {
  7038. setAttributes,
  7039. attributes: {
  7040. textAlign
  7041. }
  7042. } = _ref;
  7043. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  7044. className: classnames_default()({
  7045. [`has-text-align-${textAlign}`]: textAlign
  7046. })
  7047. });
  7048. const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  7049. group: "block"
  7050. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  7051. value: textAlign,
  7052. onChange: newAlign => setAttributes({
  7053. textAlign: newAlign
  7054. })
  7055. }));
  7056. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
  7057. href: "#comment-reply-pseudo-link",
  7058. onClick: event => event.preventDefault()
  7059. }, (0,external_wp_i18n_namespaceObject.__)('Reply'))));
  7060. }
  7061. /* harmony default export */ var comment_reply_link_edit = (comment_reply_link_edit_Edit);
  7062. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/index.js
  7063. /**
  7064. * WordPress dependencies
  7065. */
  7066. /**
  7067. * Internal dependencies
  7068. */
  7069. const comment_reply_link_metadata = {
  7070. $schema: "https://schemas.wp.org/trunk/block.json",
  7071. apiVersion: 2,
  7072. name: "core/comment-reply-link",
  7073. title: "Comment Reply Link",
  7074. category: "theme",
  7075. ancestor: ["core/comment-template"],
  7076. description: "Displays a link to reply to a comment.",
  7077. textdomain: "default",
  7078. usesContext: ["commentId"],
  7079. attributes: {
  7080. textAlign: {
  7081. type: "string"
  7082. }
  7083. },
  7084. supports: {
  7085. color: {
  7086. gradients: true,
  7087. link: true,
  7088. text: false,
  7089. __experimentalDefaultControls: {
  7090. background: true,
  7091. link: true
  7092. }
  7093. },
  7094. typography: {
  7095. fontSize: true,
  7096. lineHeight: true,
  7097. __experimentalFontFamily: true,
  7098. __experimentalFontWeight: true,
  7099. __experimentalFontStyle: true,
  7100. __experimentalTextTransform: true,
  7101. __experimentalLetterSpacing: true
  7102. },
  7103. html: false
  7104. }
  7105. };
  7106. const {
  7107. name: comment_reply_link_name
  7108. } = comment_reply_link_metadata;
  7109. const comment_reply_link_settings = {
  7110. edit: comment_reply_link_edit,
  7111. icon: comment_reply_link
  7112. };
  7113. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js
  7114. /**
  7115. * WordPress dependencies
  7116. */
  7117. const layout = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  7118. xmlns: "http://www.w3.org/2000/svg",
  7119. viewBox: "0 0 24 24"
  7120. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  7121. d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
  7122. }));
  7123. /* harmony default export */ var library_layout = (layout);
  7124. ;// CONCATENATED MODULE: external ["wp","apiFetch"]
  7125. var external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
  7126. var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
  7127. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/hooks.js
  7128. /**
  7129. * WordPress dependencies
  7130. */
  7131. // This is limited by WP REST API
  7132. const MAX_COMMENTS_PER_PAGE = 100;
  7133. /**
  7134. * Return an object with the query args needed to fetch the default page of
  7135. * comments.
  7136. *
  7137. * @param {Object} props Hook props.
  7138. * @param {number} props.postId ID of the post that contains the comments.
  7139. * discussion settings.
  7140. *
  7141. * @return {Object} Query args to retrieve the comments.
  7142. */
  7143. const useCommentQueryArgs = _ref => {
  7144. let {
  7145. postId
  7146. } = _ref;
  7147. // Initialize the query args that are not going to change.
  7148. const queryArgs = {
  7149. status: 'approve',
  7150. order: 'asc',
  7151. context: 'embed',
  7152. parent: 0,
  7153. _embed: 'children'
  7154. }; // Get the Discussion settings that may be needed to query the comments.
  7155. const {
  7156. pageComments,
  7157. commentsPerPage,
  7158. defaultCommentsPage: defaultPage
  7159. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  7160. const {
  7161. getSettings
  7162. } = select(external_wp_blockEditor_namespaceObject.store);
  7163. const {
  7164. __experimentalDiscussionSettings
  7165. } = getSettings();
  7166. return __experimentalDiscussionSettings;
  7167. }); // WP REST API doesn't allow fetching more than max items limit set per single page of data.
  7168. // As for the editor performance is more important than completeness of data and fetching only the
  7169. // max allowed for single page should be enough for the purpose of design and laying out the page.
  7170. // Fetching over the limit would return an error here but would work with backend query.
  7171. const perPage = pageComments ? Math.min(commentsPerPage, MAX_COMMENTS_PER_PAGE) : MAX_COMMENTS_PER_PAGE; // Get the number of the default page.
  7172. const page = useDefaultPageIndex({
  7173. defaultPage,
  7174. postId,
  7175. perPage,
  7176. queryArgs
  7177. }); // Merge, memoize and return all query arguments, unless the default page's
  7178. // number is not known yet.
  7179. return (0,external_wp_element_namespaceObject.useMemo)(() => {
  7180. return page ? { ...queryArgs,
  7181. post: postId,
  7182. per_page: perPage,
  7183. page
  7184. } : null;
  7185. }, [postId, perPage, page]);
  7186. };
  7187. /**
  7188. * Return the index of the default page, depending on whether `defaultPage` is
  7189. * `newest` or `oldest`. In the first case, the only way to know the page's
  7190. * index is by using the `X-WP-TotalPages` header, which forces to make an
  7191. * additional request.
  7192. *
  7193. * @param {Object} props Hook props.
  7194. * @param {string} props.defaultPage Page shown by default (newest/oldest).
  7195. * @param {number} props.postId ID of the post that contains the comments.
  7196. * @param {number} props.perPage The number of comments included per page.
  7197. * @param {Object} props.queryArgs Other query args.
  7198. *
  7199. * @return {number} Index of the default comments page.
  7200. */
  7201. const useDefaultPageIndex = _ref2 => {
  7202. let {
  7203. defaultPage,
  7204. postId,
  7205. perPage,
  7206. queryArgs
  7207. } = _ref2;
  7208. // Store the default page indices.
  7209. const [defaultPages, setDefaultPages] = (0,external_wp_element_namespaceObject.useState)({});
  7210. const key = `${postId}_${perPage}`;
  7211. const page = defaultPages[key] || 0;
  7212. (0,external_wp_element_namespaceObject.useEffect)(() => {
  7213. // Do nothing if the page is already known or not the newest page.
  7214. if (page || defaultPage !== 'newest') {
  7215. return;
  7216. } // We need to fetch comments to know the index. Use HEAD and limit
  7217. // fields just to ID, to make this call as light as possible.
  7218. external_wp_apiFetch_default()({
  7219. path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', { ...queryArgs,
  7220. post: postId,
  7221. per_page: perPage,
  7222. _fields: 'id'
  7223. }),
  7224. method: 'HEAD',
  7225. parse: false
  7226. }).then(res => {
  7227. const pages = parseInt(res.headers.get('X-WP-TotalPages'));
  7228. setDefaultPages({ ...defaultPages,
  7229. [key]: pages <= 1 ? 1 : pages // If there are 0 pages, it means that there are no comments, but there is no 0th page.
  7230. });
  7231. });
  7232. }, [defaultPage, postId, perPage, setDefaultPages]); // The oldest one is always the first one.
  7233. return defaultPage === 'newest' ? page : 1;
  7234. };
  7235. /**
  7236. * Generate a tree structure of comment IDs from a list of comment entities. The
  7237. * children of each comment are obtained from `_embedded`.
  7238. *
  7239. * @typedef {{ commentId: number, children: CommentNode }} CommentNode
  7240. *
  7241. * @param {Object[]} topLevelComments List of comment entities.
  7242. * @return {{ commentTree: CommentNode[]}} Tree of comment IDs.
  7243. */
  7244. const useCommentTree = topLevelComments => {
  7245. const commentTree = (0,external_wp_element_namespaceObject.useMemo)(() => topLevelComments === null || topLevelComments === void 0 ? void 0 : topLevelComments.map(_ref3 => {
  7246. let {
  7247. id,
  7248. _embedded
  7249. } = _ref3;
  7250. const [children] = (_embedded === null || _embedded === void 0 ? void 0 : _embedded.children) || [[]];
  7251. return {
  7252. commentId: id,
  7253. children: children.map(child => ({
  7254. commentId: child.id
  7255. }))
  7256. };
  7257. }), [topLevelComments]);
  7258. return commentTree;
  7259. };
  7260. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/edit.js
  7261. /**
  7262. * WordPress dependencies
  7263. */
  7264. /**
  7265. * Internal dependencies
  7266. */
  7267. const TEMPLATE = [['core/avatar'], ['core/comment-author-name'], ['core/comment-date'], ['core/comment-content'], ['core/comment-reply-link'], ['core/comment-edit-link']];
  7268. /**
  7269. * Function that returns a comment structure that will be rendered with default placehoders.
  7270. *
  7271. * Each comment has a `commentId` property that is always a negative number in
  7272. * case of the placeholders. This is to ensure that the comment does not
  7273. * conflict with the actual (real) comments.
  7274. *
  7275. * @param {Object} settings Discussion Settings.
  7276. * @param {number} [settings.perPage] - Comments per page setting or block attribute.
  7277. * @param {boolean} [settings.threadComments] - Enable threaded (nested) comments setting.
  7278. * @param {number} [settings.threadCommentsDepth] - Level deep of threaded comments.
  7279. *
  7280. * @typedef {{id: null, children: EmptyComment[]}} EmptyComment
  7281. * @return {EmptyComment[]} Inner blocks of the Comment Template
  7282. */
  7283. const getCommentsPlaceholder = _ref => {
  7284. let {
  7285. perPage,
  7286. threadComments,
  7287. threadCommentsDepth
  7288. } = _ref;
  7289. // In case that `threadCommentsDepth` is falsy, we default to a somewhat
  7290. // arbitrary value of 3.
  7291. // In case that the value is set but larger than 3 we truncate it to 3.
  7292. const commentsDepth = Math.min(threadCommentsDepth || 3, 3); // We set a limit in order not to overload the editor of empty comments.
  7293. const defaultCommentsToShow = perPage <= commentsDepth ? perPage : commentsDepth;
  7294. if (!threadComments || defaultCommentsToShow === 1) {
  7295. // If displaying threaded comments is disabled, we only show one comment
  7296. // A commentId is negative in order to avoid conflicts with the actual comments.
  7297. return [{
  7298. commentId: -1,
  7299. children: []
  7300. }];
  7301. } else if (defaultCommentsToShow === 2) {
  7302. return [{
  7303. commentId: -1,
  7304. children: [{
  7305. commentId: -2,
  7306. children: []
  7307. }]
  7308. }];
  7309. } // In case that the value is set but larger than 3 we truncate it to 3.
  7310. return [{
  7311. commentId: -1,
  7312. children: [{
  7313. commentId: -2,
  7314. children: [{
  7315. commentId: -3,
  7316. children: []
  7317. }]
  7318. }]
  7319. }];
  7320. };
  7321. /**
  7322. * Component which renders the inner blocks of the Comment Template.
  7323. *
  7324. * @param {Object} props Component props.
  7325. * @param {Array} [props.comment] - A comment object.
  7326. * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active.
  7327. * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId.
  7328. * @param {Array} [props.firstCommentId] - ID of the first comment in the array.
  7329. * @param {Array} [props.blocks] - Array of blocks returned from
  7330. * getBlocks() in parent .
  7331. * @return {WPElement} Inner blocks of the Comment Template
  7332. */
  7333. function CommentTemplateInnerBlocks(_ref2) {
  7334. var _comment$children;
  7335. let {
  7336. comment,
  7337. activeCommentId,
  7338. setActiveCommentId,
  7339. firstCommentId,
  7340. blocks
  7341. } = _ref2;
  7342. const {
  7343. children,
  7344. ...innerBlocksProps
  7345. } = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({}, {
  7346. template: TEMPLATE
  7347. });
  7348. return (0,external_wp_element_namespaceObject.createElement)("li", innerBlocksProps, comment.commentId === (activeCommentId || firstCommentId) ? children : null, (0,external_wp_element_namespaceObject.createElement)(MemoizedCommentTemplatePreview, {
  7349. blocks: blocks,
  7350. commentId: comment.commentId,
  7351. setActiveCommentId: setActiveCommentId,
  7352. isHidden: comment.commentId === (activeCommentId || firstCommentId)
  7353. }), (comment === null || comment === void 0 ? void 0 : (_comment$children = comment.children) === null || _comment$children === void 0 ? void 0 : _comment$children.length) > 0 ? (0,external_wp_element_namespaceObject.createElement)(CommentsList, {
  7354. comments: comment.children,
  7355. activeCommentId: activeCommentId,
  7356. setActiveCommentId: setActiveCommentId,
  7357. blocks: blocks,
  7358. firstCommentId: firstCommentId
  7359. }) : null);
  7360. }
  7361. const CommentTemplatePreview = _ref3 => {
  7362. let {
  7363. blocks,
  7364. commentId,
  7365. setActiveCommentId,
  7366. isHidden
  7367. } = _ref3;
  7368. const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({
  7369. blocks
  7370. });
  7371. const handleOnClick = () => {
  7372. setActiveCommentId(commentId);
  7373. }; // We have to hide the preview block if the `comment` props points to
  7374. // the curently active block!
  7375. // Or, to put it differently, every preview block is visible unless it is the
  7376. // currently active block - in this case we render its inner blocks.
  7377. const style = {
  7378. display: isHidden ? 'none' : undefined
  7379. };
  7380. return (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockPreviewProps, {
  7381. tabIndex: 0,
  7382. role: "button",
  7383. style: style // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
  7384. ,
  7385. onClick: handleOnClick,
  7386. onKeyPress: handleOnClick
  7387. }));
  7388. };
  7389. const MemoizedCommentTemplatePreview = (0,external_wp_element_namespaceObject.memo)(CommentTemplatePreview);
  7390. /**
  7391. * Component that renders a list of (nested) comments. It is called recursively.
  7392. *
  7393. * @param {Object} props Component props.
  7394. * @param {Array} [props.comments] - Array of comment objects.
  7395. * @param {Array} [props.blockProps] - Props from parent's `useBlockProps()`.
  7396. * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active.
  7397. * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId.
  7398. * @param {Array} [props.blocks] - Array of blocks returned from getBlocks() in parent.
  7399. * @param {Object} [props.firstCommentId] - The ID of the first comment in the array of
  7400. * comment objects.
  7401. * @return {WPElement} List of comments.
  7402. */
  7403. const CommentsList = _ref4 => {
  7404. let {
  7405. comments,
  7406. blockProps,
  7407. activeCommentId,
  7408. setActiveCommentId,
  7409. blocks,
  7410. firstCommentId
  7411. } = _ref4;
  7412. return (0,external_wp_element_namespaceObject.createElement)("ol", blockProps, comments && comments.map((_ref5, index) => {
  7413. let {
  7414. commentId,
  7415. ...comment
  7416. } = _ref5;
  7417. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockContextProvider, {
  7418. key: comment.commentId || index,
  7419. value: {
  7420. // If the commentId is negative it means that this comment is a
  7421. // "placeholder" and that the block is most likely being used in the
  7422. // site editor. In this case, we have to set the commentId to `null`
  7423. // because otherwise the (non-existent) comment with a negative ID
  7424. // would be reqested from the REST API.
  7425. commentId: commentId < 0 ? null : commentId
  7426. }
  7427. }, (0,external_wp_element_namespaceObject.createElement)(CommentTemplateInnerBlocks, {
  7428. comment: {
  7429. commentId,
  7430. ...comment
  7431. },
  7432. activeCommentId: activeCommentId,
  7433. setActiveCommentId: setActiveCommentId,
  7434. blocks: blocks,
  7435. firstCommentId: firstCommentId
  7436. }));
  7437. }));
  7438. };
  7439. function CommentTemplateEdit(_ref6) {
  7440. var _commentTree$;
  7441. let {
  7442. clientId,
  7443. context: {
  7444. postId
  7445. }
  7446. } = _ref6;
  7447. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  7448. const [activeCommentId, setActiveCommentId] = (0,external_wp_element_namespaceObject.useState)();
  7449. const {
  7450. commentOrder,
  7451. threadCommentsDepth,
  7452. threadComments,
  7453. commentsPerPage
  7454. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  7455. const {
  7456. getSettings
  7457. } = select(external_wp_blockEditor_namespaceObject.store);
  7458. return getSettings().__experimentalDiscussionSettings;
  7459. });
  7460. const commentQuery = useCommentQueryArgs({
  7461. postId
  7462. });
  7463. const {
  7464. topLevelComments,
  7465. blocks
  7466. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  7467. const {
  7468. getEntityRecords
  7469. } = select(external_wp_coreData_namespaceObject.store);
  7470. const {
  7471. getBlocks
  7472. } = select(external_wp_blockEditor_namespaceObject.store);
  7473. return {
  7474. // Request only top-level comments. Replies are embedded.
  7475. topLevelComments: commentQuery ? getEntityRecords('root', 'comment', commentQuery) : null,
  7476. blocks: getBlocks(clientId)
  7477. };
  7478. }, [clientId, commentQuery]); // Generate a tree structure of comment IDs.
  7479. let commentTree = useCommentTree( // Reverse the order of top comments if needed.
  7480. commentOrder === 'desc' && topLevelComments ? [...topLevelComments].reverse() : topLevelComments);
  7481. if (!topLevelComments) {
  7482. return (0,external_wp_element_namespaceObject.createElement)("p", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
  7483. }
  7484. if (!postId) {
  7485. commentTree = getCommentsPlaceholder({
  7486. perPage: commentsPerPage,
  7487. threadComments,
  7488. threadCommentsDepth
  7489. });
  7490. }
  7491. if (!commentTree.length) {
  7492. return (0,external_wp_element_namespaceObject.createElement)("p", _extends({}, blockProps, {
  7493. "data-testid": "noresults"
  7494. }), (0,external_wp_i18n_namespaceObject.__)('No results found.'));
  7495. }
  7496. return (0,external_wp_element_namespaceObject.createElement)(CommentsList, {
  7497. comments: commentTree,
  7498. blockProps: blockProps,
  7499. blocks: blocks,
  7500. activeCommentId: activeCommentId,
  7501. setActiveCommentId: setActiveCommentId,
  7502. firstCommentId: (_commentTree$ = commentTree[0]) === null || _commentTree$ === void 0 ? void 0 : _commentTree$.commentId
  7503. });
  7504. }
  7505. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/save.js
  7506. /**
  7507. * WordPress dependencies
  7508. */
  7509. function CommentTemplateSave() {
  7510. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  7511. }
  7512. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/index.js
  7513. /**
  7514. * WordPress dependencies
  7515. */
  7516. /**
  7517. * Internal dependencies
  7518. */
  7519. const comment_template_metadata = {
  7520. $schema: "https://schemas.wp.org/trunk/block.json",
  7521. apiVersion: 2,
  7522. name: "core/comment-template",
  7523. title: "Comment Template",
  7524. category: "design",
  7525. parent: ["core/comments-query-loop"],
  7526. description: "Contains the block elements used to display a comment, like the title, date, author, avatar and more.",
  7527. textdomain: "default",
  7528. usesContext: ["postId"],
  7529. supports: {
  7530. reusable: false,
  7531. html: false,
  7532. align: true
  7533. },
  7534. style: "wp-block-comment-template"
  7535. };
  7536. const {
  7537. name: comment_template_name
  7538. } = comment_template_metadata;
  7539. const comment_template_settings = {
  7540. icon: library_layout,
  7541. edit: CommentTemplateEdit,
  7542. save: CommentTemplateSave
  7543. };
  7544. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-previous.js
  7545. /**
  7546. * WordPress dependencies
  7547. */
  7548. const queryPaginationPrevious = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  7549. xmlns: "http://www.w3.org/2000/svg",
  7550. viewBox: "0 0 24 24"
  7551. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  7552. d: "M16 10.5v3h3v-3h-3zm-5 3h3v-3h-3v3zM7 9l-3 3 3 3 1-1-2-2 2-2-1-1z"
  7553. }));
  7554. /* harmony default export */ var query_pagination_previous = (queryPaginationPrevious);
  7555. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/edit.js
  7556. /**
  7557. * WordPress dependencies
  7558. */
  7559. const arrowMap = {
  7560. none: '',
  7561. arrow: '←',
  7562. chevron: '«'
  7563. };
  7564. function CommentsPaginationPreviousEdit(_ref) {
  7565. let {
  7566. attributes: {
  7567. label
  7568. },
  7569. setAttributes,
  7570. context: {
  7571. 'comments/paginationArrow': paginationArrow
  7572. }
  7573. } = _ref;
  7574. const displayArrow = arrowMap[paginationArrow];
  7575. return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
  7576. href: "#comments-pagination-previous-pseudo-link",
  7577. onClick: event => event.preventDefault()
  7578. }, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
  7579. className: `wp-block-comments-pagination-previous-arrow is-arrow-${paginationArrow}`
  7580. }, displayArrow), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  7581. __experimentalVersion: 2,
  7582. tagName: "span",
  7583. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Older comments page link'),
  7584. placeholder: (0,external_wp_i18n_namespaceObject.__)('Older Comments'),
  7585. value: label,
  7586. onChange: newLabel => setAttributes({
  7587. label: newLabel
  7588. })
  7589. }));
  7590. }
  7591. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/index.js
  7592. /**
  7593. * WordPress dependencies
  7594. */
  7595. /**
  7596. * Internal dependencies
  7597. */
  7598. const comments_pagination_previous_metadata = {
  7599. $schema: "https://schemas.wp.org/trunk/block.json",
  7600. apiVersion: 2,
  7601. name: "core/comments-pagination-previous",
  7602. title: "Previous Page",
  7603. category: "theme",
  7604. parent: ["core/comments-pagination"],
  7605. description: "Displays the previous comment's page link.",
  7606. textdomain: "default",
  7607. attributes: {
  7608. label: {
  7609. type: "string"
  7610. }
  7611. },
  7612. usesContext: ["postId", "comments/paginationArrow"],
  7613. supports: {
  7614. reusable: false,
  7615. html: false,
  7616. color: {
  7617. gradients: true,
  7618. text: false,
  7619. __experimentalDefaultControls: {
  7620. background: true
  7621. }
  7622. },
  7623. typography: {
  7624. fontSize: true,
  7625. lineHeight: true,
  7626. __experimentalFontStyle: true,
  7627. __experimentalFontWeight: true,
  7628. __experimentalLetterSpacing: true,
  7629. __experimentalTextTransform: true,
  7630. __experimentalDefaultControls: {
  7631. fontSize: true
  7632. }
  7633. }
  7634. }
  7635. };
  7636. const {
  7637. name: comments_pagination_previous_name
  7638. } = comments_pagination_previous_metadata;
  7639. const comments_pagination_previous_settings = {
  7640. icon: query_pagination_previous,
  7641. edit: CommentsPaginationPreviousEdit
  7642. };
  7643. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-comments.js
  7644. /**
  7645. * WordPress dependencies
  7646. */
  7647. const postComments = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  7648. xmlns: "http://www.w3.org/2000/svg",
  7649. viewBox: "0 0 24 24"
  7650. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  7651. d: "M14 10.1V4c0-.6-.4-1-1-1H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1zm-1.5-.5H6.7l-1.2 1.2V4.5h7v5.1zM19 12h-8c-.6 0-1 .4-1 1v6.1c0 .6.4 1 1 1h5.7l1.8 1.8c.1.2.4.3.6.3.1 0 .2 0 .3-.1.4-.1.6-.5.6-.8V13c0-.6-.4-1-1-1zm-.5 7.8l-1.2-1.2h-5.8v-5.1h7v6.3z"
  7652. }));
  7653. /* harmony default export */ var post_comments = (postComments);
  7654. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-query-loop/edit/comments-inspector-controls.js
  7655. /**
  7656. * WordPress dependencies
  7657. */
  7658. function CommentsInspectorControls(_ref) {
  7659. let {
  7660. attributes: {
  7661. TagName
  7662. },
  7663. setAttributes
  7664. } = _ref;
  7665. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  7666. __experimentalGroup: "advanced"
  7667. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  7668. label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
  7669. options: [{
  7670. label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'),
  7671. value: 'div'
  7672. }, {
  7673. label: '<section>',
  7674. value: 'section'
  7675. }, {
  7676. label: '<aside>',
  7677. value: 'aside'
  7678. }],
  7679. value: TagName,
  7680. onChange: value => setAttributes({
  7681. tagName: value
  7682. })
  7683. })));
  7684. }
  7685. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-query-loop/edit.js
  7686. /**
  7687. * WordPress dependencies
  7688. */
  7689. /**
  7690. * Internal dependencies
  7691. */
  7692. const edit_TEMPLATE = [['core/comments-title'], ['core/comment-template', {}, [['core/columns', {}, [['core/column', {
  7693. width: '40px'
  7694. }, [['core/avatar', {
  7695. size: 40,
  7696. style: {
  7697. border: {
  7698. radius: '20px'
  7699. }
  7700. }
  7701. }]]], ['core/column', {}, [['core/comment-author-name', {
  7702. fontSize: 'small'
  7703. }], ['core/group', {
  7704. layout: {
  7705. type: 'flex'
  7706. },
  7707. style: {
  7708. spacing: {
  7709. margin: {
  7710. top: '0px',
  7711. bottom: '0px'
  7712. }
  7713. }
  7714. }
  7715. }, [['core/comment-date', {
  7716. fontSize: 'small'
  7717. }], ['core/comment-edit-link', {
  7718. fontSize: 'small'
  7719. }]]], ['core/comment-content'], ['core/comment-reply-link', {
  7720. fontSize: 'small'
  7721. }]]]]]]], ['core/comments-pagination'], ['core/post-comments-form']];
  7722. function CommentsQueryLoopEdit(_ref) {
  7723. let {
  7724. attributes,
  7725. setAttributes
  7726. } = _ref;
  7727. const {
  7728. tagName: TagName
  7729. } = attributes;
  7730. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  7731. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  7732. template: edit_TEMPLATE
  7733. });
  7734. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(CommentsInspectorControls, {
  7735. attributes: attributes,
  7736. setAttributes: setAttributes
  7737. }), (0,external_wp_element_namespaceObject.createElement)(TagName, innerBlocksProps));
  7738. }
  7739. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-query-loop/save.js
  7740. /**
  7741. * WordPress dependencies
  7742. */
  7743. function CommentsQueryLoopSave(_ref) {
  7744. let {
  7745. attributes: {
  7746. tagName: Tag
  7747. }
  7748. } = _ref;
  7749. return (0,external_wp_element_namespaceObject.createElement)(Tag, external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  7750. }
  7751. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-query-loop/index.js
  7752. /**
  7753. * WordPress dependencies
  7754. */
  7755. /**
  7756. * Internal dependencies
  7757. */
  7758. const comments_query_loop_metadata = {
  7759. $schema: "https://schemas.wp.org/trunk/block.json",
  7760. apiVersion: 2,
  7761. name: "core/comments-query-loop",
  7762. title: "Comments Query Loop",
  7763. category: "theme",
  7764. description: "An advanced block that allows displaying post comments using different visual configurations.",
  7765. textdomain: "default",
  7766. attributes: {
  7767. tagName: {
  7768. type: "string",
  7769. "default": "div"
  7770. }
  7771. },
  7772. supports: {
  7773. align: ["wide", "full"],
  7774. html: false,
  7775. color: {
  7776. gradients: true,
  7777. link: true,
  7778. __experimentalDefaultControls: {
  7779. background: true,
  7780. text: true,
  7781. link: true
  7782. }
  7783. }
  7784. },
  7785. editorStyle: "wp-block-comments-editor"
  7786. };
  7787. const {
  7788. name: comments_query_loop_name
  7789. } = comments_query_loop_metadata;
  7790. const comments_query_loop_settings = {
  7791. icon: post_comments,
  7792. edit: CommentsQueryLoopEdit,
  7793. save: CommentsQueryLoopSave
  7794. };
  7795. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination.js
  7796. /**
  7797. * WordPress dependencies
  7798. */
  7799. const queryPagination = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  7800. xmlns: "http://www.w3.org/2000/svg",
  7801. viewBox: "0 0 24 24"
  7802. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  7803. d: "M4 13.5h6v-3H4v3zm8 0h3v-3h-3v3zm5-3v3h3v-3h-3z"
  7804. }));
  7805. /* harmony default export */ var query_pagination = (queryPagination);
  7806. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/comments-pagination-arrow-controls.js
  7807. /**
  7808. * WordPress dependencies
  7809. */
  7810. function CommentsPaginationArrowControls(_ref) {
  7811. let {
  7812. value,
  7813. onChange
  7814. } = _ref;
  7815. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
  7816. label: (0,external_wp_i18n_namespaceObject.__)('Arrow'),
  7817. value: value,
  7818. onChange: onChange,
  7819. help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow appended to the next and previous comments link.'),
  7820. isBlock: true
  7821. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  7822. value: "none",
  7823. label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Comments Pagination Next/Previous blocks')
  7824. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  7825. value: "arrow",
  7826. label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Comments Pagination Next/Previous blocks')
  7827. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  7828. value: "chevron",
  7829. label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Comments Pagination Next/Previous blocks')
  7830. }));
  7831. }
  7832. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/edit.js
  7833. /**
  7834. * WordPress dependencies
  7835. */
  7836. /**
  7837. * Internal dependencies
  7838. */
  7839. const comments_pagination_edit_TEMPLATE = [['core/comments-pagination-previous'], ['core/comments-pagination-numbers'], ['core/comments-pagination-next']];
  7840. const getDefaultBlockLayout = blockTypeOrName => {
  7841. const layoutBlockSupportConfig = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockTypeOrName, '__experimentalLayout');
  7842. return layoutBlockSupportConfig === null || layoutBlockSupportConfig === void 0 ? void 0 : layoutBlockSupportConfig.default;
  7843. };
  7844. function QueryPaginationEdit(_ref) {
  7845. let {
  7846. attributes: {
  7847. paginationArrow,
  7848. layout
  7849. },
  7850. setAttributes,
  7851. clientId,
  7852. name
  7853. } = _ref;
  7854. const usedLayout = layout || getDefaultBlockLayout(name);
  7855. const hasNextPreviousBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => {
  7856. const {
  7857. getBlocks
  7858. } = select(external_wp_blockEditor_namespaceObject.store);
  7859. const innerBlocks = getBlocks(clientId);
  7860. /**
  7861. * Show the `paginationArrow` control only if a
  7862. * Comments Pagination Next or Comments Pagination Previous
  7863. * block exists.
  7864. */
  7865. return innerBlocks === null || innerBlocks === void 0 ? void 0 : innerBlocks.find(innerBlock => {
  7866. return ['core/comments-pagination-previous', 'core/comments-pagination-next'].includes(innerBlock.name);
  7867. });
  7868. }, []);
  7869. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  7870. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  7871. template: comments_pagination_edit_TEMPLATE,
  7872. allowedBlocks: ['core/comments-pagination-previous', 'core/comments-pagination-numbers', 'core/comments-pagination-next'],
  7873. __experimentalLayout: usedLayout
  7874. }); // Get the Discussion settings
  7875. const pageComments = (0,external_wp_data_namespaceObject.useSelect)(select => {
  7876. const {
  7877. getSettings
  7878. } = select(external_wp_blockEditor_namespaceObject.store);
  7879. const {
  7880. __experimentalDiscussionSettings
  7881. } = getSettings();
  7882. return __experimentalDiscussionSettings === null || __experimentalDiscussionSettings === void 0 ? void 0 : __experimentalDiscussionSettings.pageComments;
  7883. }, []); // If paging comments is not enabled in the Discussion Settings then hide the pagination
  7884. // controls. We don't want to remove them from the template so that when the user enables
  7885. // paging comments, the controls will be visible.
  7886. if (!pageComments) {
  7887. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Comments Pagination block: paging comments is disabled in the Discussion Settings'));
  7888. }
  7889. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, hasNextPreviousBlocks && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  7890. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  7891. }, (0,external_wp_element_namespaceObject.createElement)(CommentsPaginationArrowControls, {
  7892. value: paginationArrow,
  7893. onChange: value => {
  7894. setAttributes({
  7895. paginationArrow: value
  7896. });
  7897. }
  7898. }))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
  7899. }
  7900. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/save.js
  7901. /**
  7902. * WordPress dependencies
  7903. */
  7904. function comments_pagination_save_save() {
  7905. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  7906. }
  7907. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/index.js
  7908. /**
  7909. * WordPress dependencies
  7910. */
  7911. /**
  7912. * Internal dependencies
  7913. */
  7914. const comments_pagination_metadata = {
  7915. $schema: "https://schemas.wp.org/trunk/block.json",
  7916. apiVersion: 2,
  7917. name: "core/comments-pagination",
  7918. title: "Comments Pagination",
  7919. category: "theme",
  7920. parent: ["core/comments-query-loop"],
  7921. description: "Displays a paginated navigation to next/previous set of comments, when applicable.",
  7922. textdomain: "default",
  7923. attributes: {
  7924. paginationArrow: {
  7925. type: "string",
  7926. "default": "none"
  7927. }
  7928. },
  7929. providesContext: {
  7930. "comments/paginationArrow": "paginationArrow"
  7931. },
  7932. supports: {
  7933. align: true,
  7934. reusable: false,
  7935. html: false,
  7936. color: {
  7937. gradients: true,
  7938. link: true,
  7939. __experimentalDefaultControls: {
  7940. background: true,
  7941. text: true,
  7942. link: true
  7943. }
  7944. },
  7945. __experimentalLayout: {
  7946. allowSwitching: false,
  7947. allowInheriting: false,
  7948. "default": {
  7949. type: "flex"
  7950. }
  7951. }
  7952. },
  7953. editorStyle: "wp-block-comments-pagination-editor",
  7954. style: "wp-block-comments-pagination"
  7955. };
  7956. const {
  7957. name: comments_pagination_name
  7958. } = comments_pagination_metadata;
  7959. const comments_pagination_settings = {
  7960. icon: query_pagination,
  7961. edit: QueryPaginationEdit,
  7962. save: comments_pagination_save_save
  7963. };
  7964. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-next.js
  7965. /**
  7966. * WordPress dependencies
  7967. */
  7968. const queryPaginationNext = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  7969. xmlns: "http://www.w3.org/2000/svg",
  7970. viewBox: "0 0 24 24"
  7971. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  7972. d: "M5 13.5h3v-3H5v3zm5 0h3v-3h-3v3zM17 9l-1 1 2 2-2 2 1 1 3-3-3-3z"
  7973. }));
  7974. /* harmony default export */ var query_pagination_next = (queryPaginationNext);
  7975. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/edit.js
  7976. /**
  7977. * WordPress dependencies
  7978. */
  7979. const edit_arrowMap = {
  7980. none: '',
  7981. arrow: '→',
  7982. chevron: '»'
  7983. };
  7984. function CommentsPaginationNextEdit(_ref) {
  7985. let {
  7986. attributes: {
  7987. label
  7988. },
  7989. setAttributes,
  7990. context: {
  7991. 'comments/paginationArrow': paginationArrow
  7992. }
  7993. } = _ref;
  7994. const displayArrow = edit_arrowMap[paginationArrow];
  7995. return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
  7996. href: "#comments-pagination-next-pseudo-link",
  7997. onClick: event => event.preventDefault()
  7998. }, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  7999. __experimentalVersion: 2,
  8000. tagName: "span",
  8001. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Newer comments page link'),
  8002. placeholder: (0,external_wp_i18n_namespaceObject.__)('Newer Comments'),
  8003. value: label,
  8004. onChange: newLabel => setAttributes({
  8005. label: newLabel
  8006. })
  8007. }), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
  8008. className: `wp-block-comments-pagination-next-arrow is-arrow-${paginationArrow}`
  8009. }, displayArrow));
  8010. }
  8011. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/index.js
  8012. /**
  8013. * WordPress dependencies
  8014. */
  8015. /**
  8016. * Internal dependencies
  8017. */
  8018. const comments_pagination_next_metadata = {
  8019. $schema: "https://schemas.wp.org/trunk/block.json",
  8020. apiVersion: 2,
  8021. name: "core/comments-pagination-next",
  8022. title: "Next Page",
  8023. category: "theme",
  8024. parent: ["core/comments-pagination"],
  8025. description: "Displays the next comment's page link.",
  8026. textdomain: "default",
  8027. attributes: {
  8028. label: {
  8029. type: "string"
  8030. }
  8031. },
  8032. usesContext: ["postId", "comments/paginationArrow"],
  8033. supports: {
  8034. reusable: false,
  8035. html: false,
  8036. color: {
  8037. gradients: true,
  8038. text: false,
  8039. __experimentalDefaultControls: {
  8040. background: true
  8041. }
  8042. },
  8043. typography: {
  8044. fontSize: true,
  8045. lineHeight: true,
  8046. __experimentalFontStyle: true,
  8047. __experimentalFontWeight: true,
  8048. __experimentalLetterSpacing: true,
  8049. __experimentalTextTransform: true,
  8050. __experimentalDefaultControls: {
  8051. fontSize: true
  8052. }
  8053. }
  8054. }
  8055. };
  8056. const {
  8057. name: comments_pagination_next_name
  8058. } = comments_pagination_next_metadata;
  8059. const comments_pagination_next_settings = {
  8060. icon: query_pagination_next,
  8061. edit: CommentsPaginationNextEdit
  8062. };
  8063. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-numbers.js
  8064. /**
  8065. * WordPress dependencies
  8066. */
  8067. const queryPaginationNumbers = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  8068. xmlns: "http://www.w3.org/2000/svg",
  8069. viewBox: "0 0 24 24"
  8070. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  8071. d: "M4 13.5h6v-3H4v3zm8.2-2.5.8-.3V14h1V9.3l-2.2.7.4 1zm7.1-1.2c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3-.1-.8-.3-1.1z"
  8072. }));
  8073. /* harmony default export */ var query_pagination_numbers = (queryPaginationNumbers);
  8074. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/edit.js
  8075. /**
  8076. * WordPress dependencies
  8077. */
  8078. const PaginationItem = _ref => {
  8079. let {
  8080. content,
  8081. tag: Tag = 'a',
  8082. extraClass = ''
  8083. } = _ref;
  8084. return (0,external_wp_element_namespaceObject.createElement)(Tag, {
  8085. className: `page-numbers ${extraClass}`
  8086. }, content);
  8087. };
  8088. function CommentsPaginationNumbersEdit() {
  8089. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  8090. content: "1"
  8091. }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  8092. content: "2"
  8093. }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  8094. content: "3",
  8095. tag: "span",
  8096. extraClass: "current"
  8097. }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  8098. content: "4"
  8099. }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  8100. content: "5"
  8101. }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  8102. content: "...",
  8103. tag: "span",
  8104. extraClass: "dots"
  8105. }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  8106. content: "8"
  8107. }));
  8108. }
  8109. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/index.js
  8110. /**
  8111. * WordPress dependencies
  8112. */
  8113. /**
  8114. * Internal dependencies
  8115. */
  8116. const comments_pagination_numbers_metadata = {
  8117. $schema: "https://schemas.wp.org/trunk/block.json",
  8118. apiVersion: 2,
  8119. name: "core/comments-pagination-numbers",
  8120. title: "Page Numbers",
  8121. category: "theme",
  8122. parent: ["core/comments-pagination"],
  8123. description: "Displays a list of page numbers for comments pagination.",
  8124. textdomain: "default",
  8125. usesContext: ["postId"],
  8126. supports: {
  8127. reusable: false,
  8128. html: false
  8129. }
  8130. };
  8131. const {
  8132. name: comments_pagination_numbers_name
  8133. } = comments_pagination_numbers_metadata;
  8134. const comments_pagination_numbers_settings = {
  8135. icon: query_pagination_numbers,
  8136. edit: CommentsPaginationNumbersEdit
  8137. };
  8138. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-title.js
  8139. /**
  8140. * WordPress dependencies
  8141. */
  8142. const commentTitle = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  8143. xmlns: "http://www.w3.org/2000/svg",
  8144. viewBox: "0 0 24 24"
  8145. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  8146. d: "M6 11.9c.6.3 1.3.5 2.1.5.4 0 .8 0 1.2-.1.4-.1.7-.2 1-.3l-.1-1.3c-.3.1-.6.3-.9.3-.3.1-.7.1-1.1.1-.6 0-1.1-.1-1.5-.4-.4-.3-.7-.6-.9-1-.2-.5-.3-1-.3-1.5 0-.6.1-1.1.3-1.5.2-.4.5-.8.9-1 .4-.3.9-.4 1.5-.4.4 0 .7 0 1.1.1l.9.3.1-1.3c-.3-.1-.6-.2-1-.3C9 4 8.6 4 8.2 4c-.9 0-1.6.2-2.2.5-.6.4-1.1.8-1.5 1.5-.3.6-.5 1.3-.5 2.2s.2 1.6.5 2.2c.4.6.9 1.1 1.5 1.5zm-2 2.6V16h16v-1.5H4zM4 20h9v-1.5H4V20z"
  8147. }));
  8148. /* harmony default export */ var comment_title = (commentTitle);
  8149. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/heading-level-icon.js
  8150. /**
  8151. * WordPress dependencies
  8152. */
  8153. /** @typedef {import('@wordpress/element').WPComponent} WPComponent */
  8154. /**
  8155. * HeadingLevelIcon props.
  8156. *
  8157. * @typedef WPHeadingLevelIconProps
  8158. *
  8159. * @property {number} level The heading level to show an icon for.
  8160. * @property {?boolean} isPressed Whether or not the icon should appear pressed; default: false.
  8161. */
  8162. /**
  8163. * Heading level icon.
  8164. *
  8165. * @param {WPHeadingLevelIconProps} props Component props.
  8166. *
  8167. * @return {?WPComponent} The icon.
  8168. */
  8169. function HeadingLevelIcon(_ref) {
  8170. let {
  8171. level,
  8172. isPressed = false
  8173. } = _ref;
  8174. const levelToPath = {
  8175. 1: 'M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z',
  8176. 2: 'M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z',
  8177. 3: 'M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z',
  8178. 4: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z',
  8179. 5: 'M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z',
  8180. 6: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z'
  8181. };
  8182. if (!levelToPath.hasOwnProperty(level)) {
  8183. return null;
  8184. }
  8185. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  8186. width: "24",
  8187. height: "24",
  8188. viewBox: "0 0 20 20",
  8189. xmlns: "http://www.w3.org/2000/svg",
  8190. isPressed: isPressed
  8191. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  8192. d: levelToPath[level]
  8193. }));
  8194. }
  8195. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/heading-level-dropdown.js
  8196. /**
  8197. * WordPress dependencies
  8198. */
  8199. /**
  8200. * Internal dependencies
  8201. */
  8202. const HEADING_LEVELS = [1, 2, 3, 4, 5, 6];
  8203. const POPOVER_PROPS = {
  8204. className: 'block-library-heading-level-dropdown'
  8205. };
  8206. /** @typedef {import('@wordpress/element').WPComponent} WPComponent */
  8207. /**
  8208. * HeadingLevelDropdown props.
  8209. *
  8210. * @typedef WPHeadingLevelDropdownProps
  8211. *
  8212. * @property {number} selectedLevel The chosen heading level.
  8213. * @property {(newValue:number)=>any} onChange Callback to run when
  8214. * toolbar value is changed.
  8215. */
  8216. /**
  8217. * Dropdown for selecting a heading level (1 through 6).
  8218. *
  8219. * @param {WPHeadingLevelDropdownProps} props Component props.
  8220. *
  8221. * @return {WPComponent} The toolbar.
  8222. */
  8223. function HeadingLevelDropdown(_ref) {
  8224. let {
  8225. selectedLevel,
  8226. onChange
  8227. } = _ref;
  8228. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
  8229. popoverProps: POPOVER_PROPS,
  8230. icon: (0,external_wp_element_namespaceObject.createElement)(HeadingLevelIcon, {
  8231. level: selectedLevel
  8232. }),
  8233. label: (0,external_wp_i18n_namespaceObject.__)('Change heading level'),
  8234. controls: HEADING_LEVELS.map(targetLevel => {
  8235. {
  8236. const isActive = targetLevel === selectedLevel;
  8237. return {
  8238. icon: (0,external_wp_element_namespaceObject.createElement)(HeadingLevelIcon, {
  8239. level: targetLevel,
  8240. isPressed: isActive
  8241. }),
  8242. label: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: heading level e.g: "1", "2", "3"
  8243. (0,external_wp_i18n_namespaceObject.__)('Heading %d'), targetLevel),
  8244. isActive,
  8245. onClick() {
  8246. onChange(targetLevel);
  8247. }
  8248. };
  8249. }
  8250. })
  8251. });
  8252. }
  8253. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/edit.js
  8254. /**
  8255. * External dependencies
  8256. */
  8257. /**
  8258. * WordPress dependencies
  8259. */
  8260. /**
  8261. * Internal dependencies
  8262. */
  8263. function comments_title_edit_Edit(_ref) {
  8264. let {
  8265. attributes: {
  8266. textAlign,
  8267. showPostTitle,
  8268. showCommentsCount,
  8269. level
  8270. },
  8271. setAttributes,
  8272. context: {
  8273. postType,
  8274. postId
  8275. }
  8276. } = _ref;
  8277. const TagName = 'h' + level;
  8278. const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)();
  8279. const [rawTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
  8280. const isSiteEditor = typeof postId === 'undefined';
  8281. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  8282. className: classnames_default()({
  8283. [`has-text-align-${textAlign}`]: textAlign
  8284. })
  8285. });
  8286. (0,external_wp_element_namespaceObject.useEffect)(() => {
  8287. if (isSiteEditor) {
  8288. setCommentsCount(3);
  8289. return;
  8290. }
  8291. const currentPostId = postId;
  8292. external_wp_apiFetch_default()({
  8293. path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', {
  8294. post: postId,
  8295. _fields: 'id'
  8296. }),
  8297. method: 'HEAD',
  8298. parse: false
  8299. }).then(res => {
  8300. // Stale requests will have the `currentPostId` of an older closure.
  8301. if (currentPostId === postId) {
  8302. setCommentsCount(parseInt(res.headers.get('X-WP-Total')));
  8303. }
  8304. }).catch(() => {
  8305. setCommentsCount(0);
  8306. });
  8307. }, [postId]);
  8308. const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  8309. group: "block"
  8310. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  8311. value: textAlign,
  8312. onChange: newAlign => setAttributes({
  8313. textAlign: newAlign
  8314. })
  8315. }), (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
  8316. selectedLevel: level,
  8317. onChange: newLevel => setAttributes({
  8318. level: newLevel
  8319. })
  8320. }));
  8321. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  8322. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  8323. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  8324. label: (0,external_wp_i18n_namespaceObject.__)('Show post title'),
  8325. checked: showPostTitle,
  8326. onChange: value => setAttributes({
  8327. showPostTitle: value
  8328. })
  8329. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  8330. label: (0,external_wp_i18n_namespaceObject.__)('Show comments count'),
  8331. checked: showCommentsCount,
  8332. onChange: value => setAttributes({
  8333. showCommentsCount: value
  8334. })
  8335. })));
  8336. const postTitle = isSiteEditor ? (0,external_wp_i18n_namespaceObject.__)('"Post Title"') : `"${rawTitle}"`;
  8337. let placeholder;
  8338. if (showCommentsCount && commentsCount !== undefined) {
  8339. if (showPostTitle) {
  8340. if (commentsCount === 1) {
  8341. /* translators: %s: Post title. */
  8342. placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('One response to %s'), postTitle);
  8343. } else {
  8344. placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(
  8345. /* translators: 1: Number of comments, 2: Post title. */
  8346. (0,external_wp_i18n_namespaceObject._n)('%1$s response to %2$s', '%1$s responses to %2$s', commentsCount), commentsCount, postTitle);
  8347. }
  8348. } else if (commentsCount === 1) {
  8349. placeholder = (0,external_wp_i18n_namespaceObject.__)('One response');
  8350. } else {
  8351. placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(
  8352. /* translators: %s: Number of comments. */
  8353. (0,external_wp_i18n_namespaceObject._n)('%s responses', '%s responses', commentsCount), commentsCount);
  8354. }
  8355. } else if (showPostTitle) {
  8356. if (commentsCount === 1) {
  8357. /* translators: %s: Post title. */
  8358. placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Response to %s'), postTitle);
  8359. } else {
  8360. /* translators: %s: Post title. */
  8361. placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Responses to %s'), postTitle);
  8362. }
  8363. } else if (commentsCount === 1) {
  8364. placeholder = (0,external_wp_i18n_namespaceObject.__)('Response');
  8365. } else {
  8366. placeholder = (0,external_wp_i18n_namespaceObject.__)('Responses');
  8367. }
  8368. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, placeholder));
  8369. }
  8370. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/deprecated.js
  8371. /**
  8372. * Internal dependencies
  8373. */
  8374. const deprecated_metadata = {
  8375. $schema: "https://schemas.wp.org/trunk/block.json",
  8376. apiVersion: 2,
  8377. name: "core/comments-title",
  8378. title: "Comments Title",
  8379. category: "theme",
  8380. ancestor: ["core/comments-query-loop"],
  8381. description: "Displays a title with the number of comments",
  8382. textdomain: "default",
  8383. usesContext: ["postId", "postType"],
  8384. attributes: {
  8385. textAlign: {
  8386. type: "string"
  8387. },
  8388. showPostTitle: {
  8389. type: "boolean",
  8390. "default": true
  8391. },
  8392. showCommentsCount: {
  8393. type: "boolean",
  8394. "default": true
  8395. },
  8396. level: {
  8397. type: "number",
  8398. "default": 2
  8399. }
  8400. },
  8401. supports: {
  8402. anchor: false,
  8403. align: true,
  8404. html: false,
  8405. __experimentalBorder: {
  8406. radius: true,
  8407. color: true,
  8408. width: true,
  8409. style: true
  8410. },
  8411. color: {
  8412. gradients: true,
  8413. __experimentalDefaultControls: {
  8414. background: true,
  8415. text: true
  8416. }
  8417. },
  8418. spacing: {
  8419. margin: true,
  8420. padding: true
  8421. },
  8422. typography: {
  8423. fontSize: true,
  8424. lineHeight: true,
  8425. __experimentalFontStyle: true,
  8426. __experimentalFontWeight: true,
  8427. __experimentalFontFamily: true,
  8428. __experimentalTextTransform: true,
  8429. __experimentalDefaultControls: {
  8430. fontSize: true,
  8431. __experimentalFontFamily: true,
  8432. __experimentalFontStyle: true,
  8433. __experimentalFontWeight: true
  8434. }
  8435. }
  8436. }
  8437. };
  8438. const {
  8439. attributes,
  8440. supports
  8441. } = deprecated_metadata;
  8442. /* harmony default export */ var comments_title_deprecated = ([{
  8443. attributes: { ...attributes,
  8444. singleCommentLabel: {
  8445. type: 'string'
  8446. },
  8447. multipleCommentsLabel: {
  8448. type: 'string'
  8449. }
  8450. },
  8451. supports,
  8452. migrate: oldAttributes => {
  8453. /* eslint-disable no-unused-vars */
  8454. const {
  8455. singleCommentLabel,
  8456. multipleCommentsLabel,
  8457. ...newAttributes
  8458. } = oldAttributes;
  8459. /* eslint-enable no-unused-vars */
  8460. return newAttributes;
  8461. },
  8462. isEligible: _ref => {
  8463. let {
  8464. multipleCommentsLabel,
  8465. singleCommentLabel
  8466. } = _ref;
  8467. return multipleCommentsLabel || singleCommentLabel;
  8468. },
  8469. save: () => null
  8470. }]);
  8471. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/index.js
  8472. /**
  8473. * WordPress dependencies
  8474. */
  8475. /**
  8476. * Internal dependencies
  8477. */
  8478. const comments_title_metadata = {
  8479. $schema: "https://schemas.wp.org/trunk/block.json",
  8480. apiVersion: 2,
  8481. name: "core/comments-title",
  8482. title: "Comments Title",
  8483. category: "theme",
  8484. ancestor: ["core/comments-query-loop"],
  8485. description: "Displays a title with the number of comments",
  8486. textdomain: "default",
  8487. usesContext: ["postId", "postType"],
  8488. attributes: {
  8489. textAlign: {
  8490. type: "string"
  8491. },
  8492. showPostTitle: {
  8493. type: "boolean",
  8494. "default": true
  8495. },
  8496. showCommentsCount: {
  8497. type: "boolean",
  8498. "default": true
  8499. },
  8500. level: {
  8501. type: "number",
  8502. "default": 2
  8503. }
  8504. },
  8505. supports: {
  8506. anchor: false,
  8507. align: true,
  8508. html: false,
  8509. __experimentalBorder: {
  8510. radius: true,
  8511. color: true,
  8512. width: true,
  8513. style: true
  8514. },
  8515. color: {
  8516. gradients: true,
  8517. __experimentalDefaultControls: {
  8518. background: true,
  8519. text: true
  8520. }
  8521. },
  8522. spacing: {
  8523. margin: true,
  8524. padding: true
  8525. },
  8526. typography: {
  8527. fontSize: true,
  8528. lineHeight: true,
  8529. __experimentalFontStyle: true,
  8530. __experimentalFontWeight: true,
  8531. __experimentalFontFamily: true,
  8532. __experimentalTextTransform: true,
  8533. __experimentalDefaultControls: {
  8534. fontSize: true,
  8535. __experimentalFontFamily: true,
  8536. __experimentalFontStyle: true,
  8537. __experimentalFontWeight: true
  8538. }
  8539. }
  8540. }
  8541. };
  8542. const {
  8543. name: comments_title_name
  8544. } = comments_title_metadata;
  8545. const comments_title_settings = {
  8546. icon: comment_title,
  8547. edit: comments_title_edit_Edit,
  8548. deprecated: comments_title_deprecated
  8549. };
  8550. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/cover.js
  8551. /**
  8552. * WordPress dependencies
  8553. */
  8554. const cover = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  8555. xmlns: "http://www.w3.org/2000/svg",
  8556. viewBox: "0 0 24 24"
  8557. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  8558. d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h6.2v8.9l2.5-3.1 2.5 3.1V4.5h2.2c.4 0 .8.4.8.8v13.4z"
  8559. }));
  8560. /* harmony default export */ var library_cover = (cover);
  8561. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/shared.js
  8562. /**
  8563. * WordPress dependencies
  8564. */
  8565. const POSITION_CLASSNAMES = {
  8566. 'top left': 'is-position-top-left',
  8567. 'top center': 'is-position-top-center',
  8568. 'top right': 'is-position-top-right',
  8569. 'center left': 'is-position-center-left',
  8570. 'center center': 'is-position-center-center',
  8571. center: 'is-position-center-center',
  8572. 'center right': 'is-position-center-right',
  8573. 'bottom left': 'is-position-bottom-left',
  8574. 'bottom center': 'is-position-bottom-center',
  8575. 'bottom right': 'is-position-bottom-right'
  8576. };
  8577. const IMAGE_BACKGROUND_TYPE = 'image';
  8578. const VIDEO_BACKGROUND_TYPE = 'video';
  8579. const COVER_MIN_HEIGHT = 50;
  8580. const COVER_MAX_HEIGHT = 1000;
  8581. const COVER_DEFAULT_HEIGHT = 300;
  8582. function backgroundImageStyles(url) {
  8583. return url ? {
  8584. backgroundImage: `url(${url})`
  8585. } : {};
  8586. }
  8587. const shared_ALLOWED_MEDIA_TYPES = ['image', 'video'];
  8588. function dimRatioToClass(ratio) {
  8589. return ratio === 50 || !ratio === undefined ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10);
  8590. }
  8591. function attributesFromMedia(setAttributes, dimRatio) {
  8592. return media => {
  8593. if (!media || !media.url) {
  8594. setAttributes({
  8595. url: undefined,
  8596. id: undefined
  8597. });
  8598. return;
  8599. }
  8600. if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
  8601. media.type = (0,external_wp_blob_namespaceObject.getBlobTypeByURL)(media.url);
  8602. }
  8603. let mediaType; // For media selections originated from a file upload.
  8604. if (media.media_type) {
  8605. if (media.media_type === IMAGE_BACKGROUND_TYPE) {
  8606. mediaType = IMAGE_BACKGROUND_TYPE;
  8607. } else {
  8608. // only images and videos are accepted so if the media_type is not an image we can assume it is a video.
  8609. // Videos contain the media type of 'file' in the object returned from the rest api.
  8610. mediaType = VIDEO_BACKGROUND_TYPE;
  8611. }
  8612. } else {
  8613. // For media selections originated from existing files in the media library.
  8614. if (media.type !== IMAGE_BACKGROUND_TYPE && media.type !== VIDEO_BACKGROUND_TYPE) {
  8615. return;
  8616. }
  8617. mediaType = media.type;
  8618. }
  8619. setAttributes({
  8620. dimRatio: dimRatio === 100 ? 50 : dimRatio,
  8621. url: media.url,
  8622. id: media.id,
  8623. alt: media === null || media === void 0 ? void 0 : media.alt,
  8624. backgroundType: mediaType,
  8625. ...(mediaType === VIDEO_BACKGROUND_TYPE ? {
  8626. focalPoint: undefined,
  8627. hasParallax: undefined
  8628. } : {})
  8629. });
  8630. };
  8631. }
  8632. /**
  8633. * Checks of the contentPosition is the center (default) position.
  8634. *
  8635. * @param {string} contentPosition The current content position.
  8636. * @return {boolean} Whether the contentPosition is center.
  8637. */
  8638. function isContentPositionCenter(contentPosition) {
  8639. return !contentPosition || contentPosition === 'center center' || contentPosition === 'center';
  8640. }
  8641. /**
  8642. * Retrieves the className for the current contentPosition.
  8643. * The default position (center) will not have a className.
  8644. *
  8645. * @param {string} contentPosition The current content position.
  8646. * @return {string} The className assigned to the contentPosition.
  8647. */
  8648. function getPositionClassName(contentPosition) {
  8649. /*
  8650. * Only render a className if the contentPosition is not center (the default).
  8651. */
  8652. if (isContentPositionCenter(contentPosition)) return '';
  8653. return POSITION_CLASSNAMES[contentPosition];
  8654. }
  8655. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/deprecated.js
  8656. /**
  8657. * External dependencies
  8658. */
  8659. /**
  8660. * WordPress dependencies
  8661. */
  8662. /**
  8663. * Internal dependencies
  8664. */
  8665. /**
  8666. * Original function to determine the background opacity classname
  8667. *
  8668. * Used in deprecations: v1-7.
  8669. *
  8670. * @param {number} ratio ratio to use for opacity.
  8671. * @return {string} background opacity class .
  8672. */
  8673. function dimRatioToClassV1(ratio) {
  8674. return ratio === 0 || ratio === 50 || !ratio ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10);
  8675. }
  8676. function migrateDimRatio(attributes) {
  8677. return { ...attributes,
  8678. dimRatio: !attributes.url ? 100 : attributes.dimRatio
  8679. };
  8680. }
  8681. const deprecated_blockAttributes = {
  8682. url: {
  8683. type: 'string'
  8684. },
  8685. id: {
  8686. type: 'number'
  8687. },
  8688. hasParallax: {
  8689. type: 'boolean',
  8690. default: false
  8691. },
  8692. dimRatio: {
  8693. type: 'number',
  8694. default: 50
  8695. },
  8696. overlayColor: {
  8697. type: 'string'
  8698. },
  8699. customOverlayColor: {
  8700. type: 'string'
  8701. },
  8702. backgroundType: {
  8703. type: 'string',
  8704. default: 'image'
  8705. },
  8706. focalPoint: {
  8707. type: 'object'
  8708. }
  8709. }; // Deprecation for blocks with `minHeightUnit` set but no `minHeight`.
  8710. const v9 = {
  8711. attributes: {
  8712. url: {
  8713. type: 'string'
  8714. },
  8715. id: {
  8716. type: 'number'
  8717. },
  8718. alt: {
  8719. type: 'string',
  8720. source: 'attribute',
  8721. selector: 'img',
  8722. attribute: 'alt',
  8723. default: ''
  8724. },
  8725. hasParallax: {
  8726. type: 'boolean',
  8727. default: false
  8728. },
  8729. isRepeated: {
  8730. type: 'boolean',
  8731. default: false
  8732. },
  8733. dimRatio: {
  8734. type: 'number',
  8735. default: 100
  8736. },
  8737. overlayColor: {
  8738. type: 'string'
  8739. },
  8740. customOverlayColor: {
  8741. type: 'string'
  8742. },
  8743. backgroundType: {
  8744. type: 'string',
  8745. default: 'image'
  8746. },
  8747. focalPoint: {
  8748. type: 'object'
  8749. },
  8750. minHeight: {
  8751. type: 'number'
  8752. },
  8753. minHeightUnit: {
  8754. type: 'string'
  8755. },
  8756. gradient: {
  8757. type: 'string'
  8758. },
  8759. customGradient: {
  8760. type: 'string'
  8761. },
  8762. contentPosition: {
  8763. type: 'string'
  8764. },
  8765. isDark: {
  8766. type: 'boolean',
  8767. default: true
  8768. },
  8769. allowedBlocks: {
  8770. type: 'array'
  8771. },
  8772. templateLock: {
  8773. type: ['string', 'boolean'],
  8774. enum: ['all', 'insert', false]
  8775. }
  8776. },
  8777. supports: {
  8778. anchor: true,
  8779. align: true,
  8780. html: false,
  8781. spacing: {
  8782. padding: true,
  8783. __experimentalDefaultControls: {
  8784. padding: true
  8785. }
  8786. },
  8787. color: {
  8788. __experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background',
  8789. text: false,
  8790. background: false
  8791. }
  8792. },
  8793. save(_ref) {
  8794. let {
  8795. attributes
  8796. } = _ref;
  8797. const {
  8798. backgroundType,
  8799. gradient,
  8800. contentPosition,
  8801. customGradient,
  8802. customOverlayColor,
  8803. dimRatio,
  8804. focalPoint,
  8805. hasParallax,
  8806. isDark,
  8807. isRepeated,
  8808. overlayColor,
  8809. url,
  8810. alt,
  8811. id,
  8812. minHeight: minHeightProp,
  8813. minHeightUnit
  8814. } = attributes;
  8815. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  8816. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  8817. const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
  8818. const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  8819. const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  8820. const isImgElement = !(hasParallax || isRepeated);
  8821. const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}),
  8822. minHeight: minHeight || undefined
  8823. };
  8824. const bgStyle = {
  8825. backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
  8826. background: customGradient ? customGradient : undefined
  8827. };
  8828. const objectPosition = // prettier-ignore
  8829. focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
  8830. const classes = classnames_default()({
  8831. 'is-light': !isDark,
  8832. 'has-parallax': hasParallax,
  8833. 'is-repeated': isRepeated,
  8834. 'has-custom-content-position': !isContentPositionCenter(contentPosition)
  8835. }, getPositionClassName(contentPosition));
  8836. const gradientValue = gradient || customGradient;
  8837. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  8838. className: classes,
  8839. style
  8840. }), (0,external_wp_element_namespaceObject.createElement)("span", {
  8841. "aria-hidden": "true",
  8842. className: classnames_default()('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), {
  8843. 'has-background-dim': dimRatio !== undefined,
  8844. // For backwards compatibility. Former versions of the Cover Block applied
  8845. // `.wp-block-cover__gradient-background` in the presence of
  8846. // media, a gradient and a dim.
  8847. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
  8848. 'has-background-gradient': gradientValue,
  8849. [gradientClass]: gradientClass
  8850. }),
  8851. style: bgStyle
  8852. }), isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
  8853. className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
  8854. alt: alt,
  8855. src: url,
  8856. style: {
  8857. objectPosition
  8858. },
  8859. "data-object-fit": "cover",
  8860. "data-object-position": objectPosition
  8861. }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  8862. className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
  8863. autoPlay: true,
  8864. muted: true,
  8865. loop: true,
  8866. playsInline: true,
  8867. src: url,
  8868. style: {
  8869. objectPosition
  8870. },
  8871. "data-object-fit": "cover",
  8872. "data-object-position": objectPosition
  8873. }), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
  8874. className: 'wp-block-cover__inner-container'
  8875. })));
  8876. }
  8877. }; // v8: deprecated to remove duplicated gradient classes and swap `wp-block-cover__gradient-background` for `wp-block-cover__background`.
  8878. const v8 = {
  8879. attributes: {
  8880. url: {
  8881. type: 'string'
  8882. },
  8883. id: {
  8884. type: 'number'
  8885. },
  8886. alt: {
  8887. type: 'string',
  8888. source: 'attribute',
  8889. selector: 'img',
  8890. attribute: 'alt',
  8891. default: ''
  8892. },
  8893. hasParallax: {
  8894. type: 'boolean',
  8895. default: false
  8896. },
  8897. isRepeated: {
  8898. type: 'boolean',
  8899. default: false
  8900. },
  8901. dimRatio: {
  8902. type: 'number',
  8903. default: 100
  8904. },
  8905. overlayColor: {
  8906. type: 'string'
  8907. },
  8908. customOverlayColor: {
  8909. type: 'string'
  8910. },
  8911. backgroundType: {
  8912. type: 'string',
  8913. default: 'image'
  8914. },
  8915. focalPoint: {
  8916. type: 'object'
  8917. },
  8918. minHeight: {
  8919. type: 'number'
  8920. },
  8921. minHeightUnit: {
  8922. type: 'string'
  8923. },
  8924. gradient: {
  8925. type: 'string'
  8926. },
  8927. customGradient: {
  8928. type: 'string'
  8929. },
  8930. contentPosition: {
  8931. type: 'string'
  8932. },
  8933. isDark: {
  8934. type: 'boolean',
  8935. default: true
  8936. },
  8937. allowedBlocks: {
  8938. type: 'array'
  8939. },
  8940. templateLock: {
  8941. type: ['string', 'boolean'],
  8942. enum: ['all', 'insert', false]
  8943. }
  8944. },
  8945. supports: {
  8946. anchor: true,
  8947. align: true,
  8948. html: false,
  8949. spacing: {
  8950. padding: true,
  8951. __experimentalDefaultControls: {
  8952. padding: true
  8953. }
  8954. },
  8955. color: {
  8956. __experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background',
  8957. text: false,
  8958. background: false
  8959. }
  8960. },
  8961. save(_ref2) {
  8962. let {
  8963. attributes
  8964. } = _ref2;
  8965. const {
  8966. backgroundType,
  8967. gradient,
  8968. contentPosition,
  8969. customGradient,
  8970. customOverlayColor,
  8971. dimRatio,
  8972. focalPoint,
  8973. hasParallax,
  8974. isDark,
  8975. isRepeated,
  8976. overlayColor,
  8977. url,
  8978. alt,
  8979. id,
  8980. minHeight: minHeightProp,
  8981. minHeightUnit
  8982. } = attributes;
  8983. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  8984. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  8985. const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
  8986. const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  8987. const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  8988. const isImgElement = !(hasParallax || isRepeated);
  8989. const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}),
  8990. minHeight: minHeight || undefined
  8991. };
  8992. const bgStyle = {
  8993. backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
  8994. background: customGradient ? customGradient : undefined
  8995. };
  8996. const objectPosition = // prettier-ignore
  8997. focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
  8998. const classes = classnames_default()({
  8999. 'is-light': !isDark,
  9000. 'has-parallax': hasParallax,
  9001. 'is-repeated': isRepeated,
  9002. 'has-custom-content-position': !isContentPositionCenter(contentPosition)
  9003. }, getPositionClassName(contentPosition));
  9004. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  9005. className: classes,
  9006. style
  9007. }), (0,external_wp_element_namespaceObject.createElement)("span", {
  9008. "aria-hidden": "true",
  9009. className: classnames_default()(overlayColorClass, dimRatioToClass(dimRatio), 'wp-block-cover__gradient-background', gradientClass, {
  9010. 'has-background-dim': dimRatio !== undefined,
  9011. 'has-background-gradient': gradient || customGradient,
  9012. [gradientClass]: !url && gradientClass
  9013. }),
  9014. style: bgStyle
  9015. }), isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
  9016. className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
  9017. alt: alt,
  9018. src: url,
  9019. style: {
  9020. objectPosition
  9021. },
  9022. "data-object-fit": "cover",
  9023. "data-object-position": objectPosition
  9024. }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  9025. className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
  9026. autoPlay: true,
  9027. muted: true,
  9028. loop: true,
  9029. playsInline: true,
  9030. src: url,
  9031. style: {
  9032. objectPosition
  9033. },
  9034. "data-object-fit": "cover",
  9035. "data-object-position": objectPosition
  9036. }), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
  9037. className: 'wp-block-cover__inner-container'
  9038. })));
  9039. }
  9040. };
  9041. const v7 = {
  9042. attributes: { ...deprecated_blockAttributes,
  9043. isRepeated: {
  9044. type: 'boolean',
  9045. default: false
  9046. },
  9047. minHeight: {
  9048. type: 'number'
  9049. },
  9050. minHeightUnit: {
  9051. type: 'string'
  9052. },
  9053. gradient: {
  9054. type: 'string'
  9055. },
  9056. customGradient: {
  9057. type: 'string'
  9058. },
  9059. contentPosition: {
  9060. type: 'string'
  9061. },
  9062. alt: {
  9063. type: 'string',
  9064. source: 'attribute',
  9065. selector: 'img',
  9066. attribute: 'alt',
  9067. default: ''
  9068. }
  9069. },
  9070. supports: {
  9071. anchor: true,
  9072. align: true,
  9073. html: false,
  9074. spacing: {
  9075. padding: true,
  9076. __experimentalDefaultControls: {
  9077. padding: true
  9078. }
  9079. },
  9080. color: {
  9081. __experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background',
  9082. text: false,
  9083. background: false
  9084. }
  9085. },
  9086. save(_ref3) {
  9087. let {
  9088. attributes
  9089. } = _ref3;
  9090. const {
  9091. backgroundType,
  9092. gradient,
  9093. contentPosition,
  9094. customGradient,
  9095. customOverlayColor,
  9096. dimRatio,
  9097. focalPoint,
  9098. hasParallax,
  9099. isRepeated,
  9100. overlayColor,
  9101. url,
  9102. alt,
  9103. id,
  9104. minHeight: minHeightProp,
  9105. minHeightUnit
  9106. } = attributes;
  9107. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  9108. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  9109. const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
  9110. const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  9111. const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  9112. const isImgElement = !(hasParallax || isRepeated);
  9113. const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}),
  9114. backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
  9115. background: customGradient && !url ? customGradient : undefined,
  9116. minHeight: minHeight || undefined
  9117. };
  9118. const objectPosition = // prettier-ignore
  9119. focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
  9120. const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
  9121. 'has-background-dim': dimRatio !== 0,
  9122. 'has-parallax': hasParallax,
  9123. 'is-repeated': isRepeated,
  9124. 'has-background-gradient': gradient || customGradient,
  9125. [gradientClass]: !url && gradientClass,
  9126. 'has-custom-content-position': !isContentPositionCenter(contentPosition)
  9127. }, getPositionClassName(contentPosition));
  9128. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  9129. className: classes,
  9130. style
  9131. }), url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
  9132. "aria-hidden": "true",
  9133. className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
  9134. style: customGradient ? {
  9135. background: customGradient
  9136. } : undefined
  9137. }), isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
  9138. className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
  9139. alt: alt,
  9140. src: url,
  9141. style: {
  9142. objectPosition
  9143. },
  9144. "data-object-fit": "cover",
  9145. "data-object-position": objectPosition
  9146. }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  9147. className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
  9148. autoPlay: true,
  9149. muted: true,
  9150. loop: true,
  9151. playsInline: true,
  9152. src: url,
  9153. style: {
  9154. objectPosition
  9155. },
  9156. "data-object-fit": "cover",
  9157. "data-object-position": objectPosition
  9158. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  9159. className: "wp-block-cover__inner-container"
  9160. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  9161. },
  9162. migrate: migrateDimRatio
  9163. };
  9164. const v6 = {
  9165. attributes: { ...deprecated_blockAttributes,
  9166. isRepeated: {
  9167. type: 'boolean',
  9168. default: false
  9169. },
  9170. minHeight: {
  9171. type: 'number'
  9172. },
  9173. minHeightUnit: {
  9174. type: 'string'
  9175. },
  9176. gradient: {
  9177. type: 'string'
  9178. },
  9179. customGradient: {
  9180. type: 'string'
  9181. },
  9182. contentPosition: {
  9183. type: 'string'
  9184. }
  9185. },
  9186. supports: {
  9187. align: true
  9188. },
  9189. save(_ref4) {
  9190. let {
  9191. attributes
  9192. } = _ref4;
  9193. const {
  9194. backgroundType,
  9195. gradient,
  9196. contentPosition,
  9197. customGradient,
  9198. customOverlayColor,
  9199. dimRatio,
  9200. focalPoint,
  9201. hasParallax,
  9202. isRepeated,
  9203. overlayColor,
  9204. url,
  9205. minHeight: minHeightProp,
  9206. minHeightUnit
  9207. } = attributes;
  9208. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  9209. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  9210. const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
  9211. const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  9212. const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  9213. const style = isImageBackground ? backgroundImageStyles(url) : {};
  9214. const videoStyle = {};
  9215. if (!overlayColorClass) {
  9216. style.backgroundColor = customOverlayColor;
  9217. }
  9218. if (customGradient && !url) {
  9219. style.background = customGradient;
  9220. }
  9221. style.minHeight = minHeight || undefined;
  9222. let positionValue;
  9223. if (focalPoint) {
  9224. positionValue = `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%`;
  9225. if (isImageBackground && !hasParallax) {
  9226. style.backgroundPosition = positionValue;
  9227. }
  9228. if (isVideoBackground) {
  9229. videoStyle.objectPosition = positionValue;
  9230. }
  9231. }
  9232. const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
  9233. 'has-background-dim': dimRatio !== 0,
  9234. 'has-parallax': hasParallax,
  9235. 'is-repeated': isRepeated,
  9236. 'has-background-gradient': gradient || customGradient,
  9237. [gradientClass]: !url && gradientClass,
  9238. 'has-custom-content-position': !isContentPositionCenter(contentPosition)
  9239. }, getPositionClassName(contentPosition));
  9240. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  9241. className: classes,
  9242. style
  9243. }), url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
  9244. "aria-hidden": "true",
  9245. className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
  9246. style: customGradient ? {
  9247. background: customGradient
  9248. } : undefined
  9249. }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  9250. className: "wp-block-cover__video-background",
  9251. autoPlay: true,
  9252. muted: true,
  9253. loop: true,
  9254. playsInline: true,
  9255. src: url,
  9256. style: videoStyle
  9257. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  9258. className: "wp-block-cover__inner-container"
  9259. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  9260. },
  9261. migrate: migrateDimRatio
  9262. };
  9263. const v5 = {
  9264. attributes: { ...deprecated_blockAttributes,
  9265. minHeight: {
  9266. type: 'number'
  9267. },
  9268. gradient: {
  9269. type: 'string'
  9270. },
  9271. customGradient: {
  9272. type: 'string'
  9273. }
  9274. },
  9275. supports: {
  9276. align: true
  9277. },
  9278. save(_ref5) {
  9279. let {
  9280. attributes
  9281. } = _ref5;
  9282. const {
  9283. backgroundType,
  9284. gradient,
  9285. customGradient,
  9286. customOverlayColor,
  9287. dimRatio,
  9288. focalPoint,
  9289. hasParallax,
  9290. overlayColor,
  9291. url,
  9292. minHeight
  9293. } = attributes;
  9294. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  9295. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  9296. const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
  9297. if (!overlayColorClass) {
  9298. style.backgroundColor = customOverlayColor;
  9299. }
  9300. if (focalPoint && !hasParallax) {
  9301. style.backgroundPosition = `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%`;
  9302. }
  9303. if (customGradient && !url) {
  9304. style.background = customGradient;
  9305. }
  9306. style.minHeight = minHeight || undefined;
  9307. const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
  9308. 'has-background-dim': dimRatio !== 0,
  9309. 'has-parallax': hasParallax,
  9310. 'has-background-gradient': customGradient,
  9311. [gradientClass]: !url && gradientClass
  9312. });
  9313. return (0,external_wp_element_namespaceObject.createElement)("div", {
  9314. className: classes,
  9315. style: style
  9316. }, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
  9317. "aria-hidden": "true",
  9318. className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
  9319. style: customGradient ? {
  9320. background: customGradient
  9321. } : undefined
  9322. }), VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  9323. className: "wp-block-cover__video-background",
  9324. autoPlay: true,
  9325. muted: true,
  9326. loop: true,
  9327. src: url
  9328. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  9329. className: "wp-block-cover__inner-container"
  9330. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  9331. },
  9332. migrate: migrateDimRatio
  9333. };
  9334. const v4 = {
  9335. attributes: { ...deprecated_blockAttributes,
  9336. minHeight: {
  9337. type: 'number'
  9338. },
  9339. gradient: {
  9340. type: 'string'
  9341. },
  9342. customGradient: {
  9343. type: 'string'
  9344. }
  9345. },
  9346. supports: {
  9347. align: true
  9348. },
  9349. save(_ref6) {
  9350. let {
  9351. attributes
  9352. } = _ref6;
  9353. const {
  9354. backgroundType,
  9355. gradient,
  9356. customGradient,
  9357. customOverlayColor,
  9358. dimRatio,
  9359. focalPoint,
  9360. hasParallax,
  9361. overlayColor,
  9362. url,
  9363. minHeight
  9364. } = attributes;
  9365. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  9366. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  9367. const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
  9368. if (!overlayColorClass) {
  9369. style.backgroundColor = customOverlayColor;
  9370. }
  9371. if (focalPoint && !hasParallax) {
  9372. style.backgroundPosition = `${focalPoint.x * 100}% ${focalPoint.y * 100}%`;
  9373. }
  9374. if (customGradient && !url) {
  9375. style.background = customGradient;
  9376. }
  9377. style.minHeight = minHeight || undefined;
  9378. const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
  9379. 'has-background-dim': dimRatio !== 0,
  9380. 'has-parallax': hasParallax,
  9381. 'has-background-gradient': customGradient,
  9382. [gradientClass]: !url && gradientClass
  9383. });
  9384. return (0,external_wp_element_namespaceObject.createElement)("div", {
  9385. className: classes,
  9386. style: style
  9387. }, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
  9388. "aria-hidden": "true",
  9389. className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
  9390. style: customGradient ? {
  9391. background: customGradient
  9392. } : undefined
  9393. }), VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  9394. className: "wp-block-cover__video-background",
  9395. autoPlay: true,
  9396. muted: true,
  9397. loop: true,
  9398. src: url
  9399. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  9400. className: "wp-block-cover__inner-container"
  9401. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  9402. },
  9403. migrate: migrateDimRatio
  9404. };
  9405. const v3 = {
  9406. attributes: { ...deprecated_blockAttributes,
  9407. title: {
  9408. type: 'string',
  9409. source: 'html',
  9410. selector: 'p'
  9411. },
  9412. contentAlign: {
  9413. type: 'string',
  9414. default: 'center'
  9415. }
  9416. },
  9417. supports: {
  9418. align: true
  9419. },
  9420. save(_ref7) {
  9421. let {
  9422. attributes
  9423. } = _ref7;
  9424. const {
  9425. backgroundType,
  9426. contentAlign,
  9427. customOverlayColor,
  9428. dimRatio,
  9429. focalPoint,
  9430. hasParallax,
  9431. overlayColor,
  9432. title,
  9433. url
  9434. } = attributes;
  9435. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  9436. const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
  9437. if (!overlayColorClass) {
  9438. style.backgroundColor = customOverlayColor;
  9439. }
  9440. if (focalPoint && !hasParallax) {
  9441. style.backgroundPosition = `${focalPoint.x * 100}% ${focalPoint.y * 100}%`;
  9442. }
  9443. const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
  9444. 'has-background-dim': dimRatio !== 0,
  9445. 'has-parallax': hasParallax,
  9446. [`has-${contentAlign}-content`]: contentAlign !== 'center'
  9447. });
  9448. return (0,external_wp_element_namespaceObject.createElement)("div", {
  9449. className: classes,
  9450. style: style
  9451. }, VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  9452. className: "wp-block-cover__video-background",
  9453. autoPlay: true,
  9454. muted: true,
  9455. loop: true,
  9456. src: url
  9457. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  9458. tagName: "p",
  9459. className: "wp-block-cover-text",
  9460. value: title
  9461. }));
  9462. },
  9463. migrate(attributes) {
  9464. const newAttribs = { ...attributes,
  9465. dimRatio: !attributes.url ? 100 : attributes.dimRatio
  9466. };
  9467. return [(0,external_lodash_namespaceObject.omit)(newAttribs, ['title', 'contentAlign']), [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  9468. content: attributes.title,
  9469. align: attributes.contentAlign,
  9470. fontSize: 'large',
  9471. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…')
  9472. })]];
  9473. }
  9474. };
  9475. const v2 = {
  9476. attributes: { ...deprecated_blockAttributes,
  9477. title: {
  9478. type: 'string',
  9479. source: 'html',
  9480. selector: 'p'
  9481. },
  9482. contentAlign: {
  9483. type: 'string',
  9484. default: 'center'
  9485. },
  9486. align: {
  9487. type: 'string'
  9488. }
  9489. },
  9490. supports: {
  9491. className: false
  9492. },
  9493. save(_ref8) {
  9494. let {
  9495. attributes
  9496. } = _ref8;
  9497. const {
  9498. url,
  9499. title,
  9500. hasParallax,
  9501. dimRatio,
  9502. align,
  9503. contentAlign,
  9504. overlayColor,
  9505. customOverlayColor
  9506. } = attributes;
  9507. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  9508. const style = backgroundImageStyles(url);
  9509. if (!overlayColorClass) {
  9510. style.backgroundColor = customOverlayColor;
  9511. }
  9512. const classes = classnames_default()('wp-block-cover-image', dimRatioToClassV1(dimRatio), overlayColorClass, {
  9513. 'has-background-dim': dimRatio !== 0,
  9514. 'has-parallax': hasParallax,
  9515. [`has-${contentAlign}-content`]: contentAlign !== 'center'
  9516. }, align ? `align${align}` : null);
  9517. return (0,external_wp_element_namespaceObject.createElement)("div", {
  9518. className: classes,
  9519. style: style
  9520. }, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  9521. tagName: "p",
  9522. className: "wp-block-cover-image-text",
  9523. value: title
  9524. }));
  9525. },
  9526. migrate(attributes) {
  9527. const newAttribs = { ...attributes,
  9528. dimRatio: !attributes.url ? 100 : attributes.dimRatio
  9529. };
  9530. return [(0,external_lodash_namespaceObject.omit)(newAttribs, ['title', 'contentAlign', 'align']), [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  9531. content: attributes.title,
  9532. align: attributes.contentAlign,
  9533. fontSize: 'large',
  9534. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…')
  9535. })]];
  9536. }
  9537. };
  9538. const cover_deprecated_v1 = {
  9539. attributes: { ...deprecated_blockAttributes,
  9540. title: {
  9541. type: 'string',
  9542. source: 'html',
  9543. selector: 'h2'
  9544. },
  9545. align: {
  9546. type: 'string'
  9547. },
  9548. contentAlign: {
  9549. type: 'string',
  9550. default: 'center'
  9551. }
  9552. },
  9553. supports: {
  9554. className: false
  9555. },
  9556. save(_ref9) {
  9557. let {
  9558. attributes
  9559. } = _ref9;
  9560. const {
  9561. url,
  9562. title,
  9563. hasParallax,
  9564. dimRatio,
  9565. align
  9566. } = attributes;
  9567. const style = backgroundImageStyles(url);
  9568. const classes = classnames_default()('wp-block-cover-image', dimRatioToClassV1(dimRatio), {
  9569. 'has-background-dim': dimRatio !== 0,
  9570. 'has-parallax': hasParallax
  9571. }, align ? `align${align}` : null);
  9572. return (0,external_wp_element_namespaceObject.createElement)("section", {
  9573. className: classes,
  9574. style: style
  9575. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  9576. tagName: "h2",
  9577. value: title
  9578. }));
  9579. },
  9580. migrate(attributes) {
  9581. const newAttribs = { ...attributes,
  9582. dimRatio: !attributes.url ? 100 : attributes.dimRatio
  9583. };
  9584. return [(0,external_lodash_namespaceObject.omit)(newAttribs, ['title', 'contentAlign', 'align']), [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  9585. content: attributes.title,
  9586. align: attributes.contentAlign,
  9587. fontSize: 'large',
  9588. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…')
  9589. })]];
  9590. }
  9591. };
  9592. /* harmony default export */ var cover_deprecated = ([v9, v8, v7, v6, v5, v4, v3, v2, cover_deprecated_v1]);
  9593. // EXTERNAL MODULE: ./node_modules/fast-average-color/dist/index.js
  9594. var dist = __webpack_require__(5027);
  9595. var dist_default = /*#__PURE__*/__webpack_require__.n(dist);
  9596. ;// CONCATENATED MODULE: ./node_modules/colord/index.mjs
  9597. var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};
  9598. ;// CONCATENATED MODULE: ./node_modules/colord/plugins/names.mjs
  9599. /* harmony default export */ function names(e,f){var a={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])}
  9600. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-featured-image.js
  9601. /**
  9602. * WordPress dependencies
  9603. */
  9604. const postFeaturedImage = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  9605. xmlns: "http://www.w3.org/2000/svg",
  9606. viewBox: "0 0 24 24"
  9607. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  9608. d: "M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"
  9609. }));
  9610. /* harmony default export */ var post_featured_image = (postFeaturedImage);
  9611. ;// CONCATENATED MODULE: external ["wp","notices"]
  9612. var external_wp_notices_namespaceObject = window["wp"]["notices"];
  9613. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit.js
  9614. /**
  9615. * External dependencies
  9616. */
  9617. /**
  9618. * WordPress dependencies
  9619. */
  9620. /**
  9621. * Internal dependencies
  9622. */
  9623. k([names]);
  9624. const {
  9625. __Visualizer: BoxControlVisualizer
  9626. } = external_wp_components_namespaceObject.__experimentalBoxControl;
  9627. function getInnerBlocksTemplate(attributes) {
  9628. return [['core/paragraph', {
  9629. align: 'center',
  9630. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…'),
  9631. ...attributes
  9632. }]];
  9633. }
  9634. function retrieveFastAverageColor() {
  9635. if (!retrieveFastAverageColor.fastAverageColor) {
  9636. retrieveFastAverageColor.fastAverageColor = new (dist_default())();
  9637. }
  9638. return retrieveFastAverageColor.fastAverageColor;
  9639. }
  9640. function CoverHeightInput(_ref) {
  9641. let {
  9642. onChange,
  9643. onUnitChange,
  9644. unit = 'px',
  9645. value = ''
  9646. } = _ref;
  9647. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl);
  9648. const inputId = `block-cover-height-input-${instanceId}`;
  9649. const isPx = unit === 'px';
  9650. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  9651. availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || ['px', 'em', 'rem', 'vw', 'vh'],
  9652. defaultValues: {
  9653. px: 430,
  9654. '%': 20,
  9655. em: 20,
  9656. rem: 20,
  9657. vw: 20,
  9658. vh: 50
  9659. }
  9660. });
  9661. const handleOnChange = unprocessedValue => {
  9662. const inputValue = unprocessedValue !== '' ? parseFloat(unprocessedValue) : undefined;
  9663. if (isNaN(inputValue) && inputValue !== undefined) {
  9664. return;
  9665. }
  9666. onChange(inputValue);
  9667. };
  9668. const computedValue = (0,external_wp_element_namespaceObject.useMemo)(() => {
  9669. const [parsedQuantity] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
  9670. return [parsedQuantity, unit].join('');
  9671. }, [unit, value]);
  9672. const min = isPx ? COVER_MIN_HEIGHT : 0;
  9673. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  9674. label: (0,external_wp_i18n_namespaceObject.__)('Minimum height of cover'),
  9675. id: inputId
  9676. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  9677. id: inputId,
  9678. isResetValueOnUnitChange: true,
  9679. min: min,
  9680. onChange: handleOnChange,
  9681. onUnitChange: onUnitChange,
  9682. style: {
  9683. maxWidth: 80
  9684. },
  9685. units: units,
  9686. value: computedValue
  9687. }));
  9688. }
  9689. const RESIZABLE_BOX_ENABLE_OPTION = {
  9690. top: false,
  9691. right: false,
  9692. bottom: true,
  9693. left: false,
  9694. topRight: false,
  9695. bottomRight: false,
  9696. bottomLeft: false,
  9697. topLeft: false
  9698. };
  9699. function ResizableCover(_ref2) {
  9700. let {
  9701. className,
  9702. onResizeStart,
  9703. onResize,
  9704. onResizeStop,
  9705. ...props
  9706. } = _ref2;
  9707. const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false);
  9708. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, _extends({
  9709. className: classnames_default()(className, {
  9710. 'is-resizing': isResizing
  9711. }),
  9712. enable: RESIZABLE_BOX_ENABLE_OPTION,
  9713. onResizeStart: (_event, _direction, elt) => {
  9714. onResizeStart(elt.clientHeight);
  9715. onResize(elt.clientHeight);
  9716. },
  9717. onResize: (_event, _direction, elt) => {
  9718. onResize(elt.clientHeight);
  9719. if (!isResizing) {
  9720. setIsResizing(true);
  9721. }
  9722. },
  9723. onResizeStop: (_event, _direction, elt) => {
  9724. onResizeStop(elt.clientHeight);
  9725. setIsResizing(false);
  9726. }
  9727. }, props));
  9728. }
  9729. /**
  9730. * useCoverIsDark is a hook that returns a boolean variable specifying if the cover
  9731. * background is dark or not.
  9732. *
  9733. * @param {?string} url Url of the media background.
  9734. * @param {?number} dimRatio Transparency of the overlay color. If an image and
  9735. * color are set, dimRatio is used to decide what is used
  9736. * for background darkness checking purposes.
  9737. * @param {?string} overlayColor String containing the overlay color value if one exists.
  9738. * @param {?Object} elementRef If a media background is set, elementRef should contain a reference to a
  9739. * dom element that renders that media.
  9740. *
  9741. * @return {boolean} True if the cover background is considered "dark" and false otherwise.
  9742. */
  9743. function useCoverIsDark(url) {
  9744. let dimRatio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 50;
  9745. let overlayColor = arguments.length > 2 ? arguments[2] : undefined;
  9746. let elementRef = arguments.length > 3 ? arguments[3] : undefined;
  9747. const [isDark, setIsDark] = (0,external_wp_element_namespaceObject.useState)(false);
  9748. (0,external_wp_element_namespaceObject.useEffect)(() => {
  9749. // If opacity is lower than 50 the dominant color is the image or video color,
  9750. // so use that color for the dark mode computation.
  9751. if (url && dimRatio <= 50 && elementRef.current) {
  9752. retrieveFastAverageColor().getColorAsync(elementRef.current, color => {
  9753. setIsDark(color.isDark);
  9754. });
  9755. }
  9756. }, [url, url && dimRatio <= 50 && elementRef.current, setIsDark]);
  9757. (0,external_wp_element_namespaceObject.useEffect)(() => {
  9758. // If opacity is greater than 50 the dominant color is the overlay color,
  9759. // so use that color for the dark mode computation.
  9760. if (dimRatio > 50 || !url) {
  9761. if (!overlayColor) {
  9762. // If no overlay color exists the overlay color is black (isDark )
  9763. setIsDark(true);
  9764. return;
  9765. }
  9766. setIsDark(w(overlayColor).isDark());
  9767. }
  9768. }, [overlayColor, dimRatio > 50 || !url, setIsDark]);
  9769. (0,external_wp_element_namespaceObject.useEffect)(() => {
  9770. if (!url && !overlayColor) {
  9771. // Reset isDark.
  9772. setIsDark(false);
  9773. }
  9774. }, [!url && !overlayColor, setIsDark]);
  9775. return isDark;
  9776. }
  9777. function mediaPosition(_ref3) {
  9778. let {
  9779. x,
  9780. y
  9781. } = _ref3;
  9782. return `${Math.round(x * 100)}% ${Math.round(y * 100)}%`;
  9783. }
  9784. /**
  9785. * Is the URL a temporary blob URL? A blob URL is one that is used temporarily while
  9786. * the media (image or video) is being uploaded and will not have an id allocated yet.
  9787. *
  9788. * @param {number} id The id of the media.
  9789. * @param {string} url The url of the media.
  9790. *
  9791. * @return {boolean} Is the URL a Blob URL.
  9792. */
  9793. const isTemporaryMedia = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url);
  9794. function CoverPlaceholder(_ref4) {
  9795. let {
  9796. disableMediaButtons = false,
  9797. children,
  9798. onSelectMedia,
  9799. onError,
  9800. style
  9801. } = _ref4;
  9802. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  9803. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  9804. icon: library_cover
  9805. }),
  9806. labels: {
  9807. title: (0,external_wp_i18n_namespaceObject.__)('Cover'),
  9808. instructions: (0,external_wp_i18n_namespaceObject.__)('Drag and drop onto this block, upload, or select existing media from your library.')
  9809. },
  9810. onSelect: onSelectMedia,
  9811. accept: "image/*,video/*",
  9812. allowedTypes: shared_ALLOWED_MEDIA_TYPES,
  9813. disableMediaButtons: disableMediaButtons,
  9814. onError: onError,
  9815. style: style
  9816. }, children);
  9817. }
  9818. function CoverEdit(_ref5) {
  9819. var _useSetting, _styleAttribute$spaci, _styleAttribute$visua;
  9820. let {
  9821. attributes,
  9822. clientId,
  9823. isSelected,
  9824. overlayColor,
  9825. setAttributes,
  9826. setOverlayColor,
  9827. toggleSelection,
  9828. context: {
  9829. postId,
  9830. postType
  9831. }
  9832. } = _ref5;
  9833. const {
  9834. contentPosition,
  9835. id,
  9836. useFeaturedImage,
  9837. dimRatio,
  9838. focalPoint,
  9839. hasParallax,
  9840. isDark,
  9841. isRepeated,
  9842. minHeight,
  9843. minHeightUnit,
  9844. style: styleAttribute,
  9845. alt,
  9846. allowedBlocks,
  9847. templateLock
  9848. } = attributes;
  9849. const [featuredImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'featured_media', postId);
  9850. const media = (0,external_wp_data_namespaceObject.useSelect)(select => featuredImage && select(external_wp_coreData_namespaceObject.store).getMedia(featuredImage, {
  9851. context: 'view'
  9852. }), [featuredImage]);
  9853. const mediaUrl = media === null || media === void 0 ? void 0 : media.source_url; // instead of destructuring the attributes
  9854. // we define the url and background type
  9855. // depending on the value of the useFeaturedImage flag
  9856. // to preview in edit the dynamic featured image
  9857. const url = useFeaturedImage ? mediaUrl : attributes.url;
  9858. const backgroundType = useFeaturedImage ? IMAGE_BACKGROUND_TYPE : attributes.backgroundType;
  9859. const {
  9860. __unstableMarkNextChangeAsNotPersistent
  9861. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  9862. const {
  9863. createErrorNotice
  9864. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  9865. const {
  9866. gradientClass,
  9867. gradientValue,
  9868. setGradient
  9869. } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)();
  9870. const onSelectMedia = attributesFromMedia(setAttributes, dimRatio);
  9871. const isUploadingMedia = isTemporaryMedia(id, url);
  9872. const [prevMinHeightValue, setPrevMinHeightValue] = (0,external_wp_element_namespaceObject.useState)(minHeight);
  9873. const [prevMinHeightUnit, setPrevMinHeightUnit] = (0,external_wp_element_namespaceObject.useState)(minHeightUnit);
  9874. const isMinFullHeight = minHeightUnit === 'vh' && minHeight === 100;
  9875. const toggleMinFullHeight = () => {
  9876. if (isMinFullHeight) {
  9877. // If there aren't previous values, take the default ones.
  9878. if (prevMinHeightUnit === 'vh' && prevMinHeightValue === 100) {
  9879. return setAttributes({
  9880. minHeight: undefined,
  9881. minHeightUnit: undefined
  9882. });
  9883. } // Set the previous values of height.
  9884. return setAttributes({
  9885. minHeight: prevMinHeightValue,
  9886. minHeightUnit: prevMinHeightUnit
  9887. });
  9888. }
  9889. setPrevMinHeightValue(minHeight);
  9890. setPrevMinHeightUnit(minHeightUnit); // Set full height.
  9891. return setAttributes({
  9892. minHeight: 100,
  9893. minHeightUnit: 'vh'
  9894. });
  9895. };
  9896. const toggleParallax = () => {
  9897. setAttributes({
  9898. hasParallax: !hasParallax,
  9899. ...(!hasParallax ? {
  9900. focalPoint: undefined
  9901. } : {})
  9902. });
  9903. };
  9904. const toggleIsRepeated = () => {
  9905. setAttributes({
  9906. isRepeated: !isRepeated
  9907. });
  9908. };
  9909. const toggleUseFeaturedImage = () => {
  9910. setAttributes({
  9911. id: undefined,
  9912. url: undefined,
  9913. useFeaturedImage: !useFeaturedImage,
  9914. dimRatio: dimRatio === 100 ? 50 : dimRatio,
  9915. backgroundType: useFeaturedImage ? IMAGE_BACKGROUND_TYPE : undefined
  9916. });
  9917. };
  9918. const onUploadError = message => {
  9919. createErrorNotice(Array.isArray(message) ? message[2] : message, {
  9920. type: 'snackbar'
  9921. });
  9922. };
  9923. const isDarkElement = (0,external_wp_element_namespaceObject.useRef)();
  9924. const isCoverDark = useCoverIsDark(url, dimRatio, overlayColor.color, isDarkElement);
  9925. (0,external_wp_element_namespaceObject.useEffect)(() => {
  9926. // This side-effect should not create an undo level.
  9927. __unstableMarkNextChangeAsNotPersistent();
  9928. setAttributes({
  9929. isDark: isCoverDark
  9930. });
  9931. }, [isCoverDark]);
  9932. const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  9933. const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  9934. const minHeightWithUnit = minHeight && minHeightUnit ? `${minHeight}${minHeightUnit}` : minHeight;
  9935. const isImgElement = !(hasParallax || isRepeated);
  9936. const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : undefined),
  9937. minHeight: minHeightWithUnit || undefined
  9938. };
  9939. const bgStyle = {
  9940. backgroundColor: overlayColor.color
  9941. };
  9942. const mediaStyle = {
  9943. objectPosition: focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined
  9944. };
  9945. const hasBackground = !!(url || overlayColor.color || gradientValue);
  9946. const showFocalPointPicker = isVideoBackground || isImageBackground && (!hasParallax || isRepeated);
  9947. const imperativeFocalPointPreview = value => {
  9948. const [styleOfRef, property] = isDarkElement.current ? [isDarkElement.current.style, 'objectPosition'] : [ref.current.style, 'backgroundPosition'];
  9949. styleOfRef[property] = mediaPosition(value);
  9950. };
  9951. const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId).innerBlocks.length > 0, [clientId]);
  9952. const controls = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  9953. group: "block"
  9954. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockAlignmentMatrixControl, {
  9955. label: (0,external_wp_i18n_namespaceObject.__)('Change content position'),
  9956. value: contentPosition,
  9957. onChange: nextPosition => setAttributes({
  9958. contentPosition: nextPosition
  9959. }),
  9960. isDisabled: !hasInnerBlocks
  9961. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockFullHeightAligmentControl, {
  9962. isActive: isMinFullHeight,
  9963. onToggle: toggleMinFullHeight,
  9964. isDisabled: !hasInnerBlocks
  9965. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  9966. group: "other"
  9967. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  9968. icon: post_featured_image,
  9969. label: (0,external_wp_i18n_namespaceObject.__)('Use featured image'),
  9970. isPressed: useFeaturedImage,
  9971. onClick: toggleUseFeaturedImage
  9972. }), !useFeaturedImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  9973. mediaId: id,
  9974. mediaURL: url,
  9975. allowedTypes: shared_ALLOWED_MEDIA_TYPES,
  9976. accept: "image/*,video/*",
  9977. onSelect: onSelectMedia,
  9978. name: !url ? (0,external_wp_i18n_namespaceObject.__)('Add Media') : (0,external_wp_i18n_namespaceObject.__)('Replace')
  9979. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, !!url && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  9980. title: (0,external_wp_i18n_namespaceObject.__)('Media settings')
  9981. }, isImageBackground && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  9982. label: (0,external_wp_i18n_namespaceObject.__)('Fixed background'),
  9983. checked: hasParallax,
  9984. onChange: toggleParallax
  9985. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  9986. label: (0,external_wp_i18n_namespaceObject.__)('Repeated background'),
  9987. checked: isRepeated,
  9988. onChange: toggleIsRepeated
  9989. })), showFocalPointPicker && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FocalPointPicker, {
  9990. label: (0,external_wp_i18n_namespaceObject.__)('Focal point picker'),
  9991. url: url,
  9992. value: focalPoint,
  9993. onDragStart: imperativeFocalPointPreview,
  9994. onDrag: imperativeFocalPointPreview,
  9995. onChange: newFocalPoint => setAttributes({
  9996. focalPoint: newFocalPoint
  9997. })
  9998. }), !useFeaturedImage && url && isImageBackground && isImgElement && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
  9999. label: (0,external_wp_i18n_namespaceObject.__)('Alt text (alternative text)'),
  10000. value: alt,
  10001. onChange: newAlt => setAttributes({
  10002. alt: newAlt
  10003. }),
  10004. help: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
  10005. href: "https://www.w3.org/WAI/tutorials/images/decision-tree"
  10006. }, (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image')), (0,external_wp_i18n_namespaceObject.__)('Leave empty if the image is purely decorative.'))
  10007. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelRow, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  10008. variant: "secondary",
  10009. isSmall: true,
  10010. className: "block-library-cover__reset-button",
  10011. onClick: () => setAttributes({
  10012. url: undefined,
  10013. id: undefined,
  10014. backgroundType: undefined,
  10015. focalPoint: undefined,
  10016. hasParallax: undefined,
  10017. isRepeated: undefined,
  10018. useFeaturedImage: false
  10019. })
  10020. }, (0,external_wp_i18n_namespaceObject.__)('Clear Media')))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalPanelColorGradientSettings, {
  10021. __experimentalHasMultipleOrigins: true,
  10022. __experimentalIsRenderedInSidebar: true,
  10023. title: (0,external_wp_i18n_namespaceObject.__)('Overlay'),
  10024. initialOpen: true,
  10025. settings: [{
  10026. colorValue: overlayColor.color,
  10027. gradientValue,
  10028. onColorChange: setOverlayColor,
  10029. onGradientChange: setGradient,
  10030. label: (0,external_wp_i18n_namespaceObject.__)('Color')
  10031. }]
  10032. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  10033. label: (0,external_wp_i18n_namespaceObject.__)('Opacity'),
  10034. value: dimRatio,
  10035. onChange: newDimRation => setAttributes({
  10036. dimRatio: newDimRation
  10037. }),
  10038. min: 0,
  10039. max: 100,
  10040. step: 10,
  10041. required: true
  10042. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  10043. __experimentalGroup: "dimensions"
  10044. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  10045. hasValue: () => !!minHeight,
  10046. label: (0,external_wp_i18n_namespaceObject.__)('Minimum height'),
  10047. onDeselect: () => setAttributes({
  10048. minHeight: undefined,
  10049. minHeightUnit: undefined
  10050. }),
  10051. resetAllFilter: () => ({
  10052. minHeight: undefined,
  10053. minHeightUnit: undefined
  10054. }),
  10055. isShownByDefault: true,
  10056. panelId: clientId
  10057. }, (0,external_wp_element_namespaceObject.createElement)(CoverHeightInput, {
  10058. value: minHeight,
  10059. unit: minHeightUnit,
  10060. onChange: newMinHeight => setAttributes({
  10061. minHeight: newMinHeight
  10062. }),
  10063. onUnitChange: nextUnit => setAttributes({
  10064. minHeightUnit: nextUnit
  10065. })
  10066. }))));
  10067. const ref = (0,external_wp_element_namespaceObject.useRef)();
  10068. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  10069. ref
  10070. }); // Check for fontSize support before we pass a fontSize attribute to the innerBlocks.
  10071. const hasFontSizes = !!((_useSetting = (0,external_wp_blockEditor_namespaceObject.useSetting)('typography.fontSizes')) !== null && _useSetting !== void 0 && _useSetting.length);
  10072. const innerBlocksTemplate = getInnerBlocksTemplate({
  10073. fontSize: hasFontSizes ? 'large' : undefined
  10074. });
  10075. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
  10076. className: 'wp-block-cover__inner-container'
  10077. }, {
  10078. template: innerBlocksTemplate,
  10079. templateInsertUpdatesSelection: true,
  10080. allowedBlocks,
  10081. templateLock
  10082. });
  10083. if (!hasInnerBlocks && !hasBackground) {
  10084. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, controls, (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, {
  10085. className: classnames_default()('is-placeholder', blockProps.className)
  10086. }), (0,external_wp_element_namespaceObject.createElement)(CoverPlaceholder, {
  10087. onSelectMedia: onSelectMedia,
  10088. onError: onUploadError,
  10089. style: {
  10090. minHeight: minHeightWithUnit || undefined
  10091. }
  10092. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  10093. className: "wp-block-cover__placeholder-background-options"
  10094. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ColorPalette, {
  10095. disableCustomColors: true,
  10096. value: overlayColor.color,
  10097. onChange: setOverlayColor,
  10098. clearable: false
  10099. }))), (0,external_wp_element_namespaceObject.createElement)(ResizableCover, {
  10100. className: "block-library-cover__resize-container",
  10101. onResizeStart: () => {
  10102. setAttributes({
  10103. minHeightUnit: 'px'
  10104. });
  10105. toggleSelection(false);
  10106. },
  10107. onResize: value => {
  10108. setAttributes({
  10109. minHeight: value
  10110. });
  10111. },
  10112. onResizeStop: newMinHeight => {
  10113. toggleSelection(true);
  10114. setAttributes({
  10115. minHeight: newMinHeight
  10116. });
  10117. },
  10118. showHandle: isSelected
  10119. })));
  10120. }
  10121. const classes = classnames_default()({
  10122. 'is-dark-theme': isDark,
  10123. 'is-light': !isDark,
  10124. 'is-transient': isUploadingMedia,
  10125. 'has-parallax': hasParallax,
  10126. 'is-repeated': isRepeated,
  10127. 'has-custom-content-position': !isContentPositionCenter(contentPosition)
  10128. }, getPositionClassName(contentPosition));
  10129. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, controls, (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, {
  10130. className: classnames_default()(classes, blockProps.className),
  10131. style: { ...style,
  10132. ...blockProps.style
  10133. },
  10134. "data-url": url
  10135. }), (0,external_wp_element_namespaceObject.createElement)(BoxControlVisualizer, {
  10136. values: styleAttribute === null || styleAttribute === void 0 ? void 0 : (_styleAttribute$spaci = styleAttribute.spacing) === null || _styleAttribute$spaci === void 0 ? void 0 : _styleAttribute$spaci.padding,
  10137. showValues: styleAttribute === null || styleAttribute === void 0 ? void 0 : (_styleAttribute$visua = styleAttribute.visualizers) === null || _styleAttribute$visua === void 0 ? void 0 : _styleAttribute$visua.padding,
  10138. className: "block-library-cover__padding-visualizer"
  10139. }), (0,external_wp_element_namespaceObject.createElement)(ResizableCover, {
  10140. className: "block-library-cover__resize-container",
  10141. onResizeStart: () => {
  10142. setAttributes({
  10143. minHeightUnit: 'px'
  10144. });
  10145. toggleSelection(false);
  10146. },
  10147. onResize: value => {
  10148. setAttributes({
  10149. minHeight: value
  10150. });
  10151. },
  10152. onResizeStop: newMinHeight => {
  10153. toggleSelection(true);
  10154. setAttributes({
  10155. minHeight: newMinHeight
  10156. });
  10157. },
  10158. showHandle: isSelected
  10159. }), (0,external_wp_element_namespaceObject.createElement)("span", {
  10160. "aria-hidden": "true",
  10161. className: classnames_default()('wp-block-cover__background', dimRatioToClass(dimRatio), {
  10162. [overlayColor.class]: overlayColor.class,
  10163. 'has-background-dim': dimRatio !== undefined,
  10164. // For backwards compatibility. Former versions of the Cover Block applied
  10165. // `.wp-block-cover__gradient-background` in the presence of
  10166. // media, a gradient and a dim.
  10167. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
  10168. 'has-background-gradient': gradientValue,
  10169. [gradientClass]: gradientClass
  10170. }),
  10171. style: {
  10172. backgroundImage: gradientValue,
  10173. ...bgStyle
  10174. }
  10175. }), url && isImageBackground && isImgElement && (0,external_wp_element_namespaceObject.createElement)("img", {
  10176. ref: isDarkElement,
  10177. className: "wp-block-cover__image-background",
  10178. alt: alt,
  10179. src: url,
  10180. style: mediaStyle
  10181. }), url && isVideoBackground && (0,external_wp_element_namespaceObject.createElement)("video", {
  10182. ref: isDarkElement,
  10183. className: "wp-block-cover__video-background",
  10184. autoPlay: true,
  10185. muted: true,
  10186. loop: true,
  10187. src: url,
  10188. style: mediaStyle
  10189. }), isUploadingMedia && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_element_namespaceObject.createElement)(CoverPlaceholder, {
  10190. disableMediaButtons: true,
  10191. onSelectMedia: onSelectMedia,
  10192. onError: onUploadError
  10193. }), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
  10194. }
  10195. /* harmony default export */ var cover_edit = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_blockEditor_namespaceObject.withColors)({
  10196. overlayColor: 'background-color'
  10197. })])(CoverEdit));
  10198. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/save.js
  10199. /**
  10200. * External dependencies
  10201. */
  10202. /**
  10203. * WordPress dependencies
  10204. */
  10205. /**
  10206. * Internal dependencies
  10207. */
  10208. function cover_save_save(_ref) {
  10209. let {
  10210. attributes
  10211. } = _ref;
  10212. const {
  10213. backgroundType,
  10214. gradient,
  10215. contentPosition,
  10216. customGradient,
  10217. customOverlayColor,
  10218. dimRatio,
  10219. focalPoint,
  10220. useFeaturedImage,
  10221. hasParallax,
  10222. isDark,
  10223. isRepeated,
  10224. overlayColor,
  10225. url,
  10226. alt,
  10227. id,
  10228. minHeight: minHeightProp,
  10229. minHeightUnit
  10230. } = attributes;
  10231. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  10232. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  10233. const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
  10234. const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  10235. const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  10236. const isImgElement = !(hasParallax || isRepeated);
  10237. const style = { ...(isImageBackground && !isImgElement && !useFeaturedImage ? backgroundImageStyles(url) : {}),
  10238. minHeight: minHeight || undefined
  10239. };
  10240. const bgStyle = {
  10241. backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
  10242. background: customGradient ? customGradient : undefined
  10243. };
  10244. const objectPosition = // prettier-ignore
  10245. focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
  10246. const classes = classnames_default()({
  10247. 'is-light': !isDark,
  10248. 'has-parallax': hasParallax,
  10249. 'is-repeated': isRepeated,
  10250. 'has-custom-content-position': !isContentPositionCenter(contentPosition)
  10251. }, getPositionClassName(contentPosition));
  10252. const gradientValue = gradient || customGradient;
  10253. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  10254. className: classes,
  10255. style
  10256. }), (0,external_wp_element_namespaceObject.createElement)("span", {
  10257. "aria-hidden": "true",
  10258. className: classnames_default()('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), {
  10259. 'has-background-dim': dimRatio !== undefined,
  10260. // For backwards compatibility. Former versions of the Cover Block applied
  10261. // `.wp-block-cover__gradient-background` in the presence of
  10262. // media, a gradient and a dim.
  10263. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
  10264. 'has-background-gradient': gradientValue,
  10265. [gradientClass]: gradientClass
  10266. }),
  10267. style: bgStyle
  10268. }), !useFeaturedImage && isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
  10269. className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
  10270. alt: alt,
  10271. src: url,
  10272. style: {
  10273. objectPosition
  10274. },
  10275. "data-object-fit": "cover",
  10276. "data-object-position": objectPosition
  10277. }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  10278. className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
  10279. autoPlay: true,
  10280. muted: true,
  10281. loop: true,
  10282. playsInline: true,
  10283. src: url,
  10284. style: {
  10285. objectPosition
  10286. },
  10287. "data-object-fit": "cover",
  10288. "data-object-position": objectPosition
  10289. }), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
  10290. className: 'wp-block-cover__inner-container'
  10291. })));
  10292. }
  10293. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/transforms.js
  10294. /**
  10295. * WordPress dependencies
  10296. */
  10297. /**
  10298. * Internal dependencies
  10299. */
  10300. const cover_transforms_transforms = {
  10301. from: [{
  10302. type: 'block',
  10303. blocks: ['core/image'],
  10304. transform: _ref => {
  10305. var _style$color;
  10306. let {
  10307. caption,
  10308. url,
  10309. alt,
  10310. align,
  10311. id,
  10312. anchor,
  10313. style
  10314. } = _ref;
  10315. return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', {
  10316. dimRatio: 50,
  10317. url,
  10318. alt,
  10319. align,
  10320. id,
  10321. anchor,
  10322. style: {
  10323. color: {
  10324. duotone: style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.duotone
  10325. }
  10326. }
  10327. }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  10328. content: caption,
  10329. fontSize: 'large',
  10330. align: 'center'
  10331. })]);
  10332. }
  10333. }, {
  10334. type: 'block',
  10335. blocks: ['core/video'],
  10336. transform: _ref2 => {
  10337. let {
  10338. caption,
  10339. src,
  10340. align,
  10341. id,
  10342. anchor
  10343. } = _ref2;
  10344. return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', {
  10345. dimRatio: 50,
  10346. url: src,
  10347. align,
  10348. id,
  10349. backgroundType: VIDEO_BACKGROUND_TYPE,
  10350. anchor
  10351. }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  10352. content: caption,
  10353. fontSize: 'large',
  10354. align: 'center'
  10355. })]);
  10356. }
  10357. }, {
  10358. type: 'block',
  10359. blocks: ['core/group'],
  10360. transform: (attributes, innerBlocks) => {
  10361. var _style$color2, _style$color3, _style$color4, _style$color5, _attributes$style;
  10362. const {
  10363. align,
  10364. anchor,
  10365. backgroundColor,
  10366. gradient,
  10367. style
  10368. } = attributes; // If no background or gradient color is provided, default to 50% opacity.
  10369. // This matches the styling of a Cover block with a background image,
  10370. // in the state where a background image has been removed.
  10371. const dimRatio = backgroundColor || gradient || style !== null && style !== void 0 && (_style$color2 = style.color) !== null && _style$color2 !== void 0 && _style$color2.background || style !== null && style !== void 0 && (_style$color3 = style.color) !== null && _style$color3 !== void 0 && _style$color3.gradient ? undefined : 50; // Move the background or gradient color to the parent Cover block.
  10372. const parentAttributes = {
  10373. align,
  10374. anchor,
  10375. dimRatio,
  10376. overlayColor: backgroundColor,
  10377. customOverlayColor: style === null || style === void 0 ? void 0 : (_style$color4 = style.color) === null || _style$color4 === void 0 ? void 0 : _style$color4.background,
  10378. gradient,
  10379. customGradient: style === null || style === void 0 ? void 0 : (_style$color5 = style.color) === null || _style$color5 === void 0 ? void 0 : _style$color5.gradient
  10380. };
  10381. const attributesWithoutBackgroundColors = { ...attributes,
  10382. backgroundColor: undefined,
  10383. gradient: undefined,
  10384. style: { ...(attributes === null || attributes === void 0 ? void 0 : attributes.style),
  10385. color: { ...(attributes === null || attributes === void 0 ? void 0 : (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : _attributes$style.color),
  10386. background: undefined,
  10387. gradient: undefined
  10388. }
  10389. }
  10390. }; // Preserve the block by nesting it within the Cover block,
  10391. // instead of converting the Group block directly to the Cover block.
  10392. return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', parentAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/group', attributesWithoutBackgroundColors, innerBlocks)]);
  10393. }
  10394. }],
  10395. to: [{
  10396. type: 'block',
  10397. blocks: ['core/image'],
  10398. isMatch: _ref3 => {
  10399. let {
  10400. backgroundType,
  10401. url,
  10402. overlayColor,
  10403. customOverlayColor,
  10404. gradient,
  10405. customGradient
  10406. } = _ref3;
  10407. if (url) {
  10408. // If a url exists the transform could happen if that URL represents an image background.
  10409. return backgroundType === IMAGE_BACKGROUND_TYPE;
  10410. } // If a url is not set the transform could happen if the cover has no background color or gradient;
  10411. return !overlayColor && !customOverlayColor && !gradient && !customGradient;
  10412. },
  10413. transform: _ref4 => {
  10414. var _style$color6;
  10415. let {
  10416. title,
  10417. url,
  10418. alt,
  10419. align,
  10420. id,
  10421. anchor,
  10422. style
  10423. } = _ref4;
  10424. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  10425. caption: title,
  10426. url,
  10427. alt,
  10428. align,
  10429. id,
  10430. anchor,
  10431. style: {
  10432. color: {
  10433. duotone: style === null || style === void 0 ? void 0 : (_style$color6 = style.color) === null || _style$color6 === void 0 ? void 0 : _style$color6.duotone
  10434. }
  10435. }
  10436. });
  10437. }
  10438. }, {
  10439. type: 'block',
  10440. blocks: ['core/video'],
  10441. isMatch: _ref5 => {
  10442. let {
  10443. backgroundType,
  10444. url,
  10445. overlayColor,
  10446. customOverlayColor,
  10447. gradient,
  10448. customGradient
  10449. } = _ref5;
  10450. if (url) {
  10451. // If a url exists the transform could happen if that URL represents a video background.
  10452. return backgroundType === VIDEO_BACKGROUND_TYPE;
  10453. } // If a url is not set the transform could happen if the cover has no background color or gradient;
  10454. return !overlayColor && !customOverlayColor && !gradient && !customGradient;
  10455. },
  10456. transform: _ref6 => {
  10457. let {
  10458. title,
  10459. url,
  10460. align,
  10461. id,
  10462. anchor
  10463. } = _ref6;
  10464. return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', {
  10465. caption: title,
  10466. src: url,
  10467. id,
  10468. align,
  10469. anchor
  10470. });
  10471. }
  10472. }]
  10473. };
  10474. /* harmony default export */ var cover_transforms = (cover_transforms_transforms);
  10475. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/index.js
  10476. /**
  10477. * WordPress dependencies
  10478. */
  10479. /**
  10480. * Internal dependencies
  10481. */
  10482. const cover_metadata = {
  10483. $schema: "https://schemas.wp.org/trunk/block.json",
  10484. apiVersion: 2,
  10485. name: "core/cover",
  10486. title: "Cover",
  10487. category: "media",
  10488. description: "Add an image or video with a text overlay \u2014 great for headers.",
  10489. textdomain: "default",
  10490. attributes: {
  10491. url: {
  10492. type: "string"
  10493. },
  10494. useFeaturedImage: {
  10495. type: "boolean",
  10496. "default": false
  10497. },
  10498. id: {
  10499. type: "number"
  10500. },
  10501. alt: {
  10502. type: "string",
  10503. source: "attribute",
  10504. selector: "img",
  10505. attribute: "alt",
  10506. "default": ""
  10507. },
  10508. hasParallax: {
  10509. type: "boolean",
  10510. "default": false
  10511. },
  10512. isRepeated: {
  10513. type: "boolean",
  10514. "default": false
  10515. },
  10516. dimRatio: {
  10517. type: "number",
  10518. "default": 100
  10519. },
  10520. overlayColor: {
  10521. type: "string"
  10522. },
  10523. customOverlayColor: {
  10524. type: "string"
  10525. },
  10526. backgroundType: {
  10527. type: "string",
  10528. "default": "image"
  10529. },
  10530. focalPoint: {
  10531. type: "object"
  10532. },
  10533. minHeight: {
  10534. type: "number"
  10535. },
  10536. minHeightUnit: {
  10537. type: "string"
  10538. },
  10539. gradient: {
  10540. type: "string"
  10541. },
  10542. customGradient: {
  10543. type: "string"
  10544. },
  10545. contentPosition: {
  10546. type: "string"
  10547. },
  10548. isDark: {
  10549. type: "boolean",
  10550. "default": true
  10551. },
  10552. allowedBlocks: {
  10553. type: "array"
  10554. },
  10555. templateLock: {
  10556. type: ["string", "boolean"],
  10557. "enum": ["all", "insert", false]
  10558. }
  10559. },
  10560. usesContext: ["postId", "postType"],
  10561. supports: {
  10562. anchor: true,
  10563. align: true,
  10564. html: false,
  10565. spacing: {
  10566. padding: true,
  10567. __experimentalDefaultControls: {
  10568. padding: true
  10569. }
  10570. },
  10571. color: {
  10572. __experimentalDuotone: "> .wp-block-cover__image-background, > .wp-block-cover__video-background",
  10573. text: false,
  10574. background: false
  10575. }
  10576. },
  10577. editorStyle: "wp-block-cover-editor",
  10578. style: "wp-block-cover"
  10579. };
  10580. const {
  10581. name: cover_name
  10582. } = cover_metadata;
  10583. const cover_settings = {
  10584. icon: library_cover,
  10585. example: {
  10586. attributes: {
  10587. customOverlayColor: '#065174',
  10588. dimRatio: 40,
  10589. url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg'
  10590. },
  10591. innerBlocks: [{
  10592. name: 'core/paragraph',
  10593. attributes: {
  10594. customFontSize: 48,
  10595. content: (0,external_wp_i18n_namespaceObject.__)('<strong>Snow Patrol</strong>'),
  10596. align: 'center'
  10597. }
  10598. }]
  10599. },
  10600. transforms: cover_transforms,
  10601. save: cover_save_save,
  10602. edit: cover_edit,
  10603. deprecated: cover_deprecated
  10604. };
  10605. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js
  10606. /**
  10607. * WordPress dependencies
  10608. */
  10609. const pencil = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  10610. xmlns: "http://www.w3.org/2000/svg",
  10611. viewBox: "0 0 24 24"
  10612. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  10613. d: "M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"
  10614. }));
  10615. /* harmony default export */ var library_pencil = (pencil);
  10616. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js
  10617. /**
  10618. * Internal dependencies
  10619. */
  10620. /* harmony default export */ var library_edit = (library_pencil);
  10621. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-controls.js
  10622. /**
  10623. * WordPress dependencies
  10624. */
  10625. function getResponsiveHelp(checked) {
  10626. return checked ? (0,external_wp_i18n_namespaceObject.__)('This embed will preserve its aspect ratio when the browser is resized.') : (0,external_wp_i18n_namespaceObject.__)('This embed may not preserve its aspect ratio when the browser is resized.');
  10627. }
  10628. const EmbedControls = _ref => {
  10629. let {
  10630. blockSupportsResponsive,
  10631. showEditButton,
  10632. themeSupportsResponsive,
  10633. allowResponsive,
  10634. toggleResponsive,
  10635. switchBackToURLInput
  10636. } = _ref;
  10637. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, showEditButton && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  10638. className: "components-toolbar__control",
  10639. label: (0,external_wp_i18n_namespaceObject.__)('Edit URL'),
  10640. icon: library_edit,
  10641. onClick: switchBackToURLInput
  10642. }))), themeSupportsResponsive && blockSupportsResponsive && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  10643. title: (0,external_wp_i18n_namespaceObject.__)('Media settings'),
  10644. className: "blocks-responsive"
  10645. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  10646. label: (0,external_wp_i18n_namespaceObject.__)('Resize for smaller devices'),
  10647. checked: allowResponsive,
  10648. help: getResponsiveHelp,
  10649. onChange: toggleResponsive
  10650. }))));
  10651. };
  10652. /* harmony default export */ var embed_controls = (EmbedControls);
  10653. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/icons.js
  10654. /**
  10655. * WordPress dependencies
  10656. */
  10657. const embedContentIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10658. viewBox: "0 0 24 24",
  10659. xmlns: "http://www.w3.org/2000/svg"
  10660. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10661. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zm-6-9.5L16 12l-2.5 2.8 1.1 1L18 12l-3.5-3.5-1 1zm-3 0l-1-1L6 12l3.5 3.8 1.1-1L8 12l2.5-2.5z"
  10662. }));
  10663. const embedAudioIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10664. viewBox: "0 0 24 24",
  10665. xmlns: "http://www.w3.org/2000/svg"
  10666. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10667. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM13.2 7.7c-.4.4-.7 1.1-.7 1.9v3.7c-.4-.3-.8-.4-1.3-.4-1.2 0-2.2 1-2.2 2.2 0 1.2 1 2.2 2.2 2.2.5 0 1-.2 1.4-.5.9-.6 1.4-1.6 1.4-2.6V9.6c0-.4.1-.6.2-.8.3-.3 1-.3 1.6-.3h.2V7h-.2c-.7 0-1.8 0-2.6.7z"
  10668. }));
  10669. const embedPhotoIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10670. viewBox: "0 0 24 24",
  10671. xmlns: "http://www.w3.org/2000/svg"
  10672. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10673. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9.2 4.5H19c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V9.8l4.6-5.3zm9.8 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"
  10674. }));
  10675. const embedVideoIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10676. viewBox: "0 0 24 24",
  10677. xmlns: "http://www.w3.org/2000/svg"
  10678. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10679. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM10 15l5-3-5-3v6z"
  10680. }));
  10681. const embedTwitterIcon = {
  10682. foreground: '#1da1f2',
  10683. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10684. xmlns: "http://www.w3.org/2000/svg",
  10685. viewBox: "0 0 24 24"
  10686. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10687. d: "M22.23 5.924c-.736.326-1.527.547-2.357.646.847-.508 1.498-1.312 1.804-2.27-.793.47-1.67.812-2.606.996C18.325 4.498 17.258 4 16.078 4c-2.266 0-4.103 1.837-4.103 4.103 0 .322.036.635.106.935-3.41-.17-6.433-1.804-8.457-4.287-.353.607-.556 1.312-.556 2.064 0 1.424.724 2.68 1.825 3.415-.673-.022-1.305-.207-1.86-.514v.052c0 1.988 1.415 3.647 3.293 4.023-.344.095-.707.145-1.08.145-.265 0-.522-.026-.773-.074.522 1.63 2.038 2.817 3.833 2.85-1.404 1.1-3.174 1.757-5.096 1.757-.332 0-.66-.02-.98-.057 1.816 1.164 3.973 1.843 6.29 1.843 7.547 0 11.675-6.252 11.675-11.675 0-.178-.004-.355-.012-.53.802-.578 1.497-1.3 2.047-2.124z"
  10688. })))
  10689. };
  10690. const embedYouTubeIcon = {
  10691. foreground: '#ff0000',
  10692. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10693. viewBox: "0 0 24 24"
  10694. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10695. d: "M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z"
  10696. }))
  10697. };
  10698. const embedFacebookIcon = {
  10699. foreground: '#3b5998',
  10700. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10701. viewBox: "0 0 24 24"
  10702. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10703. d: "M20 3H4c-.6 0-1 .4-1 1v16c0 .5.4 1 1 1h8.6v-7h-2.3v-2.7h2.3v-2c0-2.3 1.4-3.6 3.5-3.6 1 0 1.8.1 2.1.1v2.4h-1.4c-1.1 0-1.3.5-1.3 1.3v1.7h2.7l-.4 2.8h-2.3v7H20c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1z"
  10704. }))
  10705. };
  10706. const embedInstagramIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10707. viewBox: "0 0 24 24"
  10708. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10709. d: "M12 4.622c2.403 0 2.688.01 3.637.052.877.04 1.354.187 1.67.31.42.163.72.358 1.036.673.315.315.51.615.673 1.035.123.317.27.794.31 1.67.043.95.052 1.235.052 3.638s-.01 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.67-.163.42-.358.72-.673 1.036-.315.315-.615.51-1.035.673-.317.123-.794.27-1.67.31-.95.043-1.234.052-3.638.052s-2.688-.01-3.637-.052c-.877-.04-1.354-.187-1.67-.31-.42-.163-.72-.358-1.036-.673-.315-.315-.51-.615-.673-1.035-.123-.317-.27-.794-.31-1.67-.043-.95-.052-1.235-.052-3.638s.01-2.688.052-3.637c.04-.877.187-1.354.31-1.67.163-.42.358-.72.673-1.036.315-.315.615-.51 1.035-.673.317-.123.794-.27 1.67-.31.95-.043 1.235-.052 3.638-.052M12 3c-2.444 0-2.75.01-3.71.054s-1.613.196-2.185.418c-.592.23-1.094.538-1.594 1.04-.5.5-.807 1-1.037 1.593-.223.572-.375 1.226-.42 2.184C3.01 9.25 3 9.555 3 12s.01 2.75.054 3.71.196 1.613.418 2.186c.23.592.538 1.094 1.038 1.594s1.002.808 1.594 1.038c.572.222 1.227.375 2.185.418.96.044 1.266.054 3.71.054s2.75-.01 3.71-.054 1.613-.196 2.186-.418c.592-.23 1.094-.538 1.594-1.038s.808-1.002 1.038-1.594c.222-.572.375-1.227.418-2.185.044-.96.054-1.266.054-3.71s-.01-2.75-.054-3.71-.196-1.613-.418-2.186c-.23-.592-.538-1.094-1.038-1.594s-1.002-.808-1.594-1.038c-.572-.222-1.227-.375-2.185-.418C14.75 3.01 14.445 3 12 3zm0 4.378c-2.552 0-4.622 2.07-4.622 4.622s2.07 4.622 4.622 4.622 4.622-2.07 4.622-4.622S14.552 7.378 12 7.378zM12 15c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3zm4.804-8.884c-.596 0-1.08.484-1.08 1.08s.484 1.08 1.08 1.08c.596 0 1.08-.484 1.08-1.08s-.483-1.08-1.08-1.08z"
  10710. })));
  10711. const embedWordPressIcon = {
  10712. foreground: '#0073AA',
  10713. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10714. viewBox: "0 0 24 24"
  10715. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10716. d: "M12.158 12.786l-2.698 7.84c.806.236 1.657.365 2.54.365 1.047 0 2.05-.18 2.986-.51-.024-.037-.046-.078-.065-.123l-2.762-7.57zM3.008 12c0 3.56 2.07 6.634 5.068 8.092L3.788 8.342c-.5 1.117-.78 2.354-.78 3.658zm15.06-.454c0-1.112-.398-1.88-.74-2.48-.456-.74-.883-1.368-.883-2.11 0-.825.627-1.595 1.51-1.595.04 0 .078.006.116.008-1.598-1.464-3.73-2.36-6.07-2.36-3.14 0-5.904 1.613-7.512 4.053.21.008.41.012.58.012.94 0 2.395-.114 2.395-.114.484-.028.54.684.057.74 0 0-.487.058-1.03.086l3.275 9.74 1.968-5.902-1.4-3.838c-.485-.028-.944-.085-.944-.085-.486-.03-.43-.77.056-.742 0 0 1.484.114 2.368.114.94 0 2.397-.114 2.397-.114.486-.028.543.684.058.74 0 0-.488.058-1.03.086l3.25 9.665.897-2.997c.456-1.17.684-2.137.684-2.907zm1.82-3.86c.04.286.06.593.06.924 0 .912-.17 1.938-.683 3.22l-2.746 7.94c2.672-1.558 4.47-4.454 4.47-7.77 0-1.564-.4-3.033-1.1-4.314zM12 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10z"
  10717. })))
  10718. };
  10719. const embedSpotifyIcon = {
  10720. foreground: '#1db954',
  10721. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10722. viewBox: "0 0 24 24"
  10723. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10724. d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m4.586 14.424c-.18.295-.563.387-.857.207-2.35-1.434-5.305-1.76-8.786-.963-.335.077-.67-.133-.746-.47-.077-.334.132-.67.47-.745 3.808-.87 7.076-.496 9.712 1.115.293.18.386.563.206.857M17.81 13.7c-.226.367-.706.482-1.072.257-2.687-1.652-6.785-2.13-9.965-1.166-.413.127-.848-.106-.973-.517-.125-.413.108-.848.52-.973 3.632-1.102 8.147-.568 11.234 1.328.366.226.48.707.256 1.072m.105-2.835C14.692 8.95 9.375 8.775 6.297 9.71c-.493.15-1.016-.13-1.166-.624-.148-.495.13-1.017.625-1.167 3.532-1.073 9.404-.866 13.115 1.337.445.264.59.838.327 1.282-.264.443-.838.59-1.282.325"
  10725. }))
  10726. };
  10727. const embedFlickrIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10728. viewBox: "0 0 24 24"
  10729. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10730. d: "m6.5 7c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5zm11 0c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5z"
  10731. }));
  10732. const embedVimeoIcon = {
  10733. foreground: '#1ab7ea',
  10734. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10735. xmlns: "http://www.w3.org/2000/svg",
  10736. viewBox: "0 0 24 24"
  10737. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10738. d: "M22.396 7.164c-.093 2.026-1.507 4.8-4.245 8.32C15.323 19.16 12.93 21 10.97 21c-1.214 0-2.24-1.12-3.08-3.36-.56-2.052-1.118-4.105-1.68-6.158-.622-2.24-1.29-3.36-2.004-3.36-.156 0-.7.328-1.634.98l-.978-1.26c1.027-.903 2.04-1.806 3.037-2.71C6 3.95 7.03 3.328 7.716 3.265c1.62-.156 2.616.95 2.99 3.32.404 2.558.685 4.148.84 4.77.468 2.12.982 3.18 1.543 3.18.435 0 1.09-.687 1.963-2.064.872-1.376 1.34-2.422 1.402-3.142.125-1.187-.343-1.782-1.4-1.782-.5 0-1.013.115-1.542.34 1.023-3.35 2.977-4.976 5.862-4.883 2.14.063 3.148 1.45 3.024 4.16z"
  10739. })))
  10740. };
  10741. const embedRedditIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10742. viewBox: "0 0 24 24"
  10743. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10744. d: "M22 11.816c0-1.256-1.02-2.277-2.277-2.277-.593 0-1.122.24-1.526.613-1.48-.965-3.455-1.594-5.647-1.69l1.17-3.702 3.18.75c.01 1.027.847 1.86 1.877 1.86 1.035 0 1.877-.84 1.877-1.877 0-1.035-.842-1.877-1.877-1.877-.77 0-1.43.466-1.72 1.13L13.55 3.92c-.204-.047-.4.067-.46.26l-1.35 4.27c-2.317.037-4.412.67-5.97 1.67-.402-.355-.917-.58-1.493-.58C3.02 9.54 2 10.56 2 11.815c0 .814.433 1.523 1.078 1.925-.037.222-.06.445-.06.673 0 3.292 4.01 5.97 8.94 5.97s8.94-2.678 8.94-5.97c0-.214-.02-.424-.052-.632.687-.39 1.154-1.12 1.154-1.964zm-3.224-7.422c.606 0 1.1.493 1.1 1.1s-.493 1.1-1.1 1.1-1.1-.494-1.1-1.1.493-1.1 1.1-1.1zm-16 7.422c0-.827.673-1.5 1.5-1.5.313 0 .598.103.838.27-.85.675-1.477 1.478-1.812 2.36-.32-.274-.525-.676-.525-1.13zm9.183 7.79c-4.502 0-8.165-2.33-8.165-5.193S7.457 9.22 11.96 9.22s8.163 2.33 8.163 5.193-3.663 5.193-8.164 5.193zM20.635 13c-.326-.89-.948-1.7-1.797-2.383.247-.186.55-.3.882-.3.827 0 1.5.672 1.5 1.5 0 .482-.23.91-.586 1.184zm-11.64 1.704c-.76 0-1.397-.616-1.397-1.376 0-.76.636-1.397 1.396-1.397.76 0 1.376.638 1.376 1.398 0 .76-.616 1.376-1.376 1.376zm7.405-1.376c0 .76-.615 1.376-1.375 1.376s-1.4-.616-1.4-1.376c0-.76.64-1.397 1.4-1.397.76 0 1.376.638 1.376 1.398zm-1.17 3.38c.15.152.15.398 0 .55-.675.674-1.728 1.002-3.22 1.002l-.01-.002-.012.002c-1.492 0-2.544-.328-3.218-1.002-.152-.152-.152-.398 0-.55.152-.152.4-.15.55 0 .52.52 1.394.775 2.67.775l.01.002.01-.002c1.276 0 2.15-.253 2.67-.775.15-.152.398-.152.55 0z"
  10745. }));
  10746. const embedTumblrIcon = {
  10747. foreground: '#35465c',
  10748. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10749. viewBox: "0 0 24 24"
  10750. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10751. d: "M19 3H5a2 2 0 00-2 2v14c0 1.1.9 2 2 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm-5.69 14.66c-2.72 0-3.1-1.9-3.1-3.16v-3.56H8.49V8.99c1.7-.62 2.54-1.99 2.64-2.87 0-.06.06-.41.06-.58h1.9v3.1h2.17v2.3h-2.18v3.1c0 .47.13 1.3 1.2 1.26h1.1v2.36c-1.01.02-2.07 0-2.07 0z"
  10752. }))
  10753. };
  10754. const embedAmazonIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10755. viewBox: "0 0 24 24"
  10756. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10757. d: "M18.42 14.58c-.51-.66-1.05-1.23-1.05-2.5V7.87c0-1.8.15-3.45-1.2-4.68-1.05-1.02-2.79-1.35-4.14-1.35-2.6 0-5.52.96-6.12 4.14-.06.36.18.54.4.57l2.66.3c.24-.03.42-.27.48-.5.24-1.12 1.17-1.63 2.2-1.63.56 0 1.22.21 1.55.7.4.56.33 1.31.33 1.97v.36c-1.59.18-3.66.27-5.16.93a4.63 4.63 0 0 0-2.93 4.44c0 2.82 1.8 4.23 4.1 4.23 1.95 0 3.03-.45 4.53-1.98.51.72.66 1.08 1.59 1.83.18.09.45.09.63-.1v.04l2.1-1.8c.24-.21.2-.48.03-.75zm-5.4-1.2c-.45.75-1.14 1.23-1.92 1.23-1.05 0-1.65-.81-1.65-1.98 0-2.31 2.1-2.73 4.08-2.73v.6c0 1.05.03 1.92-.5 2.88z"
  10758. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10759. d: "M21.69 19.2a17.62 17.62 0 0 1-21.6-1.57c-.23-.2 0-.5.28-.33a23.88 23.88 0 0 0 20.93 1.3c.45-.19.84.3.39.6z"
  10760. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10761. d: "M22.8 17.96c-.36-.45-2.22-.2-3.1-.12-.23.03-.3-.18-.05-.36 1.5-1.05 3.96-.75 4.26-.39.3.36-.1 2.82-1.5 4.02-.21.18-.42.1-.3-.15.3-.8 1.02-2.58.69-3z"
  10762. }));
  10763. const embedAnimotoIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10764. viewBox: "0 0 24 24"
  10765. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10766. d: "m.0206909 21 19.8160091-13.07806 3.5831 6.20826z",
  10767. fill: "#4bc7ee"
  10768. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10769. d: "m23.7254 19.0205-10.1074-17.18468c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418h22.5655c1.279 0 1.8019-.8905 1.1599-1.9795z",
  10770. fill: "#d4cdcb"
  10771. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10772. d: "m.0206909 21 15.2439091-16.38571 4.3029 7.32271z",
  10773. fill: "#c3d82e"
  10774. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10775. d: "m13.618 1.83582c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418 15.2646-16.38573z",
  10776. fill: "#e4ecb0"
  10777. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10778. d: "m.0206909 21 19.5468091-9.063 1.6621 2.8344z",
  10779. fill: "#209dbd"
  10780. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10781. d: "m.0206909 21 17.9209091-11.82623 1.6259 2.76323z",
  10782. fill: "#7cb3c9"
  10783. }));
  10784. const embedDailymotionIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10785. viewBox: "0 0 24 24"
  10786. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10787. d: "m12.1479 18.5957c-2.4949 0-4.28131-1.7558-4.28131-4.0658 0-2.2176 1.78641-4.0965 4.09651-4.0965 2.2793 0 4.0349 1.7864 4.0349 4.1581 0 2.2794-1.7556 4.0042-3.8501 4.0042zm8.3521-18.5957-4.5329 1v7c-1.1088-1.41691-2.8028-1.8787-4.8049-1.8787-2.09443 0-3.97329.76993-5.5133 2.27917-1.72483 1.66323-2.6489 3.78863-2.6489 6.16033 0 2.5873.98562 4.8049 2.89526 6.499 1.44763 1.2936 3.17251 1.9402 5.17454 1.9402 1.9713 0 3.4498-.5236 4.8973-1.9402v1.9402h4.5329c0-7.6359 0-15.3641 0-23z",
  10788. fill: "#333436"
  10789. }));
  10790. const embedPinterestIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10791. width: "24",
  10792. height: "24",
  10793. viewBox: "0 0 24 24",
  10794. version: "1.1"
  10795. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10796. d: "M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2"
  10797. }));
  10798. const embedWolframIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10799. viewBox: "0 0 44 44"
  10800. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10801. d: "M32.59521,22.001l4.31885-4.84473-6.34131-1.38379.646-6.459-5.94336,2.61035L22,6.31934l-3.27344,5.60351L12.78418,9.3125l.645,6.458L7.08643,17.15234,11.40479,21.999,7.08594,26.84375l6.34131,1.38379-.64551,6.458,5.94287-2.60938L22,37.68066l3.27344-5.60351,5.94287,2.61035-.64551-6.458,6.34277-1.38183Zm.44385,2.75244L30.772,23.97827l-1.59558-2.07391,1.97888.735Zm-8.82147,6.1579L22.75,33.424V30.88977l1.52228-2.22168ZM18.56226,13.48816,19.819,15.09534l-2.49219-.88642L15.94037,12.337Zm6.87719.00116,2.62043-1.15027-1.38654,1.86981L24.183,15.0946Zm3.59357,2.6029-1.22546,1.7381.07525-2.73486,1.44507-1.94867ZM22,29.33008l-2.16406-3.15686L22,23.23688l2.16406,2.93634Zm-4.25458-9.582-.10528-3.836,3.60986,1.284v3.73242Zm5.00458-2.552,3.60986-1.284-.10528,3.836L22.75,20.92853Zm-7.78174-1.10559-.29352-2.94263,1.44245,1.94739.07519,2.73321Zm2.30982,5.08319,3.50817,1.18164-2.16247,2.9342-3.678-1.08447Zm2.4486,7.49285L21.25,30.88977v2.53485L19.78052,30.91Zm3.48707-6.31121,3.50817-1.18164,2.33228,3.03137-3.678,1.08447Zm10.87219-4.28113-2.714,3.04529L28.16418,19.928l1.92176-2.72565ZM24.06036,12.81769l-2.06012,2.6322-2.059-2.63318L22,9.292ZM9.91455,18.07227l4.00079-.87195,1.921,2.72735-3.20794,1.19019Zm2.93024,4.565,1.9801-.73462L13.228,23.97827l-2.26838.77429Zm-1.55591,3.58819L13.701,25.4021l2.64935.78058-2.14447.67853Zm3.64868,1.977L18.19,27.17334l.08313,3.46332L14.52979,32.2793Zm10.7876,2.43549.08447-3.464,3.25165,1.03052.407,4.07684Zm4.06824-3.77478-2.14545-.68,2.65063-.781,2.41266.825Z"
  10802. }));
  10803. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-loading.js
  10804. /**
  10805. * WordPress dependencies
  10806. */
  10807. const EmbedLoading = () => (0,external_wp_element_namespaceObject.createElement)("div", {
  10808. className: "wp-block-embed is-loading"
  10809. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
  10810. /* harmony default export */ var embed_loading = (EmbedLoading);
  10811. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-placeholder.js
  10812. /**
  10813. * WordPress dependencies
  10814. */
  10815. const EmbedPlaceholder = _ref => {
  10816. let {
  10817. icon,
  10818. label,
  10819. value,
  10820. onSubmit,
  10821. onChange,
  10822. cannotEmbed,
  10823. fallback,
  10824. tryAgain
  10825. } = _ref;
  10826. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  10827. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  10828. icon: icon,
  10829. showColors: true
  10830. }),
  10831. label: label,
  10832. className: "wp-block-embed",
  10833. instructions: (0,external_wp_i18n_namespaceObject.__)('Paste a link to the content you want to display on your site.')
  10834. }, (0,external_wp_element_namespaceObject.createElement)("form", {
  10835. onSubmit: onSubmit
  10836. }, (0,external_wp_element_namespaceObject.createElement)("input", {
  10837. type: "url",
  10838. value: value || '',
  10839. className: "components-placeholder__input",
  10840. "aria-label": label,
  10841. placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter URL to embed here…'),
  10842. onChange: onChange
  10843. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  10844. variant: "primary",
  10845. type: "submit"
  10846. }, (0,external_wp_i18n_namespaceObject._x)('Embed', 'button label'))), (0,external_wp_element_namespaceObject.createElement)("div", {
  10847. className: "components-placeholder__learn-more"
  10848. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
  10849. href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/support/article/embeds/')
  10850. }, (0,external_wp_i18n_namespaceObject.__)('Learn more about embeds'))), cannotEmbed && (0,external_wp_element_namespaceObject.createElement)("div", {
  10851. className: "components-placeholder__error"
  10852. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  10853. className: "components-placeholder__instructions"
  10854. }, (0,external_wp_i18n_namespaceObject.__)('Sorry, this content could not be embedded.')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  10855. variant: "secondary",
  10856. onClick: tryAgain
  10857. }, (0,external_wp_i18n_namespaceObject._x)('Try again', 'button label')), ' ', (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  10858. variant: "secondary",
  10859. onClick: fallback
  10860. }, (0,external_wp_i18n_namespaceObject._x)('Convert to link', 'button label'))));
  10861. };
  10862. /* harmony default export */ var embed_placeholder = (EmbedPlaceholder);
  10863. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/wp-embed-preview.js
  10864. /**
  10865. * WordPress dependencies
  10866. */
  10867. /** @typedef {import('@wordpress/element').WPSyntheticEvent} WPSyntheticEvent */
  10868. const attributeMap = {
  10869. class: 'className',
  10870. frameborder: 'frameBorder',
  10871. marginheight: 'marginHeight',
  10872. marginwidth: 'marginWidth'
  10873. };
  10874. function WpEmbedPreview(_ref) {
  10875. let {
  10876. html
  10877. } = _ref;
  10878. const ref = (0,external_wp_element_namespaceObject.useRef)();
  10879. const props = (0,external_wp_element_namespaceObject.useMemo)(() => {
  10880. const doc = new window.DOMParser().parseFromString(html, 'text/html');
  10881. const iframe = doc.querySelector('iframe');
  10882. const iframeProps = {};
  10883. if (!iframe) return iframeProps;
  10884. Array.from(iframe.attributes).forEach(_ref2 => {
  10885. let {
  10886. name,
  10887. value
  10888. } = _ref2;
  10889. if (name === 'style') return;
  10890. iframeProps[attributeMap[name] || name] = value;
  10891. });
  10892. return iframeProps;
  10893. }, [html]);
  10894. (0,external_wp_element_namespaceObject.useEffect)(() => {
  10895. const {
  10896. ownerDocument
  10897. } = ref.current;
  10898. const {
  10899. defaultView
  10900. } = ownerDocument;
  10901. /**
  10902. * Checks for WordPress embed events signaling the height change when
  10903. * iframe content loads or iframe's window is resized. The event is
  10904. * sent from WordPress core via the window.postMessage API.
  10905. *
  10906. * References:
  10907. * window.postMessage:
  10908. * https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
  10909. * WordPress core embed-template on load:
  10910. * https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L143
  10911. * WordPress core embed-template on resize:
  10912. * https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L187
  10913. *
  10914. * @param {MessageEvent} event Message event.
  10915. */
  10916. function resizeWPembeds(_ref3) {
  10917. let {
  10918. data: {
  10919. secret,
  10920. message,
  10921. value
  10922. } = {}
  10923. } = _ref3;
  10924. if (message !== 'height' || secret !== props['data-secret']) {
  10925. return;
  10926. }
  10927. ref.current.height = value;
  10928. }
  10929. defaultView.addEventListener('message', resizeWPembeds);
  10930. return () => {
  10931. defaultView.removeEventListener('message', resizeWPembeds);
  10932. };
  10933. }, []);
  10934. return (0,external_wp_element_namespaceObject.createElement)("div", {
  10935. className: "wp-block-embed__wrapper"
  10936. }, (0,external_wp_element_namespaceObject.createElement)("iframe", _extends({
  10937. ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, (0,external_wp_compose_namespaceObject.useFocusableIframe)()]),
  10938. title: props.title
  10939. }, props)));
  10940. }
  10941. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-preview.js
  10942. /**
  10943. * Internal dependencies
  10944. */
  10945. /**
  10946. * External dependencies
  10947. */
  10948. /**
  10949. * WordPress dependencies
  10950. */
  10951. /**
  10952. * Internal dependencies
  10953. */
  10954. class EmbedPreview extends external_wp_element_namespaceObject.Component {
  10955. constructor() {
  10956. super(...arguments);
  10957. this.hideOverlay = this.hideOverlay.bind(this);
  10958. this.state = {
  10959. interactive: false
  10960. };
  10961. }
  10962. static getDerivedStateFromProps(nextProps, state) {
  10963. if (!nextProps.isSelected && state.interactive) {
  10964. // We only want to change this when the block is not selected, because changing it when
  10965. // the block becomes selected makes the overlap disappear too early. Hiding the overlay
  10966. // happens on mouseup when the overlay is clicked.
  10967. return {
  10968. interactive: false
  10969. };
  10970. }
  10971. return null;
  10972. }
  10973. hideOverlay() {
  10974. // This is called onMouseUp on the overlay. We can't respond to the `isSelected` prop
  10975. // changing, because that happens on mouse down, and the overlay immediately disappears,
  10976. // and the mouse event can end up in the preview content. We can't use onClick on
  10977. // the overlay to hide it either, because then the editor misses the mouseup event, and
  10978. // thinks we're multi-selecting blocks.
  10979. this.setState({
  10980. interactive: true
  10981. });
  10982. }
  10983. render() {
  10984. const {
  10985. preview,
  10986. previewable,
  10987. url,
  10988. type,
  10989. caption,
  10990. onCaptionChange,
  10991. isSelected,
  10992. className,
  10993. icon,
  10994. label,
  10995. insertBlocksAfter
  10996. } = this.props;
  10997. const {
  10998. scripts
  10999. } = preview;
  11000. const {
  11001. interactive
  11002. } = this.state;
  11003. const html = 'photo' === type ? getPhotoHtml(preview) : preview.html;
  11004. const parsedHost = new URL(url).host.split('.');
  11005. const parsedHostBaseUrl = parsedHost.splice(parsedHost.length - 2, parsedHost.length - 1).join('.');
  11006. const iframeTitle = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: host providing embed content e.g: www.youtube.com
  11007. (0,external_wp_i18n_namespaceObject.__)('Embedded content from %s'), parsedHostBaseUrl);
  11008. const sandboxClassnames = dedupe_default()(type, className, 'wp-block-embed__wrapper'); // Disabled because the overlay div doesn't actually have a role or functionality
  11009. // as far as the user is concerned. We're just catching the first click so that
  11010. // the block can be selected without interacting with the embed preview that the overlay covers.
  11011. /* eslint-disable jsx-a11y/no-static-element-interactions */
  11012. const embedWrapper = 'wp-embed' === type ? (0,external_wp_element_namespaceObject.createElement)(WpEmbedPreview, {
  11013. html: html
  11014. }) : (0,external_wp_element_namespaceObject.createElement)("div", {
  11015. className: "wp-block-embed__wrapper"
  11016. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SandBox, {
  11017. html: html,
  11018. scripts: scripts,
  11019. title: iframeTitle,
  11020. type: sandboxClassnames,
  11021. onFocus: this.hideOverlay
  11022. }), !interactive && (0,external_wp_element_namespaceObject.createElement)("div", {
  11023. className: "block-library-embed__interactive-overlay",
  11024. onMouseUp: this.hideOverlay
  11025. }));
  11026. /* eslint-enable jsx-a11y/no-static-element-interactions */
  11027. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  11028. className: dedupe_default()(className, 'wp-block-embed', {
  11029. 'is-type-video': 'video' === type
  11030. })
  11031. }, previewable ? embedWrapper : (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  11032. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  11033. icon: icon,
  11034. showColors: true
  11035. }),
  11036. label: label
  11037. }, (0,external_wp_element_namespaceObject.createElement)("p", {
  11038. className: "components-placeholder__error"
  11039. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  11040. href: url
  11041. }, url)), (0,external_wp_element_namespaceObject.createElement)("p", {
  11042. className: "components-placeholder__error"
  11043. }, (0,external_wp_i18n_namespaceObject.sprintf)(
  11044. /* translators: %s: host providing embed content e.g: www.youtube.com */
  11045. (0,external_wp_i18n_namespaceObject.__)("Embedded content from %s can't be previewed in the editor."), parsedHostBaseUrl))), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  11046. tagName: "figcaption",
  11047. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
  11048. value: caption,
  11049. onChange: onCaptionChange,
  11050. inlineToolbar: true,
  11051. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
  11052. }));
  11053. }
  11054. }
  11055. /* harmony default export */ var embed_preview = (EmbedPreview);
  11056. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/edit.js
  11057. /**
  11058. * Internal dependencies
  11059. */
  11060. /**
  11061. * External dependencies
  11062. */
  11063. /**
  11064. * WordPress dependencies
  11065. */
  11066. const EmbedEdit = props => {
  11067. const {
  11068. attributes: {
  11069. providerNameSlug,
  11070. previewable,
  11071. responsive,
  11072. url: attributesUrl
  11073. },
  11074. attributes,
  11075. isSelected,
  11076. onReplace,
  11077. setAttributes,
  11078. insertBlocksAfter,
  11079. onFocus
  11080. } = props;
  11081. const defaultEmbedInfo = {
  11082. title: (0,external_wp_i18n_namespaceObject._x)('Embed', 'block title'),
  11083. icon: embedContentIcon
  11084. };
  11085. const {
  11086. icon,
  11087. title
  11088. } = getEmbedInfoByProvider(providerNameSlug) || defaultEmbedInfo;
  11089. const [url, setURL] = (0,external_wp_element_namespaceObject.useState)(attributesUrl);
  11090. const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false);
  11091. const {
  11092. invalidateResolution
  11093. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  11094. const {
  11095. preview,
  11096. fetching,
  11097. themeSupportsResponsive,
  11098. cannotEmbed
  11099. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  11100. var _embedPreview$data;
  11101. const {
  11102. getEmbedPreview,
  11103. isPreviewEmbedFallback,
  11104. isRequestingEmbedPreview,
  11105. getThemeSupports
  11106. } = select(external_wp_coreData_namespaceObject.store);
  11107. if (!attributesUrl) {
  11108. return {
  11109. fetching: false,
  11110. cannotEmbed: false
  11111. };
  11112. }
  11113. const embedPreview = getEmbedPreview(attributesUrl);
  11114. const previewIsFallback = isPreviewEmbedFallback(attributesUrl); // The external oEmbed provider does not exist. We got no type info and no html.
  11115. const badEmbedProvider = (embedPreview === null || embedPreview === void 0 ? void 0 : embedPreview.html) === false && (embedPreview === null || embedPreview === void 0 ? void 0 : embedPreview.type) === undefined; // Some WordPress URLs that can't be embedded will cause the API to return
  11116. // a valid JSON response with no HTML and `data.status` set to 404, rather
  11117. // than generating a fallback response as other embeds do.
  11118. const wordpressCantEmbed = (embedPreview === null || embedPreview === void 0 ? void 0 : (_embedPreview$data = embedPreview.data) === null || _embedPreview$data === void 0 ? void 0 : _embedPreview$data.status) === 404;
  11119. const validPreview = !!embedPreview && !badEmbedProvider && !wordpressCantEmbed;
  11120. return {
  11121. preview: validPreview ? embedPreview : undefined,
  11122. fetching: isRequestingEmbedPreview(attributesUrl),
  11123. themeSupportsResponsive: getThemeSupports()['responsive-embeds'],
  11124. cannotEmbed: !validPreview || previewIsFallback
  11125. };
  11126. }, [attributesUrl]);
  11127. /**
  11128. * @return {Object} Attributes derived from the preview, merged with the current attributes.
  11129. */
  11130. const getMergedAttributes = () => {
  11131. const {
  11132. allowResponsive,
  11133. className
  11134. } = attributes;
  11135. return { ...attributes,
  11136. ...getAttributesFromPreview(preview, title, className, responsive, allowResponsive)
  11137. };
  11138. };
  11139. const toggleResponsive = () => {
  11140. const {
  11141. allowResponsive,
  11142. className
  11143. } = attributes;
  11144. const {
  11145. html
  11146. } = preview;
  11147. const newAllowResponsive = !allowResponsive;
  11148. setAttributes({
  11149. allowResponsive: newAllowResponsive,
  11150. className: getClassNames(html, className, responsive && newAllowResponsive)
  11151. });
  11152. };
  11153. (0,external_wp_element_namespaceObject.useEffect)(() => {
  11154. if (!(preview !== null && preview !== void 0 && preview.html) || !cannotEmbed || fetching) {
  11155. return;
  11156. } // At this stage, we're not fetching the preview and know it can't be embedded,
  11157. // so try removing any trailing slash, and resubmit.
  11158. const newURL = attributesUrl.replace(/\/$/, '');
  11159. setURL(newURL);
  11160. setIsEditingURL(false);
  11161. setAttributes({
  11162. url: newURL
  11163. });
  11164. }, [preview === null || preview === void 0 ? void 0 : preview.html, attributesUrl]); // Handle incoming preview.
  11165. (0,external_wp_element_namespaceObject.useEffect)(() => {
  11166. if (preview && !isEditingURL) {
  11167. // Even though we set attributes that get derived from the preview,
  11168. // we don't access them directly because for the initial render,
  11169. // the `setAttributes` call will not have taken effect. If we're
  11170. // rendering responsive content, setting the responsive classes
  11171. // after the preview has been rendered can result in unwanted
  11172. // clipping or scrollbars. The `getAttributesFromPreview` function
  11173. // that `getMergedAttributes` uses is memoized so that we're not
  11174. // calculating them on every render.
  11175. setAttributes(getMergedAttributes());
  11176. if (onReplace) {
  11177. const upgradedBlock = createUpgradedEmbedBlock(props, getMergedAttributes());
  11178. if (upgradedBlock) {
  11179. onReplace(upgradedBlock);
  11180. }
  11181. }
  11182. }
  11183. }, [preview, isEditingURL]);
  11184. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  11185. if (fetching) {
  11186. return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, (0,external_wp_element_namespaceObject.createElement)(embed_loading, null));
  11187. } // translators: %s: type of embed e.g: "YouTube", "Twitter", etc. "Embed" is used when no specific type exists
  11188. const label = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s URL'), title); // No preview, or we can't embed the current URL, or we've clicked the edit button.
  11189. const showEmbedPlaceholder = !preview || cannotEmbed || isEditingURL;
  11190. if (showEmbedPlaceholder) {
  11191. return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, (0,external_wp_element_namespaceObject.createElement)(embed_placeholder, {
  11192. icon: icon,
  11193. label: label,
  11194. onFocus: onFocus,
  11195. onSubmit: event => {
  11196. if (event) {
  11197. event.preventDefault();
  11198. }
  11199. setIsEditingURL(false);
  11200. setAttributes({
  11201. url
  11202. });
  11203. },
  11204. value: url,
  11205. cannotEmbed: cannotEmbed,
  11206. onChange: event => setURL(event.target.value),
  11207. fallback: () => fallback(url, onReplace),
  11208. tryAgain: () => {
  11209. invalidateResolution('getEmbedPreview', [url]);
  11210. }
  11211. }));
  11212. } // Even though we set attributes that get derived from the preview,
  11213. // we don't access them directly because for the initial render,
  11214. // the `setAttributes` call will not have taken effect. If we're
  11215. // rendering responsive content, setting the responsive classes
  11216. // after the preview has been rendered can result in unwanted
  11217. // clipping or scrollbars. The `getAttributesFromPreview` function
  11218. // that `getMergedAttributes` uses is memoized so that we're not
  11219. // calculating them on every render.
  11220. const {
  11221. caption,
  11222. type,
  11223. allowResponsive,
  11224. className: classFromPreview
  11225. } = getMergedAttributes();
  11226. const className = classnames_default()(classFromPreview, props.className);
  11227. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(embed_controls, {
  11228. showEditButton: preview && !cannotEmbed,
  11229. themeSupportsResponsive: themeSupportsResponsive,
  11230. blockSupportsResponsive: responsive,
  11231. allowResponsive: allowResponsive,
  11232. toggleResponsive: toggleResponsive,
  11233. switchBackToURLInput: () => setIsEditingURL(true)
  11234. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, (0,external_wp_element_namespaceObject.createElement)(embed_preview, {
  11235. preview: preview,
  11236. previewable: previewable,
  11237. className: className,
  11238. url: url,
  11239. type: type,
  11240. caption: caption,
  11241. onCaptionChange: value => setAttributes({
  11242. caption: value
  11243. }),
  11244. isSelected: isSelected,
  11245. icon: icon,
  11246. label: label,
  11247. insertBlocksAfter: insertBlocksAfter
  11248. })));
  11249. };
  11250. /* harmony default export */ var embed_edit = (EmbedEdit);
  11251. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/save.js
  11252. /**
  11253. * External dependencies
  11254. */
  11255. /**
  11256. * WordPress dependencies
  11257. */
  11258. function embed_save_save(_ref) {
  11259. let {
  11260. attributes
  11261. } = _ref;
  11262. const {
  11263. url,
  11264. caption,
  11265. type,
  11266. providerNameSlug
  11267. } = attributes;
  11268. if (!url) {
  11269. return null;
  11270. }
  11271. const className = dedupe_default()('wp-block-embed', {
  11272. [`is-type-${type}`]: type,
  11273. [`is-provider-${providerNameSlug}`]: providerNameSlug,
  11274. [`wp-block-embed-${providerNameSlug}`]: providerNameSlug
  11275. });
  11276. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  11277. className
  11278. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  11279. className: "wp-block-embed__wrapper"
  11280. }, `\n${url}\n`
  11281. /* URL needs to be on its own line. */
  11282. ), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  11283. tagName: "figcaption",
  11284. value: caption
  11285. }));
  11286. }
  11287. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/transforms.js
  11288. /**
  11289. * WordPress dependencies
  11290. */
  11291. /**
  11292. * Internal dependencies
  11293. */
  11294. const transforms_metadata = {
  11295. $schema: "https://schemas.wp.org/trunk/block.json",
  11296. apiVersion: 2,
  11297. name: "core/embed",
  11298. title: "Embed",
  11299. category: "embed",
  11300. description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.",
  11301. textdomain: "default",
  11302. attributes: {
  11303. url: {
  11304. type: "string"
  11305. },
  11306. caption: {
  11307. type: "string",
  11308. source: "html",
  11309. selector: "figcaption"
  11310. },
  11311. type: {
  11312. type: "string"
  11313. },
  11314. providerNameSlug: {
  11315. type: "string"
  11316. },
  11317. allowResponsive: {
  11318. type: "boolean",
  11319. "default": true
  11320. },
  11321. responsive: {
  11322. type: "boolean",
  11323. "default": false
  11324. },
  11325. previewable: {
  11326. type: "boolean",
  11327. "default": true
  11328. }
  11329. },
  11330. supports: {
  11331. align: true
  11332. },
  11333. editorStyle: "wp-block-embed-editor",
  11334. style: "wp-block-embed"
  11335. };
  11336. const {
  11337. name: EMBED_BLOCK
  11338. } = transforms_metadata;
  11339. /**
  11340. * Default transforms for generic embeds.
  11341. */
  11342. const embed_transforms_transforms = {
  11343. from: [{
  11344. type: 'raw',
  11345. isMatch: node => {
  11346. var _node$textContent, _node$textContent$mat;
  11347. return node.nodeName === 'P' && /^\s*(https?:\/\/\S+)\s*$/i.test(node.textContent) && ((_node$textContent = node.textContent) === null || _node$textContent === void 0 ? void 0 : (_node$textContent$mat = _node$textContent.match(/https/gi)) === null || _node$textContent$mat === void 0 ? void 0 : _node$textContent$mat.length) === 1;
  11348. },
  11349. transform: node => {
  11350. return (0,external_wp_blocks_namespaceObject.createBlock)(EMBED_BLOCK, {
  11351. url: node.textContent.trim()
  11352. });
  11353. }
  11354. }],
  11355. to: [{
  11356. type: 'block',
  11357. blocks: ['core/paragraph'],
  11358. isMatch: _ref => {
  11359. let {
  11360. url
  11361. } = _ref;
  11362. return !!url;
  11363. },
  11364. transform: _ref2 => {
  11365. let {
  11366. url,
  11367. caption
  11368. } = _ref2;
  11369. let value = `<a href="${url}">${url}</a>`;
  11370. if (caption !== null && caption !== void 0 && caption.trim()) {
  11371. value += `<br />${caption}`;
  11372. }
  11373. return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  11374. content: value
  11375. });
  11376. }
  11377. }]
  11378. };
  11379. /* harmony default export */ var embed_transforms = (embed_transforms_transforms);
  11380. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/variations.js
  11381. /**
  11382. * WordPress dependencies
  11383. */
  11384. /**
  11385. * Internal dependencies
  11386. */
  11387. /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
  11388. /**
  11389. * Template option choices for predefined columns layouts.
  11390. *
  11391. * @type {WPBlockVariation[]}
  11392. */
  11393. const variations_variations = [{
  11394. name: 'twitter',
  11395. title: 'Twitter',
  11396. icon: embedTwitterIcon,
  11397. keywords: ['tweet', (0,external_wp_i18n_namespaceObject.__)('social')],
  11398. description: (0,external_wp_i18n_namespaceObject.__)('Embed a tweet.'),
  11399. patterns: [/^https?:\/\/(www\.)?twitter\.com\/.+/i],
  11400. attributes: {
  11401. providerNameSlug: 'twitter',
  11402. responsive: true
  11403. }
  11404. }, {
  11405. name: 'youtube',
  11406. title: 'YouTube',
  11407. icon: embedYouTubeIcon,
  11408. keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('video')],
  11409. description: (0,external_wp_i18n_namespaceObject.__)('Embed a YouTube video.'),
  11410. patterns: [/^https?:\/\/((m|www)\.)?youtube\.com\/.+/i, /^https?:\/\/youtu\.be\/.+/i],
  11411. attributes: {
  11412. providerNameSlug: 'youtube',
  11413. responsive: true
  11414. }
  11415. }, {
  11416. // Deprecate Facebook Embed per FB policy
  11417. // See: https://developers.facebook.com/docs/plugins/oembed-legacy
  11418. name: 'facebook',
  11419. title: 'Facebook',
  11420. icon: embedFacebookIcon,
  11421. keywords: [(0,external_wp_i18n_namespaceObject.__)('social')],
  11422. description: (0,external_wp_i18n_namespaceObject.__)('Embed a Facebook post.'),
  11423. scope: ['block'],
  11424. patterns: [],
  11425. attributes: {
  11426. providerNameSlug: 'facebook',
  11427. previewable: false,
  11428. responsive: true
  11429. }
  11430. }, {
  11431. // Deprecate Instagram per FB policy
  11432. // See: https://developers.facebook.com/docs/instagram/oembed-legacy
  11433. name: 'instagram',
  11434. title: 'Instagram',
  11435. icon: embedInstagramIcon,
  11436. keywords: [(0,external_wp_i18n_namespaceObject.__)('image'), (0,external_wp_i18n_namespaceObject.__)('social')],
  11437. description: (0,external_wp_i18n_namespaceObject.__)('Embed an Instagram post.'),
  11438. scope: ['block'],
  11439. patterns: [],
  11440. attributes: {
  11441. providerNameSlug: 'instagram',
  11442. responsive: true
  11443. }
  11444. }, {
  11445. name: 'wordpress',
  11446. title: 'WordPress',
  11447. icon: embedWordPressIcon,
  11448. keywords: [(0,external_wp_i18n_namespaceObject.__)('post'), (0,external_wp_i18n_namespaceObject.__)('blog')],
  11449. description: (0,external_wp_i18n_namespaceObject.__)('Embed a WordPress post.'),
  11450. attributes: {
  11451. providerNameSlug: 'wordpress'
  11452. }
  11453. }, {
  11454. name: 'soundcloud',
  11455. title: 'SoundCloud',
  11456. icon: embedAudioIcon,
  11457. keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')],
  11458. description: (0,external_wp_i18n_namespaceObject.__)('Embed SoundCloud content.'),
  11459. patterns: [/^https?:\/\/(www\.)?soundcloud\.com\/.+/i],
  11460. attributes: {
  11461. providerNameSlug: 'soundcloud',
  11462. responsive: true
  11463. }
  11464. }, {
  11465. name: 'spotify',
  11466. title: 'Spotify',
  11467. icon: embedSpotifyIcon,
  11468. keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')],
  11469. description: (0,external_wp_i18n_namespaceObject.__)('Embed Spotify content.'),
  11470. patterns: [/^https?:\/\/(open|play)\.spotify\.com\/.+/i],
  11471. attributes: {
  11472. providerNameSlug: 'spotify',
  11473. responsive: true
  11474. }
  11475. }, {
  11476. name: 'flickr',
  11477. title: 'Flickr',
  11478. icon: embedFlickrIcon,
  11479. keywords: [(0,external_wp_i18n_namespaceObject.__)('image')],
  11480. description: (0,external_wp_i18n_namespaceObject.__)('Embed Flickr content.'),
  11481. patterns: [/^https?:\/\/(www\.)?flickr\.com\/.+/i, /^https?:\/\/flic\.kr\/.+/i],
  11482. attributes: {
  11483. providerNameSlug: 'flickr',
  11484. responsive: true
  11485. }
  11486. }, {
  11487. name: 'vimeo',
  11488. title: 'Vimeo',
  11489. icon: embedVimeoIcon,
  11490. keywords: [(0,external_wp_i18n_namespaceObject.__)('video')],
  11491. description: (0,external_wp_i18n_namespaceObject.__)('Embed a Vimeo video.'),
  11492. patterns: [/^https?:\/\/(www\.)?vimeo\.com\/.+/i],
  11493. attributes: {
  11494. providerNameSlug: 'vimeo',
  11495. responsive: true
  11496. }
  11497. }, {
  11498. name: 'animoto',
  11499. title: 'Animoto',
  11500. icon: embedAnimotoIcon,
  11501. description: (0,external_wp_i18n_namespaceObject.__)('Embed an Animoto video.'),
  11502. patterns: [/^https?:\/\/(www\.)?(animoto|video214)\.com\/.+/i],
  11503. attributes: {
  11504. providerNameSlug: 'animoto',
  11505. responsive: true
  11506. }
  11507. }, {
  11508. name: 'cloudup',
  11509. title: 'Cloudup',
  11510. icon: embedContentIcon,
  11511. description: (0,external_wp_i18n_namespaceObject.__)('Embed Cloudup content.'),
  11512. patterns: [/^https?:\/\/cloudup\.com\/.+/i],
  11513. attributes: {
  11514. providerNameSlug: 'cloudup',
  11515. responsive: true
  11516. }
  11517. }, {
  11518. // Deprecated since CollegeHumor content is now powered by YouTube.
  11519. name: 'collegehumor',
  11520. title: 'CollegeHumor',
  11521. icon: embedVideoIcon,
  11522. description: (0,external_wp_i18n_namespaceObject.__)('Embed CollegeHumor content.'),
  11523. scope: ['block'],
  11524. patterns: [],
  11525. attributes: {
  11526. providerNameSlug: 'collegehumor',
  11527. responsive: true
  11528. }
  11529. }, {
  11530. name: 'crowdsignal',
  11531. title: 'Crowdsignal',
  11532. icon: embedContentIcon,
  11533. keywords: ['polldaddy', (0,external_wp_i18n_namespaceObject.__)('survey')],
  11534. description: (0,external_wp_i18n_namespaceObject.__)('Embed Crowdsignal (formerly Polldaddy) content.'),
  11535. patterns: [/^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.survey\.fm)\/.+/i],
  11536. attributes: {
  11537. providerNameSlug: 'crowdsignal',
  11538. responsive: true
  11539. }
  11540. }, {
  11541. name: 'dailymotion',
  11542. title: 'Dailymotion',
  11543. icon: embedDailymotionIcon,
  11544. keywords: [(0,external_wp_i18n_namespaceObject.__)('video')],
  11545. description: (0,external_wp_i18n_namespaceObject.__)('Embed a Dailymotion video.'),
  11546. patterns: [/^https?:\/\/(www\.)?dailymotion\.com\/.+/i],
  11547. attributes: {
  11548. providerNameSlug: 'dailymotion',
  11549. responsive: true
  11550. }
  11551. }, {
  11552. name: 'imgur',
  11553. title: 'Imgur',
  11554. icon: embedPhotoIcon,
  11555. description: (0,external_wp_i18n_namespaceObject.__)('Embed Imgur content.'),
  11556. patterns: [/^https?:\/\/(.+\.)?imgur\.com\/.+/i],
  11557. attributes: {
  11558. providerNameSlug: 'imgur',
  11559. responsive: true
  11560. }
  11561. }, {
  11562. name: 'issuu',
  11563. title: 'Issuu',
  11564. icon: embedContentIcon,
  11565. description: (0,external_wp_i18n_namespaceObject.__)('Embed Issuu content.'),
  11566. patterns: [/^https?:\/\/(www\.)?issuu\.com\/.+/i],
  11567. attributes: {
  11568. providerNameSlug: 'issuu',
  11569. responsive: true
  11570. }
  11571. }, {
  11572. name: 'kickstarter',
  11573. title: 'Kickstarter',
  11574. icon: embedContentIcon,
  11575. description: (0,external_wp_i18n_namespaceObject.__)('Embed Kickstarter content.'),
  11576. patterns: [/^https?:\/\/(www\.)?kickstarter\.com\/.+/i, /^https?:\/\/kck\.st\/.+/i],
  11577. attributes: {
  11578. providerNameSlug: 'kickstarter',
  11579. responsive: true
  11580. }
  11581. }, {
  11582. name: 'mixcloud',
  11583. title: 'Mixcloud',
  11584. icon: embedAudioIcon,
  11585. keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')],
  11586. description: (0,external_wp_i18n_namespaceObject.__)('Embed Mixcloud content.'),
  11587. patterns: [/^https?:\/\/(www\.)?mixcloud\.com\/.+/i],
  11588. attributes: {
  11589. providerNameSlug: 'mixcloud',
  11590. responsive: true
  11591. }
  11592. }, {
  11593. name: 'reddit',
  11594. title: 'Reddit',
  11595. icon: embedRedditIcon,
  11596. description: (0,external_wp_i18n_namespaceObject.__)('Embed a Reddit thread.'),
  11597. patterns: [/^https?:\/\/(www\.)?reddit\.com\/.+/i],
  11598. attributes: {
  11599. providerNameSlug: 'reddit',
  11600. responsive: true
  11601. }
  11602. }, {
  11603. name: 'reverbnation',
  11604. title: 'ReverbNation',
  11605. icon: embedAudioIcon,
  11606. description: (0,external_wp_i18n_namespaceObject.__)('Embed ReverbNation content.'),
  11607. patterns: [/^https?:\/\/(www\.)?reverbnation\.com\/.+/i],
  11608. attributes: {
  11609. providerNameSlug: 'reverbnation',
  11610. responsive: true
  11611. }
  11612. }, {
  11613. name: 'screencast',
  11614. title: 'Screencast',
  11615. icon: embedVideoIcon,
  11616. description: (0,external_wp_i18n_namespaceObject.__)('Embed Screencast content.'),
  11617. patterns: [/^https?:\/\/(www\.)?screencast\.com\/.+/i],
  11618. attributes: {
  11619. providerNameSlug: 'screencast',
  11620. responsive: true
  11621. }
  11622. }, {
  11623. name: 'scribd',
  11624. title: 'Scribd',
  11625. icon: embedContentIcon,
  11626. description: (0,external_wp_i18n_namespaceObject.__)('Embed Scribd content.'),
  11627. patterns: [/^https?:\/\/(www\.)?scribd\.com\/.+/i],
  11628. attributes: {
  11629. providerNameSlug: 'scribd',
  11630. responsive: true
  11631. }
  11632. }, {
  11633. name: 'slideshare',
  11634. title: 'Slideshare',
  11635. icon: embedContentIcon,
  11636. description: (0,external_wp_i18n_namespaceObject.__)('Embed Slideshare content.'),
  11637. patterns: [/^https?:\/\/(.+?\.)?slideshare\.net\/.+/i],
  11638. attributes: {
  11639. providerNameSlug: 'slideshare',
  11640. responsive: true
  11641. }
  11642. }, {
  11643. name: 'smugmug',
  11644. title: 'SmugMug',
  11645. icon: embedPhotoIcon,
  11646. description: (0,external_wp_i18n_namespaceObject.__)('Embed SmugMug content.'),
  11647. patterns: [/^https?:\/\/(.+\.)?smugmug\.com\/.*/i],
  11648. attributes: {
  11649. providerNameSlug: 'smugmug',
  11650. previewable: false,
  11651. responsive: true
  11652. }
  11653. }, {
  11654. name: 'speaker-deck',
  11655. title: 'Speaker Deck',
  11656. icon: embedContentIcon,
  11657. description: (0,external_wp_i18n_namespaceObject.__)('Embed Speaker Deck content.'),
  11658. patterns: [/^https?:\/\/(www\.)?speakerdeck\.com\/.+/i],
  11659. attributes: {
  11660. providerNameSlug: 'speaker-deck',
  11661. responsive: true
  11662. }
  11663. }, {
  11664. name: 'tiktok',
  11665. title: 'TikTok',
  11666. icon: embedVideoIcon,
  11667. keywords: [(0,external_wp_i18n_namespaceObject.__)('video')],
  11668. description: (0,external_wp_i18n_namespaceObject.__)('Embed a TikTok video.'),
  11669. patterns: [/^https?:\/\/(www\.)?tiktok\.com\/.+/i],
  11670. attributes: {
  11671. providerNameSlug: 'tiktok',
  11672. responsive: true
  11673. }
  11674. }, {
  11675. name: 'ted',
  11676. title: 'TED',
  11677. icon: embedVideoIcon,
  11678. description: (0,external_wp_i18n_namespaceObject.__)('Embed a TED video.'),
  11679. patterns: [/^https?:\/\/(www\.|embed\.)?ted\.com\/.+/i],
  11680. attributes: {
  11681. providerNameSlug: 'ted',
  11682. responsive: true
  11683. }
  11684. }, {
  11685. name: 'tumblr',
  11686. title: 'Tumblr',
  11687. icon: embedTumblrIcon,
  11688. keywords: [(0,external_wp_i18n_namespaceObject.__)('social')],
  11689. description: (0,external_wp_i18n_namespaceObject.__)('Embed a Tumblr post.'),
  11690. patterns: [/^https?:\/\/(www\.)?tumblr\.com\/.+/i],
  11691. attributes: {
  11692. providerNameSlug: 'tumblr',
  11693. responsive: true
  11694. }
  11695. }, {
  11696. name: 'videopress',
  11697. title: 'VideoPress',
  11698. icon: embedVideoIcon,
  11699. keywords: [(0,external_wp_i18n_namespaceObject.__)('video')],
  11700. description: (0,external_wp_i18n_namespaceObject.__)('Embed a VideoPress video.'),
  11701. patterns: [/^https?:\/\/videopress\.com\/.+/i],
  11702. attributes: {
  11703. providerNameSlug: 'videopress',
  11704. responsive: true
  11705. }
  11706. }, {
  11707. name: 'wordpress-tv',
  11708. title: 'WordPress.tv',
  11709. icon: embedVideoIcon,
  11710. description: (0,external_wp_i18n_namespaceObject.__)('Embed a WordPress.tv video.'),
  11711. patterns: [/^https?:\/\/wordpress\.tv\/.+/i],
  11712. attributes: {
  11713. providerNameSlug: 'wordpress-tv',
  11714. responsive: true
  11715. }
  11716. }, {
  11717. name: 'amazon-kindle',
  11718. title: 'Amazon Kindle',
  11719. icon: embedAmazonIcon,
  11720. keywords: [(0,external_wp_i18n_namespaceObject.__)('ebook')],
  11721. description: (0,external_wp_i18n_namespaceObject.__)('Embed Amazon Kindle content.'),
  11722. patterns: [/^https?:\/\/([a-z0-9-]+\.)?(amazon|amzn)(\.[a-z]{2,4})+\/.+/i, /^https?:\/\/(www\.)?(a\.co|z\.cn)\/.+/i],
  11723. attributes: {
  11724. providerNameSlug: 'amazon-kindle'
  11725. }
  11726. }, {
  11727. name: 'pinterest',
  11728. title: 'Pinterest',
  11729. icon: embedPinterestIcon,
  11730. keywords: [(0,external_wp_i18n_namespaceObject.__)('social'), (0,external_wp_i18n_namespaceObject.__)('bookmark')],
  11731. description: (0,external_wp_i18n_namespaceObject.__)('Embed Pinterest pins, boards, and profiles.'),
  11732. patterns: [/^https?:\/\/([a-z]{2}|www)\.pinterest\.com(\.(au|mx))?\/.*/i],
  11733. attributes: {
  11734. providerNameSlug: 'pinterest'
  11735. }
  11736. }, {
  11737. name: 'wolfram-cloud',
  11738. title: 'Wolfram',
  11739. icon: embedWolframIcon,
  11740. description: (0,external_wp_i18n_namespaceObject.__)('Embed Wolfram notebook content.'),
  11741. patterns: [/^https?:\/\/(www\.)?wolframcloud\.com\/obj\/.+/i],
  11742. attributes: {
  11743. providerNameSlug: 'wolfram-cloud',
  11744. responsive: true
  11745. }
  11746. }];
  11747. /**
  11748. * Add `isActive` function to all `embed` variations, if not defined.
  11749. * `isActive` function is used to find a variation match from a created
  11750. * Block by providing its attributes.
  11751. */
  11752. variations_variations.forEach(variation => {
  11753. if (variation.isActive) return;
  11754. variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.providerNameSlug === variationAttributes.providerNameSlug;
  11755. });
  11756. /* harmony default export */ var embed_variations = (variations_variations);
  11757. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/deprecated.js
  11758. /**
  11759. * External dependencies
  11760. */
  11761. /**
  11762. * Internal dependencies
  11763. */
  11764. const embed_deprecated_metadata = {
  11765. $schema: "https://schemas.wp.org/trunk/block.json",
  11766. apiVersion: 2,
  11767. name: "core/embed",
  11768. title: "Embed",
  11769. category: "embed",
  11770. description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.",
  11771. textdomain: "default",
  11772. attributes: {
  11773. url: {
  11774. type: "string"
  11775. },
  11776. caption: {
  11777. type: "string",
  11778. source: "html",
  11779. selector: "figcaption"
  11780. },
  11781. type: {
  11782. type: "string"
  11783. },
  11784. providerNameSlug: {
  11785. type: "string"
  11786. },
  11787. allowResponsive: {
  11788. type: "boolean",
  11789. "default": true
  11790. },
  11791. responsive: {
  11792. type: "boolean",
  11793. "default": false
  11794. },
  11795. previewable: {
  11796. type: "boolean",
  11797. "default": true
  11798. }
  11799. },
  11800. supports: {
  11801. align: true
  11802. },
  11803. editorStyle: "wp-block-embed-editor",
  11804. style: "wp-block-embed"
  11805. };
  11806. /**
  11807. * WordPress dependencies
  11808. */
  11809. const {
  11810. attributes: embed_deprecated_blockAttributes
  11811. } = embed_deprecated_metadata;
  11812. const embed_deprecated_deprecated = [{
  11813. attributes: embed_deprecated_blockAttributes,
  11814. save(_ref) {
  11815. let {
  11816. attributes: {
  11817. url,
  11818. caption,
  11819. type,
  11820. providerNameSlug
  11821. }
  11822. } = _ref;
  11823. if (!url) {
  11824. return null;
  11825. }
  11826. const embedClassName = classnames_default()('wp-block-embed', {
  11827. [`is-type-${type}`]: type,
  11828. [`is-provider-${providerNameSlug}`]: providerNameSlug
  11829. });
  11830. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  11831. className: embedClassName
  11832. }, `\n${url}\n`
  11833. /* URL needs to be on its own line. */
  11834. , !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  11835. tagName: "figcaption",
  11836. value: caption
  11837. }));
  11838. }
  11839. }];
  11840. /* harmony default export */ var embed_deprecated = (embed_deprecated_deprecated);
  11841. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/index.js
  11842. /**
  11843. * Internal dependencies
  11844. */
  11845. const embed_metadata = {
  11846. $schema: "https://schemas.wp.org/trunk/block.json",
  11847. apiVersion: 2,
  11848. name: "core/embed",
  11849. title: "Embed",
  11850. category: "embed",
  11851. description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.",
  11852. textdomain: "default",
  11853. attributes: {
  11854. url: {
  11855. type: "string"
  11856. },
  11857. caption: {
  11858. type: "string",
  11859. source: "html",
  11860. selector: "figcaption"
  11861. },
  11862. type: {
  11863. type: "string"
  11864. },
  11865. providerNameSlug: {
  11866. type: "string"
  11867. },
  11868. allowResponsive: {
  11869. type: "boolean",
  11870. "default": true
  11871. },
  11872. responsive: {
  11873. type: "boolean",
  11874. "default": false
  11875. },
  11876. previewable: {
  11877. type: "boolean",
  11878. "default": true
  11879. }
  11880. },
  11881. supports: {
  11882. align: true
  11883. },
  11884. editorStyle: "wp-block-embed-editor",
  11885. style: "wp-block-embed"
  11886. };
  11887. const {
  11888. name: embed_name
  11889. } = embed_metadata;
  11890. const embed_settings = {
  11891. icon: embedContentIcon,
  11892. edit: embed_edit,
  11893. save: embed_save_save,
  11894. transforms: embed_transforms,
  11895. variations: embed_variations,
  11896. deprecated: embed_deprecated
  11897. };
  11898. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/file.js
  11899. /**
  11900. * WordPress dependencies
  11901. */
  11902. const file = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  11903. viewBox: "0 0 24 24",
  11904. xmlns: "http://www.w3.org/2000/svg"
  11905. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  11906. d: "M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5z"
  11907. }));
  11908. /* harmony default export */ var library_file = (file);
  11909. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/deprecated.js
  11910. /**
  11911. * WordPress dependencies
  11912. */
  11913. // Version of the file block without PR#28062 accessibility fix.
  11914. const file_deprecated_deprecated = [{
  11915. attributes: {
  11916. id: {
  11917. type: 'number'
  11918. },
  11919. href: {
  11920. type: 'string'
  11921. },
  11922. fileName: {
  11923. type: 'string',
  11924. source: 'html',
  11925. selector: 'a:not([download])'
  11926. },
  11927. textLinkHref: {
  11928. type: 'string',
  11929. source: 'attribute',
  11930. selector: 'a:not([download])',
  11931. attribute: 'href'
  11932. },
  11933. textLinkTarget: {
  11934. type: 'string',
  11935. source: 'attribute',
  11936. selector: 'a:not([download])',
  11937. attribute: 'target'
  11938. },
  11939. showDownloadButton: {
  11940. type: 'boolean',
  11941. default: true
  11942. },
  11943. downloadButtonText: {
  11944. type: 'string',
  11945. source: 'html',
  11946. selector: 'a[download]'
  11947. },
  11948. displayPreview: {
  11949. type: 'boolean'
  11950. },
  11951. previewHeight: {
  11952. type: 'number',
  11953. default: 600
  11954. }
  11955. },
  11956. supports: {
  11957. anchor: true,
  11958. align: true
  11959. },
  11960. save(_ref) {
  11961. let {
  11962. attributes
  11963. } = _ref;
  11964. const {
  11965. href,
  11966. fileName,
  11967. textLinkHref,
  11968. textLinkTarget,
  11969. showDownloadButton,
  11970. downloadButtonText,
  11971. displayPreview,
  11972. previewHeight
  11973. } = attributes;
  11974. const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)(
  11975. /* translators: %s: filename. */
  11976. (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName);
  11977. return href && (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), displayPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("object", {
  11978. className: "wp-block-file__embed",
  11979. data: href,
  11980. type: "application/pdf",
  11981. style: {
  11982. width: '100%',
  11983. height: `${previewHeight}px`
  11984. },
  11985. "aria-label": pdfEmbedLabel
  11986. })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) && (0,external_wp_element_namespaceObject.createElement)("a", {
  11987. href: textLinkHref,
  11988. target: textLinkTarget,
  11989. rel: textLinkTarget ? 'noreferrer noopener' : undefined
  11990. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  11991. value: fileName
  11992. })), showDownloadButton && (0,external_wp_element_namespaceObject.createElement)("a", {
  11993. href: href,
  11994. className: "wp-block-file__button",
  11995. download: true
  11996. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  11997. value: downloadButtonText
  11998. })));
  11999. }
  12000. }];
  12001. /* harmony default export */ var file_deprecated = (file_deprecated_deprecated);
  12002. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/inspector.js
  12003. /**
  12004. * WordPress dependencies
  12005. */
  12006. /**
  12007. * Internal dependencies
  12008. */
  12009. function FileBlockInspector(_ref) {
  12010. let {
  12011. hrefs,
  12012. openInNewWindow,
  12013. showDownloadButton,
  12014. changeLinkDestinationOption,
  12015. changeOpenInNewWindow,
  12016. changeShowDownloadButton,
  12017. displayPreview,
  12018. changeDisplayPreview,
  12019. previewHeight,
  12020. changePreviewHeight
  12021. } = _ref;
  12022. const {
  12023. href,
  12024. textLinkHref,
  12025. attachmentPage
  12026. } = hrefs;
  12027. let linkDestinationOptions = [{
  12028. value: href,
  12029. label: (0,external_wp_i18n_namespaceObject.__)('URL')
  12030. }];
  12031. if (attachmentPage) {
  12032. linkDestinationOptions = [{
  12033. value: href,
  12034. label: (0,external_wp_i18n_namespaceObject.__)('Media file')
  12035. }, {
  12036. value: attachmentPage,
  12037. label: (0,external_wp_i18n_namespaceObject.__)('Attachment page')
  12038. }];
  12039. }
  12040. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, href.endsWith('.pdf') && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  12041. title: (0,external_wp_i18n_namespaceObject.__)('PDF settings')
  12042. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  12043. label: (0,external_wp_i18n_namespaceObject.__)('Show inline embed'),
  12044. help: displayPreview ? (0,external_wp_i18n_namespaceObject.__)("Note: Most phone and tablet browsers won't display embedded PDFs.") : null,
  12045. checked: !!displayPreview,
  12046. onChange: changeDisplayPreview
  12047. }), displayPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  12048. label: (0,external_wp_i18n_namespaceObject.__)('Height in pixels'),
  12049. min: MIN_PREVIEW_HEIGHT,
  12050. max: Math.max(MAX_PREVIEW_HEIGHT, previewHeight),
  12051. value: previewHeight,
  12052. onChange: changePreviewHeight
  12053. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  12054. title: (0,external_wp_i18n_namespaceObject.__)('Text link settings')
  12055. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  12056. label: (0,external_wp_i18n_namespaceObject.__)('Link to'),
  12057. value: textLinkHref,
  12058. options: linkDestinationOptions,
  12059. onChange: changeLinkDestinationOption
  12060. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  12061. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  12062. checked: openInNewWindow,
  12063. onChange: changeOpenInNewWindow
  12064. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  12065. title: (0,external_wp_i18n_namespaceObject.__)('Download button settings')
  12066. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  12067. label: (0,external_wp_i18n_namespaceObject.__)('Show download button'),
  12068. checked: showDownloadButton,
  12069. onChange: changeShowDownloadButton
  12070. }))));
  12071. }
  12072. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/utils.js
  12073. /**
  12074. * Uses a combination of user agent matching and feature detection to determine whether
  12075. * the current browser supports rendering PDFs inline.
  12076. *
  12077. * @return {boolean} Whether or not the browser supports inline PDFs.
  12078. */
  12079. const browserSupportsPdfs = () => {
  12080. // Most mobile devices include "Mobi" in their UA.
  12081. if (window.navigator.userAgent.indexOf('Mobi') > -1) {
  12082. return false;
  12083. } // Android tablets are the noteable exception.
  12084. if (window.navigator.userAgent.indexOf('Android') > -1) {
  12085. return false;
  12086. } // iPad pretends to be a Mac.
  12087. if (window.navigator.userAgent.indexOf('Macintosh') > -1 && window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2) {
  12088. return false;
  12089. } // IE only supports PDFs when there's an ActiveX object available for it.
  12090. if (!!(window.ActiveXObject || 'ActiveXObject' in window) && !(createActiveXObject('AcroPDF.PDF') || createActiveXObject('PDF.PdfCtrl'))) {
  12091. return false;
  12092. }
  12093. return true;
  12094. };
  12095. /**
  12096. * Helper function for creating ActiveX objects, catching any errors that are thrown
  12097. * when it's generated.
  12098. *
  12099. * @param {string} type The name of the ActiveX object to create.
  12100. * @return {window.ActiveXObject|undefined} The generated ActiveXObject, or null if it failed.
  12101. */
  12102. const createActiveXObject = type => {
  12103. let ax;
  12104. try {
  12105. ax = new window.ActiveXObject(type);
  12106. } catch (e) {
  12107. ax = undefined;
  12108. }
  12109. return ax;
  12110. };
  12111. /**
  12112. * Hides all .wp-block-file__embed elements on the document. This function is only intended
  12113. * to be run on the front-end, it may have weird side effects running in the block editor.
  12114. */
  12115. const hidePdfEmbedsOnUnsupportedBrowsers = () => {
  12116. if (!browserSupportsPdfs()) {
  12117. const embeds = document.getElementsByClassName('wp-block-file__embed');
  12118. Array.from(embeds).forEach(embed => {
  12119. embed.style.display = 'none';
  12120. });
  12121. }
  12122. };
  12123. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/edit.js
  12124. /**
  12125. * External dependencies
  12126. */
  12127. /**
  12128. * WordPress dependencies
  12129. */
  12130. /**
  12131. * Internal dependencies
  12132. */
  12133. const MIN_PREVIEW_HEIGHT = 200;
  12134. const MAX_PREVIEW_HEIGHT = 2000;
  12135. function ClipboardToolbarButton(_ref) {
  12136. let {
  12137. text,
  12138. disabled
  12139. } = _ref;
  12140. const {
  12141. createNotice
  12142. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  12143. const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text, () => {
  12144. createNotice('info', (0,external_wp_i18n_namespaceObject.__)('Copied URL to clipboard.'), {
  12145. isDismissible: true,
  12146. type: 'snackbar'
  12147. });
  12148. });
  12149. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  12150. className: "components-clipboard-toolbar-button",
  12151. ref: ref,
  12152. disabled: disabled
  12153. }, (0,external_wp_i18n_namespaceObject.__)('Copy URL'));
  12154. }
  12155. function FileEdit(_ref2) {
  12156. let {
  12157. attributes,
  12158. isSelected,
  12159. setAttributes,
  12160. noticeUI,
  12161. noticeOperations,
  12162. clientId
  12163. } = _ref2;
  12164. const {
  12165. id,
  12166. fileId,
  12167. fileName,
  12168. href,
  12169. textLinkHref,
  12170. textLinkTarget,
  12171. showDownloadButton,
  12172. downloadButtonText,
  12173. displayPreview,
  12174. previewHeight
  12175. } = attributes;
  12176. const {
  12177. media,
  12178. mediaUpload
  12179. } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
  12180. media: id === undefined ? undefined : select(external_wp_coreData_namespaceObject.store).getMedia(id),
  12181. mediaUpload: select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload
  12182. }), [id]);
  12183. const {
  12184. toggleSelection,
  12185. __unstableMarkNextChangeAsNotPersistent
  12186. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  12187. (0,external_wp_element_namespaceObject.useEffect)(() => {
  12188. // Upload a file drag-and-dropped into the editor.
  12189. if ((0,external_wp_blob_namespaceObject.isBlobURL)(href)) {
  12190. const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(href);
  12191. mediaUpload({
  12192. filesList: [file],
  12193. onFileChange: _ref3 => {
  12194. let [newMedia] = _ref3;
  12195. return onSelectFile(newMedia);
  12196. },
  12197. onError: onUploadError
  12198. });
  12199. (0,external_wp_blob_namespaceObject.revokeBlobURL)(href);
  12200. }
  12201. if (downloadButtonText === undefined) {
  12202. changeDownloadButtonText((0,external_wp_i18n_namespaceObject._x)('Download', 'button label'));
  12203. }
  12204. }, []);
  12205. (0,external_wp_element_namespaceObject.useEffect)(() => {
  12206. if (!fileId && href) {
  12207. // Add a unique fileId to each file block.
  12208. __unstableMarkNextChangeAsNotPersistent();
  12209. setAttributes({
  12210. fileId: `wp-block-file--media-${clientId}`
  12211. });
  12212. }
  12213. }, [href, fileId, clientId]);
  12214. function onSelectFile(newMedia) {
  12215. if (newMedia && newMedia.url) {
  12216. const isPdf = newMedia.url.endsWith('.pdf');
  12217. setAttributes({
  12218. href: newMedia.url,
  12219. fileName: newMedia.title,
  12220. textLinkHref: newMedia.url,
  12221. id: newMedia.id,
  12222. displayPreview: isPdf ? true : undefined,
  12223. previewHeight: isPdf ? 600 : undefined
  12224. });
  12225. }
  12226. }
  12227. function onUploadError(message) {
  12228. setAttributes({
  12229. href: undefined
  12230. });
  12231. noticeOperations.removeAllNotices();
  12232. noticeOperations.createErrorNotice(message);
  12233. }
  12234. function changeLinkDestinationOption(newHref) {
  12235. // Choose Media File or Attachment Page (when file is in Media Library).
  12236. setAttributes({
  12237. textLinkHref: newHref
  12238. });
  12239. }
  12240. function changeOpenInNewWindow(newValue) {
  12241. setAttributes({
  12242. textLinkTarget: newValue ? '_blank' : false
  12243. });
  12244. }
  12245. function changeShowDownloadButton(newValue) {
  12246. setAttributes({
  12247. showDownloadButton: newValue
  12248. });
  12249. }
  12250. function changeDownloadButtonText(newValue) {
  12251. // Remove anchor tags from button text content.
  12252. setAttributes({
  12253. downloadButtonText: newValue.replace(/<\/?a[^>]*>/g, '')
  12254. });
  12255. }
  12256. function changeDisplayPreview(newValue) {
  12257. setAttributes({
  12258. displayPreview: newValue
  12259. });
  12260. }
  12261. function handleOnResizeStop(event, direction, elt, delta) {
  12262. toggleSelection(true);
  12263. const newHeight = parseInt(previewHeight + delta.height, 10);
  12264. setAttributes({
  12265. previewHeight: newHeight
  12266. });
  12267. }
  12268. function changePreviewHeight(newValue) {
  12269. const newHeight = Math.max(parseInt(newValue, 10), MIN_PREVIEW_HEIGHT);
  12270. setAttributes({
  12271. previewHeight: newHeight
  12272. });
  12273. }
  12274. const attachmentPage = media && media.link;
  12275. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  12276. className: classnames_default()((0,external_wp_blob_namespaceObject.isBlobURL)(href) && (0,external_wp_components_namespaceObject.__unstableGetAnimateClassName)({
  12277. type: 'loading'
  12278. }), {
  12279. 'is-transient': (0,external_wp_blob_namespaceObject.isBlobURL)(href)
  12280. })
  12281. });
  12282. const displayPreviewInEditor = browserSupportsPdfs() && displayPreview;
  12283. if (!href) {
  12284. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  12285. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  12286. icon: library_file
  12287. }),
  12288. labels: {
  12289. title: (0,external_wp_i18n_namespaceObject.__)('File'),
  12290. instructions: (0,external_wp_i18n_namespaceObject.__)('Upload a file or pick one from your media library.')
  12291. },
  12292. onSelect: onSelectFile,
  12293. notices: noticeUI,
  12294. onError: onUploadError,
  12295. accept: "*"
  12296. }));
  12297. }
  12298. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(FileBlockInspector, {
  12299. hrefs: {
  12300. href,
  12301. textLinkHref,
  12302. attachmentPage
  12303. },
  12304. openInNewWindow: !!textLinkTarget,
  12305. showDownloadButton,
  12306. changeLinkDestinationOption,
  12307. changeOpenInNewWindow,
  12308. changeShowDownloadButton,
  12309. displayPreview,
  12310. changeDisplayPreview,
  12311. previewHeight,
  12312. changePreviewHeight
  12313. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  12314. group: "other"
  12315. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  12316. mediaId: id,
  12317. mediaURL: href,
  12318. accept: "*",
  12319. onSelect: onSelectFile,
  12320. onError: onUploadError
  12321. }), (0,external_wp_element_namespaceObject.createElement)(ClipboardToolbarButton, {
  12322. text: href,
  12323. disabled: (0,external_wp_blob_namespaceObject.isBlobURL)(href)
  12324. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, displayPreviewInEditor && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
  12325. size: {
  12326. height: previewHeight
  12327. },
  12328. minHeight: MIN_PREVIEW_HEIGHT,
  12329. maxHeight: MAX_PREVIEW_HEIGHT,
  12330. minWidth: "100%",
  12331. grid: [10, 10],
  12332. enable: {
  12333. top: false,
  12334. right: false,
  12335. bottom: true,
  12336. left: false,
  12337. topRight: false,
  12338. bottomRight: false,
  12339. bottomLeft: false,
  12340. topLeft: false
  12341. },
  12342. onResizeStart: () => toggleSelection(false),
  12343. onResizeStop: handleOnResizeStop,
  12344. showHandle: isSelected
  12345. }, (0,external_wp_element_namespaceObject.createElement)("object", {
  12346. className: "wp-block-file__preview",
  12347. data: href,
  12348. type: "application/pdf",
  12349. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Embed of the selected PDF file.')
  12350. }), !isSelected && (0,external_wp_element_namespaceObject.createElement)("div", {
  12351. className: "wp-block-file__preview-overlay"
  12352. })), (0,external_wp_element_namespaceObject.createElement)("div", {
  12353. className: 'wp-block-file__content-wrapper'
  12354. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  12355. tagName: "a",
  12356. value: fileName,
  12357. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write file name…'),
  12358. withoutInteractiveFormatting: true,
  12359. onChange: text => setAttributes({
  12360. fileName: text
  12361. }),
  12362. href: textLinkHref
  12363. }), showDownloadButton && (0,external_wp_element_namespaceObject.createElement)("div", {
  12364. className: 'wp-block-file__button-richtext-wrapper'
  12365. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  12366. tagName: "div" // Must be block-level or else cursor disappears.
  12367. ,
  12368. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Download button text'),
  12369. className: 'wp-block-file__button',
  12370. value: downloadButtonText,
  12371. withoutInteractiveFormatting: true,
  12372. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add text…'),
  12373. onChange: text => changeDownloadButtonText(text)
  12374. })))));
  12375. }
  12376. /* harmony default export */ var file_edit = ((0,external_wp_components_namespaceObject.withNotices)(FileEdit));
  12377. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/save.js
  12378. /**
  12379. * WordPress dependencies
  12380. */
  12381. function file_save_save(_ref) {
  12382. let {
  12383. attributes
  12384. } = _ref;
  12385. const {
  12386. href,
  12387. fileId,
  12388. fileName,
  12389. textLinkHref,
  12390. textLinkTarget,
  12391. showDownloadButton,
  12392. downloadButtonText,
  12393. displayPreview,
  12394. previewHeight
  12395. } = attributes;
  12396. const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)(
  12397. /* translators: %s: filename. */
  12398. (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName);
  12399. const hasFilename = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName); // Only output an `aria-describedby` when the element it's referring to is
  12400. // actually rendered.
  12401. const describedById = hasFilename ? fileId : undefined;
  12402. return href && (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), displayPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("object", {
  12403. className: "wp-block-file__embed",
  12404. data: href,
  12405. type: "application/pdf",
  12406. style: {
  12407. width: '100%',
  12408. height: `${previewHeight}px`
  12409. },
  12410. "aria-label": pdfEmbedLabel
  12411. })), hasFilename && (0,external_wp_element_namespaceObject.createElement)("a", {
  12412. id: describedById,
  12413. href: textLinkHref,
  12414. target: textLinkTarget,
  12415. rel: textLinkTarget ? 'noreferrer noopener' : undefined
  12416. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  12417. value: fileName
  12418. })), showDownloadButton && (0,external_wp_element_namespaceObject.createElement)("a", {
  12419. href: href,
  12420. className: "wp-block-file__button",
  12421. download: true,
  12422. "aria-describedby": describedById
  12423. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  12424. value: downloadButtonText
  12425. })));
  12426. }
  12427. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/transforms.js
  12428. /**
  12429. * External dependencies
  12430. */
  12431. /**
  12432. * WordPress dependencies
  12433. */
  12434. const file_transforms_transforms = {
  12435. from: [{
  12436. type: 'files',
  12437. isMatch(files) {
  12438. return files.length > 0;
  12439. },
  12440. // We define a lower priorty (higher number) than the default of 10. This
  12441. // ensures that the File block is only created as a fallback.
  12442. priority: 15,
  12443. transform: files => {
  12444. const blocks = [];
  12445. files.forEach(file => {
  12446. const blobURL = (0,external_wp_blob_namespaceObject.createBlobURL)(file); // File will be uploaded in componentDidMount()
  12447. blocks.push((0,external_wp_blocks_namespaceObject.createBlock)('core/file', {
  12448. href: blobURL,
  12449. fileName: file.name,
  12450. textLinkHref: blobURL
  12451. }));
  12452. });
  12453. return blocks;
  12454. }
  12455. }, {
  12456. type: 'block',
  12457. blocks: ['core/audio'],
  12458. transform: attributes => {
  12459. return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', {
  12460. href: attributes.src,
  12461. fileName: attributes.caption,
  12462. textLinkHref: attributes.src,
  12463. id: attributes.id,
  12464. anchor: attributes.anchor
  12465. });
  12466. }
  12467. }, {
  12468. type: 'block',
  12469. blocks: ['core/video'],
  12470. transform: attributes => {
  12471. return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', {
  12472. href: attributes.src,
  12473. fileName: attributes.caption,
  12474. textLinkHref: attributes.src,
  12475. id: attributes.id,
  12476. anchor: attributes.anchor
  12477. });
  12478. }
  12479. }, {
  12480. type: 'block',
  12481. blocks: ['core/image'],
  12482. transform: attributes => {
  12483. return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', {
  12484. href: attributes.url,
  12485. fileName: attributes.caption || (0,external_wp_url_namespaceObject.getFilename)(attributes.url),
  12486. textLinkHref: attributes.url,
  12487. id: attributes.id,
  12488. anchor: attributes.anchor
  12489. });
  12490. }
  12491. }],
  12492. to: [{
  12493. type: 'block',
  12494. blocks: ['core/audio'],
  12495. isMatch: _ref => {
  12496. let {
  12497. id
  12498. } = _ref;
  12499. if (!id) {
  12500. return false;
  12501. }
  12502. const {
  12503. getMedia
  12504. } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store);
  12505. const media = getMedia(id);
  12506. return !!media && (0,external_lodash_namespaceObject.includes)(media.mime_type, 'audio');
  12507. },
  12508. transform: attributes => {
  12509. return (0,external_wp_blocks_namespaceObject.createBlock)('core/audio', {
  12510. src: attributes.href,
  12511. caption: attributes.fileName,
  12512. id: attributes.id,
  12513. anchor: attributes.anchor
  12514. });
  12515. }
  12516. }, {
  12517. type: 'block',
  12518. blocks: ['core/video'],
  12519. isMatch: _ref2 => {
  12520. let {
  12521. id
  12522. } = _ref2;
  12523. if (!id) {
  12524. return false;
  12525. }
  12526. const {
  12527. getMedia
  12528. } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store);
  12529. const media = getMedia(id);
  12530. return !!media && (0,external_lodash_namespaceObject.includes)(media.mime_type, 'video');
  12531. },
  12532. transform: attributes => {
  12533. return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', {
  12534. src: attributes.href,
  12535. caption: attributes.fileName,
  12536. id: attributes.id,
  12537. anchor: attributes.anchor
  12538. });
  12539. }
  12540. }, {
  12541. type: 'block',
  12542. blocks: ['core/image'],
  12543. isMatch: _ref3 => {
  12544. let {
  12545. id
  12546. } = _ref3;
  12547. if (!id) {
  12548. return false;
  12549. }
  12550. const {
  12551. getMedia
  12552. } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store);
  12553. const media = getMedia(id);
  12554. return !!media && (0,external_lodash_namespaceObject.includes)(media.mime_type, 'image');
  12555. },
  12556. transform: attributes => {
  12557. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  12558. url: attributes.href,
  12559. caption: attributes.fileName,
  12560. id: attributes.id,
  12561. anchor: attributes.anchor
  12562. });
  12563. }
  12564. }]
  12565. };
  12566. /* harmony default export */ var file_transforms = (file_transforms_transforms);
  12567. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/index.js
  12568. /**
  12569. * WordPress dependencies
  12570. */
  12571. /**
  12572. * Internal dependencies
  12573. */
  12574. const file_metadata = {
  12575. $schema: "https://schemas.wp.org/trunk/block.json",
  12576. apiVersion: 2,
  12577. name: "core/file",
  12578. title: "File",
  12579. category: "media",
  12580. description: "Add a link to a downloadable file.",
  12581. keywords: ["document", "pdf", "download"],
  12582. textdomain: "default",
  12583. attributes: {
  12584. id: {
  12585. type: "number"
  12586. },
  12587. href: {
  12588. type: "string"
  12589. },
  12590. fileId: {
  12591. type: "string",
  12592. source: "attribute",
  12593. selector: "a:not([download])",
  12594. attribute: "id"
  12595. },
  12596. fileName: {
  12597. type: "string",
  12598. source: "html",
  12599. selector: "a:not([download])"
  12600. },
  12601. textLinkHref: {
  12602. type: "string",
  12603. source: "attribute",
  12604. selector: "a:not([download])",
  12605. attribute: "href"
  12606. },
  12607. textLinkTarget: {
  12608. type: "string",
  12609. source: "attribute",
  12610. selector: "a:not([download])",
  12611. attribute: "target"
  12612. },
  12613. showDownloadButton: {
  12614. type: "boolean",
  12615. "default": true
  12616. },
  12617. downloadButtonText: {
  12618. type: "string",
  12619. source: "html",
  12620. selector: "a[download]"
  12621. },
  12622. displayPreview: {
  12623. type: "boolean"
  12624. },
  12625. previewHeight: {
  12626. type: "number",
  12627. "default": 600
  12628. }
  12629. },
  12630. supports: {
  12631. anchor: true,
  12632. align: true
  12633. },
  12634. viewScript: "file:./view.min.js",
  12635. editorStyle: "wp-block-file-editor",
  12636. style: "wp-block-file"
  12637. };
  12638. const {
  12639. name: file_name
  12640. } = file_metadata;
  12641. const file_settings = {
  12642. icon: library_file,
  12643. example: {
  12644. attributes: {
  12645. href: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg',
  12646. fileName: (0,external_wp_i18n_namespaceObject._x)('Armstrong_Small_Step', 'Name of the file')
  12647. }
  12648. },
  12649. transforms: file_transforms,
  12650. deprecated: file_deprecated,
  12651. edit: file_edit,
  12652. save: file_save_save
  12653. };
  12654. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/gallery.js
  12655. /**
  12656. * WordPress dependencies
  12657. */
  12658. const gallery = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  12659. viewBox: "0 0 24 24",
  12660. xmlns: "http://www.w3.org/2000/svg"
  12661. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  12662. d: "M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8h-1.5zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zM4.5 4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1V12l-2.3-1.7c-.3-.2-.6-.2-.9 0l-2.9 2.1L8 11.3c-.2-.1-.5-.1-.7 0l-2.9 1.5V4.6zm0 11.8v-1.8l3.2-1.7 2.4 1.2c.2.1.5.1.8-.1l2.8-2 2.8 2v2.5c0 .1-.1.1-.1.1H4.6c0-.1-.1-.2-.1-.2z"
  12663. }));
  12664. /* harmony default export */ var library_gallery = (gallery);
  12665. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/constants.js
  12666. const LINK_DESTINATION_NONE = 'none';
  12667. const LINK_DESTINATION_MEDIA = 'media';
  12668. const LINK_DESTINATION_ATTACHMENT = 'attachment';
  12669. const LINK_DESTINATION_MEDIA_WP_CORE = 'file';
  12670. const LINK_DESTINATION_ATTACHMENT_WP_CORE = 'post';
  12671. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/shared.js
  12672. /**
  12673. * External dependencies
  12674. */
  12675. function defaultColumnsNumber(imageCount) {
  12676. return imageCount ? Math.min(3, imageCount) : 3;
  12677. }
  12678. const pickRelevantMediaFiles = function (image) {
  12679. let sizeSlug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'large';
  12680. const imageProps = (0,external_lodash_namespaceObject.pick)(image, ['alt', 'id', 'link', 'caption']);
  12681. imageProps.url = (0,external_lodash_namespaceObject.get)(image, ['sizes', sizeSlug, 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', sizeSlug, 'source_url']) || image.url;
  12682. const fullUrl = (0,external_lodash_namespaceObject.get)(image, ['sizes', 'full', 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', 'full', 'source_url']);
  12683. if (fullUrl) {
  12684. imageProps.fullUrl = fullUrl;
  12685. }
  12686. return imageProps;
  12687. };
  12688. /**
  12689. * The new gallery block format is not compatible with the use_BalanceTags option
  12690. * in WP versions <= 5.8 https://core.trac.wordpress.org/ticket/54130. The
  12691. * window.wp.galleryBlockV2Enabled flag is set in lib/compat.php. This method
  12692. * can be removed when minimum supported WP version >=5.9.
  12693. */
  12694. function isGalleryV2Enabled() {
  12695. // Only run the Gallery version compat check if the plugin is running, otherwise
  12696. // assume we are in 5.9 core and enable by default.
  12697. if (false) {}
  12698. return true;
  12699. }
  12700. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/deprecated.js
  12701. /**
  12702. * External dependencies
  12703. */
  12704. /**
  12705. * WordPress dependencies
  12706. */
  12707. /**
  12708. * Internal dependencies
  12709. */
  12710. const DEPRECATED_LINK_DESTINATION_MEDIA = 'file';
  12711. const DEPRECATED_LINK_DESTINATION_ATTACHMENT = 'post';
  12712. /**
  12713. * Original function to determine default number of columns from a block's
  12714. * attributes.
  12715. *
  12716. * Used in deprecations: v1-6, for versions of the gallery block that didn't use inner blocks.
  12717. *
  12718. * @param {Object} attributes Block attributes.
  12719. * @return {number} Default number of columns for the gallery.
  12720. */
  12721. function defaultColumnsNumberV1(attributes) {
  12722. var _attributes$images;
  12723. return Math.min(3, attributes === null || attributes === void 0 ? void 0 : (_attributes$images = attributes.images) === null || _attributes$images === void 0 ? void 0 : _attributes$images.length);
  12724. }
  12725. /**
  12726. * Original function to determine new href and linkDestination values for an image block from the
  12727. * supplied Gallery link destination.
  12728. *
  12729. * Used in deprecations: v1-6.
  12730. *
  12731. * @param {Object} image Gallery image.
  12732. * @param {string} destination Gallery's selected link destination.
  12733. * @return {Object} New attributes to assign to image block.
  12734. */
  12735. function getHrefAndDestination(image, destination) {
  12736. // Need to determine the URL that the selected destination maps to.
  12737. // Gutenberg and WordPress use different constants so the new link
  12738. // destination also needs to be tweaked.
  12739. switch (destination) {
  12740. case DEPRECATED_LINK_DESTINATION_MEDIA:
  12741. return {
  12742. href: (image === null || image === void 0 ? void 0 : image.source_url) || (image === null || image === void 0 ? void 0 : image.url),
  12743. // eslint-disable-line camelcase
  12744. linkDestination: LINK_DESTINATION_MEDIA
  12745. };
  12746. case DEPRECATED_LINK_DESTINATION_ATTACHMENT:
  12747. return {
  12748. href: image === null || image === void 0 ? void 0 : image.link,
  12749. linkDestination: LINK_DESTINATION_ATTACHMENT
  12750. };
  12751. case LINK_DESTINATION_MEDIA:
  12752. return {
  12753. href: (image === null || image === void 0 ? void 0 : image.source_url) || (image === null || image === void 0 ? void 0 : image.url),
  12754. // eslint-disable-line camelcase
  12755. linkDestination: LINK_DESTINATION_MEDIA
  12756. };
  12757. case LINK_DESTINATION_ATTACHMENT:
  12758. return {
  12759. href: image === null || image === void 0 ? void 0 : image.link,
  12760. linkDestination: LINK_DESTINATION_ATTACHMENT
  12761. };
  12762. case LINK_DESTINATION_NONE:
  12763. return {
  12764. href: undefined,
  12765. linkDestination: LINK_DESTINATION_NONE
  12766. };
  12767. }
  12768. return {};
  12769. }
  12770. function runV2Migration(attributes) {
  12771. let linkTo = attributes.linkTo ? attributes.linkTo : 'none';
  12772. if (linkTo === 'post') {
  12773. linkTo = 'attachment';
  12774. } else if (linkTo === 'file') {
  12775. linkTo = 'media';
  12776. }
  12777. const imageBlocks = attributes.images.map(image => {
  12778. return getImageBlock(image, attributes.sizeSlug, linkTo);
  12779. });
  12780. return [{ ...(0,external_lodash_namespaceObject.omit)(attributes, ['images', 'ids']),
  12781. linkTo,
  12782. allowResize: false
  12783. }, imageBlocks];
  12784. }
  12785. /**
  12786. * Gets an Image block from gallery image data
  12787. *
  12788. * Used to migrate Galleries to nested Image InnerBlocks.
  12789. *
  12790. * @param {Object} image Image properties.
  12791. * @param {string} sizeSlug Gallery sizeSlug attribute.
  12792. * @param {string} linkTo Gallery linkTo attribute.
  12793. * @return {Object} Image block.
  12794. */
  12795. function getImageBlock(image, sizeSlug, linkTo) {
  12796. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { ...(image.id && {
  12797. id: parseInt(image.id)
  12798. }),
  12799. url: image.url,
  12800. alt: image.alt,
  12801. caption: image.caption,
  12802. sizeSlug,
  12803. ...getHrefAndDestination(image, linkTo)
  12804. });
  12805. }
  12806. const deprecated_v6 = {
  12807. attributes: {
  12808. images: {
  12809. type: 'array',
  12810. default: [],
  12811. source: 'query',
  12812. selector: '.blocks-gallery-item',
  12813. query: {
  12814. url: {
  12815. type: 'string',
  12816. source: 'attribute',
  12817. selector: 'img',
  12818. attribute: 'src'
  12819. },
  12820. fullUrl: {
  12821. type: 'string',
  12822. source: 'attribute',
  12823. selector: 'img',
  12824. attribute: 'data-full-url'
  12825. },
  12826. link: {
  12827. type: 'string',
  12828. source: 'attribute',
  12829. selector: 'img',
  12830. attribute: 'data-link'
  12831. },
  12832. alt: {
  12833. type: 'string',
  12834. source: 'attribute',
  12835. selector: 'img',
  12836. attribute: 'alt',
  12837. default: ''
  12838. },
  12839. id: {
  12840. type: 'string',
  12841. source: 'attribute',
  12842. selector: 'img',
  12843. attribute: 'data-id'
  12844. },
  12845. caption: {
  12846. type: 'string',
  12847. source: 'html',
  12848. selector: '.blocks-gallery-item__caption'
  12849. }
  12850. }
  12851. },
  12852. ids: {
  12853. type: 'array',
  12854. items: {
  12855. type: 'number'
  12856. },
  12857. default: []
  12858. },
  12859. columns: {
  12860. type: 'number',
  12861. minimum: 1,
  12862. maximum: 8
  12863. },
  12864. caption: {
  12865. type: 'string',
  12866. source: 'html',
  12867. selector: '.blocks-gallery-caption'
  12868. },
  12869. imageCrop: {
  12870. type: 'boolean',
  12871. default: true
  12872. },
  12873. fixedHeight: {
  12874. type: 'boolean',
  12875. default: true
  12876. },
  12877. linkTo: {
  12878. type: 'string'
  12879. },
  12880. sizeSlug: {
  12881. type: 'string',
  12882. default: 'large'
  12883. }
  12884. },
  12885. supports: {
  12886. anchor: true,
  12887. align: true
  12888. },
  12889. save(_ref) {
  12890. let {
  12891. attributes
  12892. } = _ref;
  12893. const {
  12894. images,
  12895. columns = defaultColumnsNumberV1(attributes),
  12896. imageCrop,
  12897. caption,
  12898. linkTo
  12899. } = attributes;
  12900. const className = `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`;
  12901. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  12902. className
  12903. }), (0,external_wp_element_namespaceObject.createElement)("ul", {
  12904. className: "blocks-gallery-grid"
  12905. }, images.map(image => {
  12906. let href;
  12907. switch (linkTo) {
  12908. case DEPRECATED_LINK_DESTINATION_MEDIA:
  12909. href = image.fullUrl || image.url;
  12910. break;
  12911. case DEPRECATED_LINK_DESTINATION_ATTACHMENT:
  12912. href = image.link;
  12913. break;
  12914. }
  12915. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  12916. src: image.url,
  12917. alt: image.alt,
  12918. "data-id": image.id,
  12919. "data-full-url": image.fullUrl,
  12920. "data-link": image.link,
  12921. className: image.id ? `wp-image-${image.id}` : null
  12922. });
  12923. return (0,external_wp_element_namespaceObject.createElement)("li", {
  12924. key: image.id || image.url,
  12925. className: "blocks-gallery-item"
  12926. }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  12927. href: href
  12928. }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  12929. tagName: "figcaption",
  12930. className: "blocks-gallery-item__caption",
  12931. value: image.caption
  12932. })));
  12933. })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  12934. tagName: "figcaption",
  12935. className: "blocks-gallery-caption",
  12936. value: caption
  12937. }));
  12938. },
  12939. migrate(attributes) {
  12940. if (isGalleryV2Enabled()) {
  12941. return runV2Migration(attributes);
  12942. }
  12943. return attributes;
  12944. }
  12945. };
  12946. const deprecated_v5 = {
  12947. attributes: {
  12948. images: {
  12949. type: 'array',
  12950. default: [],
  12951. source: 'query',
  12952. selector: '.blocks-gallery-item',
  12953. query: {
  12954. url: {
  12955. type: 'string',
  12956. source: 'attribute',
  12957. selector: 'img',
  12958. attribute: 'src'
  12959. },
  12960. fullUrl: {
  12961. type: 'string',
  12962. source: 'attribute',
  12963. selector: 'img',
  12964. attribute: 'data-full-url'
  12965. },
  12966. link: {
  12967. type: 'string',
  12968. source: 'attribute',
  12969. selector: 'img',
  12970. attribute: 'data-link'
  12971. },
  12972. alt: {
  12973. type: 'string',
  12974. source: 'attribute',
  12975. selector: 'img',
  12976. attribute: 'alt',
  12977. default: ''
  12978. },
  12979. id: {
  12980. type: 'string',
  12981. source: 'attribute',
  12982. selector: 'img',
  12983. attribute: 'data-id'
  12984. },
  12985. caption: {
  12986. type: 'string',
  12987. source: 'html',
  12988. selector: '.blocks-gallery-item__caption'
  12989. }
  12990. }
  12991. },
  12992. ids: {
  12993. type: 'array',
  12994. items: {
  12995. type: 'number'
  12996. },
  12997. default: []
  12998. },
  12999. columns: {
  13000. type: 'number',
  13001. minimum: 1,
  13002. maximum: 8
  13003. },
  13004. caption: {
  13005. type: 'string',
  13006. source: 'html',
  13007. selector: '.blocks-gallery-caption'
  13008. },
  13009. imageCrop: {
  13010. type: 'boolean',
  13011. default: true
  13012. },
  13013. linkTo: {
  13014. type: 'string',
  13015. default: 'none'
  13016. },
  13017. sizeSlug: {
  13018. type: 'string',
  13019. default: 'large'
  13020. }
  13021. },
  13022. supports: {
  13023. align: true
  13024. },
  13025. isEligible(_ref2) {
  13026. let {
  13027. linkTo
  13028. } = _ref2;
  13029. return !linkTo || linkTo === 'attachment' || linkTo === 'media';
  13030. },
  13031. migrate(attributes) {
  13032. if (isGalleryV2Enabled()) {
  13033. return runV2Migration(attributes);
  13034. }
  13035. let linkTo = attributes.linkTo;
  13036. if (!attributes.linkTo) {
  13037. linkTo = 'none';
  13038. } else if (attributes.linkTo === 'attachment') {
  13039. linkTo = 'post';
  13040. } else if (attributes.linkTo === 'media') {
  13041. linkTo = 'file';
  13042. }
  13043. return { ...attributes,
  13044. linkTo
  13045. };
  13046. },
  13047. save(_ref3) {
  13048. let {
  13049. attributes
  13050. } = _ref3;
  13051. const {
  13052. images,
  13053. columns = defaultColumnsNumberV1(attributes),
  13054. imageCrop,
  13055. caption,
  13056. linkTo
  13057. } = attributes;
  13058. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  13059. className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
  13060. }, (0,external_wp_element_namespaceObject.createElement)("ul", {
  13061. className: "blocks-gallery-grid"
  13062. }, images.map(image => {
  13063. let href;
  13064. switch (linkTo) {
  13065. case 'media':
  13066. href = image.fullUrl || image.url;
  13067. break;
  13068. case 'attachment':
  13069. href = image.link;
  13070. break;
  13071. }
  13072. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  13073. src: image.url,
  13074. alt: image.alt,
  13075. "data-id": image.id,
  13076. "data-full-url": image.fullUrl,
  13077. "data-link": image.link,
  13078. className: image.id ? `wp-image-${image.id}` : null
  13079. });
  13080. return (0,external_wp_element_namespaceObject.createElement)("li", {
  13081. key: image.id || image.url,
  13082. className: "blocks-gallery-item"
  13083. }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  13084. href: href
  13085. }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  13086. tagName: "figcaption",
  13087. className: "blocks-gallery-item__caption",
  13088. value: image.caption
  13089. })));
  13090. })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  13091. tagName: "figcaption",
  13092. className: "blocks-gallery-caption",
  13093. value: caption
  13094. }));
  13095. }
  13096. };
  13097. const deprecated_v4 = {
  13098. attributes: {
  13099. images: {
  13100. type: 'array',
  13101. default: [],
  13102. source: 'query',
  13103. selector: '.blocks-gallery-item',
  13104. query: {
  13105. url: {
  13106. source: 'attribute',
  13107. selector: 'img',
  13108. attribute: 'src'
  13109. },
  13110. fullUrl: {
  13111. source: 'attribute',
  13112. selector: 'img',
  13113. attribute: 'data-full-url'
  13114. },
  13115. link: {
  13116. source: 'attribute',
  13117. selector: 'img',
  13118. attribute: 'data-link'
  13119. },
  13120. alt: {
  13121. source: 'attribute',
  13122. selector: 'img',
  13123. attribute: 'alt',
  13124. default: ''
  13125. },
  13126. id: {
  13127. source: 'attribute',
  13128. selector: 'img',
  13129. attribute: 'data-id'
  13130. },
  13131. caption: {
  13132. type: 'string',
  13133. source: 'html',
  13134. selector: '.blocks-gallery-item__caption'
  13135. }
  13136. }
  13137. },
  13138. ids: {
  13139. type: 'array',
  13140. default: []
  13141. },
  13142. columns: {
  13143. type: 'number'
  13144. },
  13145. caption: {
  13146. type: 'string',
  13147. source: 'html',
  13148. selector: '.blocks-gallery-caption'
  13149. },
  13150. imageCrop: {
  13151. type: 'boolean',
  13152. default: true
  13153. },
  13154. linkTo: {
  13155. type: 'string',
  13156. default: 'none'
  13157. }
  13158. },
  13159. supports: {
  13160. align: true
  13161. },
  13162. isEligible(_ref4) {
  13163. let {
  13164. ids
  13165. } = _ref4;
  13166. return ids && ids.some(id => typeof id === 'string');
  13167. },
  13168. migrate(attributes) {
  13169. if (isGalleryV2Enabled()) {
  13170. return runV2Migration(attributes);
  13171. }
  13172. return { ...attributes,
  13173. ids: (0,external_lodash_namespaceObject.map)(attributes.ids, id => {
  13174. const parsedId = parseInt(id, 10);
  13175. return Number.isInteger(parsedId) ? parsedId : null;
  13176. })
  13177. };
  13178. },
  13179. save(_ref5) {
  13180. let {
  13181. attributes
  13182. } = _ref5;
  13183. const {
  13184. images,
  13185. columns = defaultColumnsNumberV1(attributes),
  13186. imageCrop,
  13187. caption,
  13188. linkTo
  13189. } = attributes;
  13190. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  13191. className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
  13192. }, (0,external_wp_element_namespaceObject.createElement)("ul", {
  13193. className: "blocks-gallery-grid"
  13194. }, images.map(image => {
  13195. let href;
  13196. switch (linkTo) {
  13197. case 'media':
  13198. href = image.fullUrl || image.url;
  13199. break;
  13200. case 'attachment':
  13201. href = image.link;
  13202. break;
  13203. }
  13204. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  13205. src: image.url,
  13206. alt: image.alt,
  13207. "data-id": image.id,
  13208. "data-full-url": image.fullUrl,
  13209. "data-link": image.link,
  13210. className: image.id ? `wp-image-${image.id}` : null
  13211. });
  13212. return (0,external_wp_element_namespaceObject.createElement)("li", {
  13213. key: image.id || image.url,
  13214. className: "blocks-gallery-item"
  13215. }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  13216. href: href
  13217. }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  13218. tagName: "figcaption",
  13219. className: "blocks-gallery-item__caption",
  13220. value: image.caption
  13221. })));
  13222. })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  13223. tagName: "figcaption",
  13224. className: "blocks-gallery-caption",
  13225. value: caption
  13226. }));
  13227. }
  13228. };
  13229. const deprecated_v3 = {
  13230. attributes: {
  13231. images: {
  13232. type: 'array',
  13233. default: [],
  13234. source: 'query',
  13235. selector: 'ul.wp-block-gallery .blocks-gallery-item',
  13236. query: {
  13237. url: {
  13238. source: 'attribute',
  13239. selector: 'img',
  13240. attribute: 'src'
  13241. },
  13242. fullUrl: {
  13243. source: 'attribute',
  13244. selector: 'img',
  13245. attribute: 'data-full-url'
  13246. },
  13247. alt: {
  13248. source: 'attribute',
  13249. selector: 'img',
  13250. attribute: 'alt',
  13251. default: ''
  13252. },
  13253. id: {
  13254. source: 'attribute',
  13255. selector: 'img',
  13256. attribute: 'data-id'
  13257. },
  13258. link: {
  13259. source: 'attribute',
  13260. selector: 'img',
  13261. attribute: 'data-link'
  13262. },
  13263. caption: {
  13264. type: 'array',
  13265. source: 'children',
  13266. selector: 'figcaption'
  13267. }
  13268. }
  13269. },
  13270. ids: {
  13271. type: 'array',
  13272. default: []
  13273. },
  13274. columns: {
  13275. type: 'number'
  13276. },
  13277. imageCrop: {
  13278. type: 'boolean',
  13279. default: true
  13280. },
  13281. linkTo: {
  13282. type: 'string',
  13283. default: 'none'
  13284. }
  13285. },
  13286. supports: {
  13287. align: true
  13288. },
  13289. save(_ref6) {
  13290. let {
  13291. attributes
  13292. } = _ref6;
  13293. const {
  13294. images,
  13295. columns = defaultColumnsNumberV1(attributes),
  13296. imageCrop,
  13297. linkTo
  13298. } = attributes;
  13299. return (0,external_wp_element_namespaceObject.createElement)("ul", {
  13300. className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
  13301. }, images.map(image => {
  13302. let href;
  13303. switch (linkTo) {
  13304. case 'media':
  13305. href = image.fullUrl || image.url;
  13306. break;
  13307. case 'attachment':
  13308. href = image.link;
  13309. break;
  13310. }
  13311. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  13312. src: image.url,
  13313. alt: image.alt,
  13314. "data-id": image.id,
  13315. "data-full-url": image.fullUrl,
  13316. "data-link": image.link,
  13317. className: image.id ? `wp-image-${image.id}` : null
  13318. });
  13319. return (0,external_wp_element_namespaceObject.createElement)("li", {
  13320. key: image.id || image.url,
  13321. className: "blocks-gallery-item"
  13322. }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  13323. href: href
  13324. }, img) : img, image.caption && image.caption.length > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  13325. tagName: "figcaption",
  13326. value: image.caption
  13327. })));
  13328. }));
  13329. },
  13330. migrate(attributes) {
  13331. if (isGalleryV2Enabled()) {
  13332. return runV2Migration(attributes);
  13333. }
  13334. return attributes;
  13335. }
  13336. };
  13337. const deprecated_v2 = {
  13338. attributes: {
  13339. images: {
  13340. type: 'array',
  13341. default: [],
  13342. source: 'query',
  13343. selector: 'ul.wp-block-gallery .blocks-gallery-item',
  13344. query: {
  13345. url: {
  13346. source: 'attribute',
  13347. selector: 'img',
  13348. attribute: 'src'
  13349. },
  13350. alt: {
  13351. source: 'attribute',
  13352. selector: 'img',
  13353. attribute: 'alt',
  13354. default: ''
  13355. },
  13356. id: {
  13357. source: 'attribute',
  13358. selector: 'img',
  13359. attribute: 'data-id'
  13360. },
  13361. link: {
  13362. source: 'attribute',
  13363. selector: 'img',
  13364. attribute: 'data-link'
  13365. },
  13366. caption: {
  13367. type: 'array',
  13368. source: 'children',
  13369. selector: 'figcaption'
  13370. }
  13371. }
  13372. },
  13373. columns: {
  13374. type: 'number'
  13375. },
  13376. imageCrop: {
  13377. type: 'boolean',
  13378. default: true
  13379. },
  13380. linkTo: {
  13381. type: 'string',
  13382. default: 'none'
  13383. }
  13384. },
  13385. isEligible(_ref7) {
  13386. let {
  13387. images,
  13388. ids
  13389. } = _ref7;
  13390. return images && images.length > 0 && (!ids && images || ids && images && ids.length !== images.length || (0,external_lodash_namespaceObject.some)(images, (id, index) => {
  13391. if (!id && ids[index] !== null) {
  13392. return true;
  13393. }
  13394. return parseInt(id, 10) !== ids[index];
  13395. }));
  13396. },
  13397. migrate(attributes) {
  13398. if (isGalleryV2Enabled()) {
  13399. return runV2Migration(attributes);
  13400. }
  13401. return { ...attributes,
  13402. ids: (0,external_lodash_namespaceObject.map)(attributes.images, _ref8 => {
  13403. let {
  13404. id
  13405. } = _ref8;
  13406. if (!id) {
  13407. return null;
  13408. }
  13409. return parseInt(id, 10);
  13410. })
  13411. };
  13412. },
  13413. supports: {
  13414. align: true
  13415. },
  13416. save(_ref9) {
  13417. let {
  13418. attributes
  13419. } = _ref9;
  13420. const {
  13421. images,
  13422. columns = defaultColumnsNumberV1(attributes),
  13423. imageCrop,
  13424. linkTo
  13425. } = attributes;
  13426. return (0,external_wp_element_namespaceObject.createElement)("ul", {
  13427. className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
  13428. }, images.map(image => {
  13429. let href;
  13430. switch (linkTo) {
  13431. case 'media':
  13432. href = image.url;
  13433. break;
  13434. case 'attachment':
  13435. href = image.link;
  13436. break;
  13437. }
  13438. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  13439. src: image.url,
  13440. alt: image.alt,
  13441. "data-id": image.id,
  13442. "data-link": image.link,
  13443. className: image.id ? `wp-image-${image.id}` : null
  13444. });
  13445. return (0,external_wp_element_namespaceObject.createElement)("li", {
  13446. key: image.id || image.url,
  13447. className: "blocks-gallery-item"
  13448. }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  13449. href: href
  13450. }, img) : img, image.caption && image.caption.length > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  13451. tagName: "figcaption",
  13452. value: image.caption
  13453. })));
  13454. }));
  13455. }
  13456. };
  13457. const gallery_deprecated_v1 = {
  13458. attributes: {
  13459. images: {
  13460. type: 'array',
  13461. default: [],
  13462. source: 'query',
  13463. selector: 'div.wp-block-gallery figure.blocks-gallery-image img',
  13464. query: {
  13465. url: {
  13466. source: 'attribute',
  13467. attribute: 'src'
  13468. },
  13469. alt: {
  13470. source: 'attribute',
  13471. attribute: 'alt',
  13472. default: ''
  13473. },
  13474. id: {
  13475. source: 'attribute',
  13476. attribute: 'data-id'
  13477. }
  13478. }
  13479. },
  13480. columns: {
  13481. type: 'number'
  13482. },
  13483. imageCrop: {
  13484. type: 'boolean',
  13485. default: true
  13486. },
  13487. linkTo: {
  13488. type: 'string',
  13489. default: 'none'
  13490. },
  13491. align: {
  13492. type: 'string',
  13493. default: 'none'
  13494. }
  13495. },
  13496. supports: {
  13497. align: true
  13498. },
  13499. save(_ref10) {
  13500. let {
  13501. attributes
  13502. } = _ref10;
  13503. const {
  13504. images,
  13505. columns = defaultColumnsNumberV1(attributes),
  13506. align,
  13507. imageCrop,
  13508. linkTo
  13509. } = attributes;
  13510. const className = classnames_default()(`columns-${columns}`, {
  13511. alignnone: align === 'none',
  13512. 'is-cropped': imageCrop
  13513. });
  13514. return (0,external_wp_element_namespaceObject.createElement)("div", {
  13515. className: className
  13516. }, images.map(image => {
  13517. let href;
  13518. switch (linkTo) {
  13519. case 'media':
  13520. href = image.url;
  13521. break;
  13522. case 'attachment':
  13523. href = image.link;
  13524. break;
  13525. }
  13526. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  13527. src: image.url,
  13528. alt: image.alt,
  13529. "data-id": image.id
  13530. });
  13531. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  13532. key: image.id || image.url,
  13533. className: "blocks-gallery-image"
  13534. }, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  13535. href: href
  13536. }, img) : img);
  13537. }));
  13538. },
  13539. migrate(attributes) {
  13540. if (isGalleryV2Enabled()) {
  13541. return runV2Migration(attributes);
  13542. }
  13543. return attributes;
  13544. }
  13545. };
  13546. /* harmony default export */ var gallery_deprecated = ([deprecated_v6, deprecated_v5, deprecated_v4, deprecated_v3, deprecated_v2, gallery_deprecated_v1]);
  13547. ;// CONCATENATED MODULE: external ["wp","viewport"]
  13548. var external_wp_viewport_namespaceObject = window["wp"]["viewport"];
  13549. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/shared-icon.js
  13550. /**
  13551. * WordPress dependencies
  13552. */
  13553. const sharedIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  13554. icon: library_gallery
  13555. });
  13556. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/constants.js
  13557. const MIN_SIZE = 20;
  13558. const constants_LINK_DESTINATION_NONE = 'none';
  13559. const constants_LINK_DESTINATION_MEDIA = 'media';
  13560. const constants_LINK_DESTINATION_ATTACHMENT = 'attachment';
  13561. const LINK_DESTINATION_CUSTOM = 'custom';
  13562. const constants_NEW_TAB_REL = ['noreferrer', 'noopener'];
  13563. const constants_ALLOWED_MEDIA_TYPES = ['image'];
  13564. const MEDIA_ID_NO_FEATURED_IMAGE_SET = 0;
  13565. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/utils.js
  13566. /**
  13567. * Internal dependencies
  13568. */
  13569. /**
  13570. * Determines new href and linkDestination values for an image block from the
  13571. * supplied Gallery link destination.
  13572. *
  13573. * @param {Object} image Gallery image.
  13574. * @param {string} destination Gallery's selected link destination.
  13575. * @return {Object} New attributes to assign to image block.
  13576. */
  13577. function utils_getHrefAndDestination(image, destination) {
  13578. // Gutenberg and WordPress use different constants so if image_default_link_type
  13579. // option is set we need to map from the WP Core values.
  13580. switch (destination) {
  13581. case LINK_DESTINATION_MEDIA_WP_CORE:
  13582. case LINK_DESTINATION_MEDIA:
  13583. return {
  13584. href: (image === null || image === void 0 ? void 0 : image.source_url) || (image === null || image === void 0 ? void 0 : image.url),
  13585. // eslint-disable-line camelcase
  13586. linkDestination: constants_LINK_DESTINATION_MEDIA
  13587. };
  13588. case LINK_DESTINATION_ATTACHMENT_WP_CORE:
  13589. case LINK_DESTINATION_ATTACHMENT:
  13590. return {
  13591. href: image === null || image === void 0 ? void 0 : image.link,
  13592. linkDestination: constants_LINK_DESTINATION_ATTACHMENT
  13593. };
  13594. case LINK_DESTINATION_NONE:
  13595. return {
  13596. href: undefined,
  13597. linkDestination: constants_LINK_DESTINATION_NONE
  13598. };
  13599. }
  13600. return {};
  13601. }
  13602. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/utils.js
  13603. /**
  13604. * External dependencies
  13605. */
  13606. /**
  13607. * Internal dependencies
  13608. */
  13609. function removeNewTabRel(currentRel) {
  13610. let newRel = currentRel;
  13611. if (currentRel !== undefined && !(0,external_lodash_namespaceObject.isEmpty)(newRel)) {
  13612. if (!(0,external_lodash_namespaceObject.isEmpty)(newRel)) {
  13613. (0,external_lodash_namespaceObject.each)(constants_NEW_TAB_REL, relVal => {
  13614. const regExp = new RegExp('\\b' + relVal + '\\b', 'gi');
  13615. newRel = newRel.replace(regExp, '');
  13616. }); // Only trim if NEW_TAB_REL values was replaced.
  13617. if (newRel !== currentRel) {
  13618. newRel = newRel.trim();
  13619. }
  13620. if ((0,external_lodash_namespaceObject.isEmpty)(newRel)) {
  13621. newRel = undefined;
  13622. }
  13623. }
  13624. }
  13625. return newRel;
  13626. }
  13627. /**
  13628. * Helper to get the link target settings to be stored.
  13629. *
  13630. * @param {boolean} value The new link target value.
  13631. * @param {Object} attributes Block attributes.
  13632. * @param {Object} attributes.rel Image block's rel attribute.
  13633. *
  13634. * @return {Object} Updated link target settings.
  13635. */
  13636. function getUpdatedLinkTargetSettings(value, _ref) {
  13637. let {
  13638. rel
  13639. } = _ref;
  13640. const linkTarget = value ? '_blank' : undefined;
  13641. let updatedRel;
  13642. if (!linkTarget && !rel) {
  13643. updatedRel = undefined;
  13644. } else {
  13645. updatedRel = removeNewTabRel(rel);
  13646. }
  13647. return {
  13648. linkTarget,
  13649. rel: updatedRel
  13650. };
  13651. }
  13652. /**
  13653. * Determines new Image block attributes size selection.
  13654. *
  13655. * @param {Object} image Media file object for gallery image.
  13656. * @param {string} size Selected size slug to apply.
  13657. */
  13658. function getImageSizeAttributes(image, size) {
  13659. const url = (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', size, 'source_url']);
  13660. if (url) {
  13661. return {
  13662. url,
  13663. width: undefined,
  13664. height: undefined,
  13665. sizeSlug: size
  13666. };
  13667. }
  13668. return {};
  13669. }
  13670. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/gallery.js
  13671. /**
  13672. * External dependencies
  13673. */
  13674. /**
  13675. * WordPress dependencies
  13676. */
  13677. const allowedBlocks = ['core/image'];
  13678. const Gallery = props => {
  13679. const {
  13680. attributes,
  13681. isSelected,
  13682. setAttributes,
  13683. mediaPlaceholder,
  13684. insertBlocksAfter,
  13685. blockProps
  13686. } = props;
  13687. const {
  13688. align,
  13689. columns,
  13690. caption,
  13691. imageCrop
  13692. } = attributes;
  13693. const {
  13694. children,
  13695. ...innerBlocksProps
  13696. } = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  13697. allowedBlocks,
  13698. orientation: 'horizontal',
  13699. renderAppender: false,
  13700. __experimentalLayout: {
  13701. type: 'default',
  13702. alignments: []
  13703. }
  13704. });
  13705. const [captionFocused, setCaptionFocused] = (0,external_wp_element_namespaceObject.useState)(false);
  13706. function onFocusCaption() {
  13707. if (!captionFocused) {
  13708. setCaptionFocused(true);
  13709. }
  13710. }
  13711. function removeCaptionFocus() {
  13712. if (captionFocused) {
  13713. setCaptionFocused(false);
  13714. }
  13715. }
  13716. (0,external_wp_element_namespaceObject.useEffect)(() => {
  13717. if (!isSelected) {
  13718. setCaptionFocused(false);
  13719. }
  13720. }, [isSelected]);
  13721. return (0,external_wp_element_namespaceObject.createElement)("figure", _extends({}, innerBlocksProps, {
  13722. className: classnames_default()(blockProps.className, 'blocks-gallery-grid', {
  13723. [`align${align}`]: align,
  13724. [`columns-${columns}`]: columns !== undefined,
  13725. [`columns-default`]: columns === undefined,
  13726. 'is-cropped': imageCrop
  13727. })
  13728. }), children, isSelected && !children && (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, {
  13729. className: "blocks-gallery-media-placeholder-wrapper",
  13730. onClick: removeCaptionFocus
  13731. }, mediaPlaceholder), (0,external_wp_element_namespaceObject.createElement)(RichTextVisibilityHelper, {
  13732. isHidden: !isSelected && external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption),
  13733. captionFocused: captionFocused,
  13734. onFocusCaption: onFocusCaption,
  13735. tagName: "figcaption",
  13736. className: "blocks-gallery-caption",
  13737. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Gallery caption text'),
  13738. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write gallery caption…'),
  13739. value: caption,
  13740. onChange: value => setAttributes({
  13741. caption: value
  13742. }),
  13743. inlineToolbar: true,
  13744. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
  13745. }));
  13746. };
  13747. function RichTextVisibilityHelper(_ref) {
  13748. let {
  13749. isHidden,
  13750. captionFocused,
  13751. onFocusCaption,
  13752. className,
  13753. value,
  13754. placeholder,
  13755. tagName,
  13756. captionRef,
  13757. ...richTextProps
  13758. } = _ref;
  13759. if (isHidden) {
  13760. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, _extends({
  13761. as: external_wp_blockEditor_namespaceObject.RichText
  13762. }, richTextProps));
  13763. }
  13764. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  13765. ref: captionRef,
  13766. value: value,
  13767. placeholder: placeholder,
  13768. className: className,
  13769. tagName: tagName,
  13770. isSelected: captionFocused,
  13771. onClick: onFocusCaption
  13772. }, richTextProps));
  13773. }
  13774. /* harmony default export */ var gallery_gallery = (Gallery);
  13775. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-image-sizes.js
  13776. /**
  13777. * External dependencies
  13778. */
  13779. /**
  13780. * WordPress dependencies
  13781. */
  13782. /**
  13783. * Calculates the image sizes that are avaible for the current gallery images in order to
  13784. * populate the 'Image size' selector.
  13785. *
  13786. * @param {Array} images Basic image block data taken from current gallery innerBlock
  13787. * @param {boolean} isSelected Is the block currently selected in the editor.
  13788. * @param {Function} getSettings Block editor store selector.
  13789. *
  13790. * @return {Array} An array of image size options.
  13791. */
  13792. function useImageSizes(images, isSelected, getSettings) {
  13793. return (0,external_wp_element_namespaceObject.useMemo)(() => getImageSizing(), [images, isSelected]);
  13794. function getImageSizing() {
  13795. if (!images || images.length === 0) {
  13796. return;
  13797. }
  13798. const {
  13799. imageSizes
  13800. } = getSettings();
  13801. let resizedImages = {};
  13802. if (isSelected) {
  13803. resizedImages = images.reduce((currentResizedImages, img) => {
  13804. if (!img.id) {
  13805. return currentResizedImages;
  13806. }
  13807. const sizes = imageSizes.reduce((currentSizes, size) => {
  13808. const defaultUrl = (0,external_lodash_namespaceObject.get)(img, ['sizes', size.slug, 'url']);
  13809. const mediaDetailsUrl = (0,external_lodash_namespaceObject.get)(img, ['media_details', 'sizes', size.slug, 'source_url']);
  13810. return { ...currentSizes,
  13811. [size.slug]: defaultUrl || mediaDetailsUrl
  13812. };
  13813. }, {});
  13814. return { ...currentResizedImages,
  13815. [parseInt(img.id, 10)]: sizes
  13816. };
  13817. }, {});
  13818. }
  13819. return imageSizes.filter(_ref => {
  13820. let {
  13821. slug
  13822. } = _ref;
  13823. return (0,external_lodash_namespaceObject.some)(resizedImages, sizes => sizes[slug]);
  13824. }).map(_ref2 => {
  13825. let {
  13826. name,
  13827. slug
  13828. } = _ref2;
  13829. return {
  13830. value: slug,
  13831. label: name
  13832. };
  13833. });
  13834. }
  13835. }
  13836. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-short-code-transform.js
  13837. /**
  13838. * External dependencies
  13839. */
  13840. /**
  13841. * WordPress dependencies
  13842. */
  13843. /**
  13844. * Shortcode transforms don't currently have a tranform method and so can't use a selector to
  13845. * retrieve the data for each image being transformer, so this selector handle this post transformation.
  13846. *
  13847. * @param {Array} shortCodeTransforms An array of image data passed from the shortcode transform.
  13848. *
  13849. * @return {Array} An array of extended image data objects for each of the shortcode transform images.
  13850. */
  13851. function useShortCodeTransform(shortCodeTransforms) {
  13852. const newImageData = (0,external_wp_data_namespaceObject.useSelect)(select => {
  13853. if (!shortCodeTransforms || shortCodeTransforms.length === 0) {
  13854. return;
  13855. }
  13856. const getMedia = select(external_wp_coreData_namespaceObject.store).getMedia;
  13857. return shortCodeTransforms.map(image => {
  13858. const imageData = getMedia(image.id);
  13859. if (imageData) {
  13860. return {
  13861. id: imageData.id,
  13862. type: 'image',
  13863. url: imageData.source_url,
  13864. mime: imageData.mime_type,
  13865. alt: imageData.alt_text,
  13866. link: imageData.link
  13867. };
  13868. }
  13869. return undefined;
  13870. });
  13871. }, [shortCodeTransforms]);
  13872. if (!newImageData) {
  13873. return;
  13874. }
  13875. if ((0,external_lodash_namespaceObject.every)(newImageData, img => img && img.url)) {
  13876. return newImageData;
  13877. }
  13878. }
  13879. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-get-new-images.js
  13880. /**
  13881. * WordPress dependencies
  13882. */
  13883. /**
  13884. * Keeps track of images already in the gallery to allow new innerBlocks to be identified. This
  13885. * is required so default gallery attributes can be applied without overwriting any custom
  13886. * attributes applied to existing images.
  13887. *
  13888. * @param {Array} images Basic image block data taken from current gallery innerBlock
  13889. * @param {Array} imageData The related image data for each of the current gallery images.
  13890. *
  13891. * @return {Array} An array of any new images that have been added to the gallery.
  13892. */
  13893. function useGetNewImages(images, imageData) {
  13894. const [currentImages, setCurrentImages] = (0,external_wp_element_namespaceObject.useState)([]);
  13895. return (0,external_wp_element_namespaceObject.useMemo)(() => getNewImages(), [images, imageData]);
  13896. function getNewImages() {
  13897. let imagesUpdated = false; // First lets check if any images have been deleted.
  13898. const newCurrentImages = currentImages.filter(currentImg => images.find(img => {
  13899. return currentImg.clientId === img.clientId;
  13900. }));
  13901. if (newCurrentImages.length < currentImages.length) {
  13902. imagesUpdated = true;
  13903. } // Now lets see if we have any images hydrated from saved content and if so
  13904. // add them to currentImages state.
  13905. images.forEach(image => {
  13906. if (image.fromSavedContent && !newCurrentImages.find(currentImage => currentImage.id === image.id)) {
  13907. imagesUpdated = true;
  13908. newCurrentImages.push(image);
  13909. }
  13910. }); // Now check for any new images that have been added to InnerBlocks and for which
  13911. // we have the imageData we need for setting default block attributes.
  13912. const newImages = images.filter(image => !newCurrentImages.find(currentImage => image.clientId && currentImage.clientId === image.clientId) && (imageData === null || imageData === void 0 ? void 0 : imageData.find(img => img.id === image.id)) && !image.fromSavedConent);
  13913. if (imagesUpdated || (newImages === null || newImages === void 0 ? void 0 : newImages.length) > 0) {
  13914. setCurrentImages([...newCurrentImages, ...newImages]);
  13915. }
  13916. return newImages.length > 0 ? newImages : null;
  13917. }
  13918. }
  13919. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-get-media.js
  13920. /**
  13921. * WordPress dependencies
  13922. */
  13923. /**
  13924. * Retrieves the extended media info for each gallery image from the store. This is used to
  13925. * determine which image size options are available for the current gallery.
  13926. *
  13927. * @param {Array} innerBlockImages An array of the innerBlock images currently in the gallery.
  13928. *
  13929. * @return {Array} An array of media info options for each gallery image.
  13930. */
  13931. function useGetMedia(innerBlockImages) {
  13932. const [currentImageMedia, setCurrentImageMedia] = (0,external_wp_element_namespaceObject.useState)([]);
  13933. const imageMedia = (0,external_wp_data_namespaceObject.useSelect)(select => {
  13934. if (!(innerBlockImages !== null && innerBlockImages !== void 0 && innerBlockImages.length)) {
  13935. return currentImageMedia;
  13936. }
  13937. const imageIds = innerBlockImages.map(imageBlock => imageBlock.attributes.id).filter(id => id !== undefined);
  13938. if (imageIds.length === 0) {
  13939. return currentImageMedia;
  13940. }
  13941. return select(external_wp_coreData_namespaceObject.store).getMediaItems({
  13942. include: imageIds.join(','),
  13943. per_page: -1
  13944. });
  13945. }, [innerBlockImages]);
  13946. if ((imageMedia === null || imageMedia === void 0 ? void 0 : imageMedia.length) !== (currentImageMedia === null || currentImageMedia === void 0 ? void 0 : currentImageMedia.length) || imageMedia !== null && imageMedia !== void 0 && imageMedia.some(newImage => !currentImageMedia.find(currentImage => currentImage.id === newImage.id))) {
  13947. setCurrentImageMedia(imageMedia);
  13948. return imageMedia;
  13949. }
  13950. return currentImageMedia;
  13951. }
  13952. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/gap-styles.js
  13953. /**
  13954. * WordPress dependencies
  13955. */
  13956. function GapStyles(_ref) {
  13957. let {
  13958. blockGap,
  13959. clientId
  13960. } = _ref;
  13961. const styleElement = (0,external_wp_element_namespaceObject.useContext)(external_wp_blockEditor_namespaceObject.BlockList.__unstableElementContext); // --gallery-block--gutter-size is deprecated. --wp--style--gallery-gap-default should be used by themes that want to set a default
  13962. // gap on the gallery.
  13963. const fallbackValue = `var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )`;
  13964. let gapValue = fallbackValue;
  13965. let column = fallbackValue;
  13966. let row; // Check for the possibility of split block gap values. See: https://github.com/WordPress/gutenberg/pull/37736
  13967. if (!!blockGap) {
  13968. row = typeof blockGap === 'string' ? blockGap : (blockGap === null || blockGap === void 0 ? void 0 : blockGap.top) || fallbackValue;
  13969. column = typeof blockGap === 'string' ? blockGap : (blockGap === null || blockGap === void 0 ? void 0 : blockGap.left) || fallbackValue;
  13970. gapValue = row === column ? row : `${row} ${column}`;
  13971. }
  13972. const gap = `#block-${clientId} {
  13973. --wp--style--unstable-gallery-gap: ${column};
  13974. gap: ${gapValue}
  13975. }`;
  13976. const GapStyle = () => {
  13977. return (0,external_wp_element_namespaceObject.createElement)("style", null, gap);
  13978. };
  13979. return gap && styleElement ? (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(GapStyle, null), styleElement) : null;
  13980. }
  13981. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/edit.js
  13982. /**
  13983. * External dependencies
  13984. */
  13985. /**
  13986. * WordPress dependencies
  13987. */
  13988. /**
  13989. * Internal dependencies
  13990. */
  13991. const MAX_COLUMNS = 8;
  13992. const linkOptions = [{
  13993. value: LINK_DESTINATION_ATTACHMENT,
  13994. label: (0,external_wp_i18n_namespaceObject.__)('Attachment Page')
  13995. }, {
  13996. value: LINK_DESTINATION_MEDIA,
  13997. label: (0,external_wp_i18n_namespaceObject.__)('Media File')
  13998. }, {
  13999. value: LINK_DESTINATION_NONE,
  14000. label: (0,external_wp_i18n_namespaceObject._x)('None', 'Media item link option')
  14001. }];
  14002. const edit_ALLOWED_MEDIA_TYPES = ['image'];
  14003. const PLACEHOLDER_TEXT = external_wp_element_namespaceObject.Platform.isNative ? (0,external_wp_i18n_namespaceObject.__)('ADD MEDIA') : (0,external_wp_i18n_namespaceObject.__)('Drag images, upload new ones or select files from your library.');
  14004. const MOBILE_CONTROL_PROPS_RANGE_CONTROL = external_wp_element_namespaceObject.Platform.isNative ? {
  14005. type: 'stepper'
  14006. } : {};
  14007. function GalleryEdit(props) {
  14008. var _attributes$style, _attributes$style$spa;
  14009. const {
  14010. setAttributes,
  14011. attributes,
  14012. className,
  14013. clientId,
  14014. noticeOperations,
  14015. isSelected,
  14016. noticeUI,
  14017. insertBlocksAfter
  14018. } = props;
  14019. const {
  14020. columns,
  14021. imageCrop,
  14022. linkTarget,
  14023. linkTo,
  14024. shortCodeTransforms,
  14025. sizeSlug
  14026. } = attributes;
  14027. const {
  14028. __unstableMarkNextChangeAsNotPersistent,
  14029. replaceInnerBlocks,
  14030. updateBlockAttributes,
  14031. selectBlock,
  14032. clearSelectedBlock
  14033. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  14034. const {
  14035. createSuccessNotice
  14036. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  14037. const {
  14038. getBlock,
  14039. getSettings,
  14040. preferredStyle
  14041. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  14042. var _preferredStyleVariat;
  14043. const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
  14044. const preferredStyleVariations = settings.__experimentalPreferredStyleVariations;
  14045. return {
  14046. getBlock: select(external_wp_blockEditor_namespaceObject.store).getBlock,
  14047. getSettings: select(external_wp_blockEditor_namespaceObject.store).getSettings,
  14048. preferredStyle: preferredStyleVariations === null || preferredStyleVariations === void 0 ? void 0 : (_preferredStyleVariat = preferredStyleVariations.value) === null || _preferredStyleVariat === void 0 ? void 0 : _preferredStyleVariat['core/image']
  14049. };
  14050. }, []);
  14051. const innerBlockImages = (0,external_wp_data_namespaceObject.useSelect)(select => {
  14052. var _select$getBlock;
  14053. return (_select$getBlock = select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId)) === null || _select$getBlock === void 0 ? void 0 : _select$getBlock.innerBlocks;
  14054. }, [clientId]);
  14055. const wasBlockJustInserted = (0,external_wp_data_namespaceObject.useSelect)(select => {
  14056. return select(external_wp_blockEditor_namespaceObject.store).wasBlockJustInserted(clientId, 'inserter_menu');
  14057. }, [clientId]);
  14058. const images = (0,external_wp_element_namespaceObject.useMemo)(() => innerBlockImages === null || innerBlockImages === void 0 ? void 0 : innerBlockImages.map(block => ({
  14059. clientId: block.clientId,
  14060. id: block.attributes.id,
  14061. url: block.attributes.url,
  14062. attributes: block.attributes,
  14063. fromSavedContent: Boolean(block.originalContent)
  14064. })), [innerBlockImages]);
  14065. const imageData = useGetMedia(innerBlockImages);
  14066. const newImages = useGetNewImages(images, imageData);
  14067. (0,external_wp_element_namespaceObject.useEffect)(() => {
  14068. newImages === null || newImages === void 0 ? void 0 : newImages.forEach(newImage => {
  14069. updateBlockAttributes(newImage.clientId, { ...buildImageAttributes(newImage.attributes),
  14070. id: newImage.id,
  14071. align: undefined
  14072. });
  14073. });
  14074. if ((newImages === null || newImages === void 0 ? void 0 : newImages.length) > 0) {
  14075. clearSelectedBlock();
  14076. }
  14077. }, [newImages]);
  14078. const shortCodeImages = useShortCodeTransform(shortCodeTransforms);
  14079. (0,external_wp_element_namespaceObject.useEffect)(() => {
  14080. if (!shortCodeTransforms || !shortCodeImages) {
  14081. return;
  14082. }
  14083. updateImages(shortCodeImages);
  14084. setAttributes({
  14085. shortCodeTransforms: undefined
  14086. });
  14087. }, [shortCodeTransforms, shortCodeImages]);
  14088. const imageSizeOptions = useImageSizes(imageData, isSelected, getSettings);
  14089. /**
  14090. * Determines the image attributes that should be applied to an image block
  14091. * after the gallery updates.
  14092. *
  14093. * The gallery will receive the full collection of images when a new image
  14094. * is added. As a result we need to reapply the image's original settings if
  14095. * it already existed in the gallery. If the image is in fact new, we need
  14096. * to apply the gallery's current settings to the image.
  14097. *
  14098. * @param {Object} imageAttributes Media object for the actual image.
  14099. * @return {Object} Attributes to set on the new image block.
  14100. */
  14101. function buildImageAttributes(imageAttributes) {
  14102. const image = imageAttributes.id ? (0,external_lodash_namespaceObject.find)(imageData, {
  14103. id: imageAttributes.id
  14104. }) : null;
  14105. let newClassName;
  14106. if (imageAttributes.className && imageAttributes.className !== '') {
  14107. newClassName = imageAttributes.className;
  14108. } else {
  14109. newClassName = preferredStyle ? `is-style-${preferredStyle}` : undefined;
  14110. }
  14111. return { ...pickRelevantMediaFiles(imageAttributes, sizeSlug),
  14112. ...utils_getHrefAndDestination(image, linkTo),
  14113. ...getUpdatedLinkTargetSettings(linkTarget, attributes),
  14114. className: newClassName,
  14115. sizeSlug
  14116. };
  14117. }
  14118. function isValidFileType(file) {
  14119. var _file$url;
  14120. return edit_ALLOWED_MEDIA_TYPES.some(mediaType => {
  14121. var _file$type;
  14122. return ((_file$type = file.type) === null || _file$type === void 0 ? void 0 : _file$type.indexOf(mediaType)) === 0;
  14123. }) || ((_file$url = file.url) === null || _file$url === void 0 ? void 0 : _file$url.indexOf('blob:')) === 0;
  14124. }
  14125. function updateImages(selectedImages) {
  14126. const newFileUploads = Object.prototype.toString.call(selectedImages) === '[object FileList]';
  14127. const imageArray = newFileUploads ? Array.from(selectedImages).map(file => {
  14128. if (!file.url) {
  14129. return pickRelevantMediaFiles({
  14130. url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  14131. });
  14132. }
  14133. return file;
  14134. }) : selectedImages;
  14135. if (!imageArray.every(isValidFileType)) {
  14136. noticeOperations.removeAllNotices();
  14137. noticeOperations.createErrorNotice((0,external_wp_i18n_namespaceObject.__)('If uploading to a gallery all files need to be image formats'), {
  14138. id: 'gallery-upload-invalid-file'
  14139. });
  14140. }
  14141. const processedImages = imageArray.filter(file => file.url || isValidFileType(file)).map(file => {
  14142. if (!file.url) {
  14143. return pickRelevantMediaFiles({
  14144. url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  14145. });
  14146. }
  14147. return file;
  14148. }); // Because we are reusing existing innerImage blocks any reordering
  14149. // done in the media library will be lost so we need to reapply that ordering
  14150. // once the new image blocks are merged in with existing.
  14151. const newOrderMap = processedImages.reduce((result, image, index) => (result[image.id] = index, result), {});
  14152. const existingImageBlocks = !newFileUploads ? innerBlockImages.filter(block => processedImages.find(img => img.id === block.attributes.id)) : innerBlockImages;
  14153. const newImageList = processedImages.filter(img => !existingImageBlocks.find(existingImg => img.id === existingImg.attributes.id));
  14154. const newBlocks = newImageList.map(image => {
  14155. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  14156. id: image.id,
  14157. url: image.url,
  14158. caption: image.caption,
  14159. alt: image.alt
  14160. });
  14161. });
  14162. if ((newBlocks === null || newBlocks === void 0 ? void 0 : newBlocks.length) > 0) {
  14163. selectBlock(newBlocks[0].clientId);
  14164. }
  14165. replaceInnerBlocks(clientId, (0,external_lodash_namespaceObject.concat)(existingImageBlocks, newBlocks).sort((a, b) => newOrderMap[a.attributes.id] - newOrderMap[b.attributes.id]));
  14166. }
  14167. function onUploadError(message) {
  14168. noticeOperations.removeAllNotices();
  14169. noticeOperations.createErrorNotice(message);
  14170. }
  14171. function setLinkTo(value) {
  14172. setAttributes({
  14173. linkTo: value
  14174. });
  14175. const changedAttributes = {};
  14176. const blocks = [];
  14177. getBlock(clientId).innerBlocks.forEach(block => {
  14178. blocks.push(block.clientId);
  14179. const image = block.attributes.id ? (0,external_lodash_namespaceObject.find)(imageData, {
  14180. id: block.attributes.id
  14181. }) : null;
  14182. changedAttributes[block.clientId] = utils_getHrefAndDestination(image, value);
  14183. });
  14184. updateBlockAttributes(blocks, changedAttributes, true);
  14185. const linkToText = [...linkOptions].find(linkType => linkType.value === value);
  14186. createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
  14187. /* translators: %s: image size settings */
  14188. (0,external_wp_i18n_namespaceObject.__)('All gallery image links updated to: %s'), linkToText.label), {
  14189. id: 'gallery-attributes-linkTo',
  14190. type: 'snackbar'
  14191. });
  14192. }
  14193. function setColumnsNumber(value) {
  14194. setAttributes({
  14195. columns: value
  14196. });
  14197. }
  14198. function toggleImageCrop() {
  14199. setAttributes({
  14200. imageCrop: !imageCrop
  14201. });
  14202. }
  14203. function getImageCropHelp(checked) {
  14204. return checked ? (0,external_wp_i18n_namespaceObject.__)('Thumbnails are cropped to align.') : (0,external_wp_i18n_namespaceObject.__)('Thumbnails are not cropped.');
  14205. }
  14206. function toggleOpenInNewTab(openInNewTab) {
  14207. const newLinkTarget = openInNewTab ? '_blank' : undefined;
  14208. setAttributes({
  14209. linkTarget: newLinkTarget
  14210. });
  14211. const changedAttributes = {};
  14212. const blocks = [];
  14213. getBlock(clientId).innerBlocks.forEach(block => {
  14214. blocks.push(block.clientId);
  14215. changedAttributes[block.clientId] = getUpdatedLinkTargetSettings(newLinkTarget, block.attributes);
  14216. });
  14217. updateBlockAttributes(blocks, changedAttributes, true);
  14218. const noticeText = openInNewTab ? (0,external_wp_i18n_namespaceObject.__)('All gallery images updated to open in new tab') : (0,external_wp_i18n_namespaceObject.__)('All gallery images updated to not open in new tab');
  14219. createSuccessNotice(noticeText, {
  14220. id: 'gallery-attributes-openInNewTab',
  14221. type: 'snackbar'
  14222. });
  14223. }
  14224. function updateImagesSize(newSizeSlug) {
  14225. setAttributes({
  14226. sizeSlug: newSizeSlug
  14227. });
  14228. const changedAttributes = {};
  14229. const blocks = [];
  14230. getBlock(clientId).innerBlocks.forEach(block => {
  14231. blocks.push(block.clientId);
  14232. const image = block.attributes.id ? (0,external_lodash_namespaceObject.find)(imageData, {
  14233. id: block.attributes.id
  14234. }) : null;
  14235. changedAttributes[block.clientId] = getImageSizeAttributes(image, newSizeSlug);
  14236. });
  14237. updateBlockAttributes(blocks, changedAttributes, true);
  14238. const imageSize = imageSizeOptions.find(size => size.value === newSizeSlug);
  14239. createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
  14240. /* translators: %s: image size settings */
  14241. (0,external_wp_i18n_namespaceObject.__)('All gallery image sizes updated to: %s'), imageSize.label), {
  14242. id: 'gallery-attributes-sizeSlug',
  14243. type: 'snackbar'
  14244. });
  14245. }
  14246. (0,external_wp_element_namespaceObject.useEffect)(() => {
  14247. // linkTo attribute must be saved so blocks don't break when changing image_default_link_type in options.php.
  14248. if (!linkTo) {
  14249. var _window, _window$wp, _window$wp$media, _window$wp$media$view, _window$wp$media$view2, _window$wp$media$view3;
  14250. __unstableMarkNextChangeAsNotPersistent();
  14251. setAttributes({
  14252. linkTo: ((_window = window) === null || _window === void 0 ? void 0 : (_window$wp = _window.wp) === null || _window$wp === void 0 ? void 0 : (_window$wp$media = _window$wp.media) === null || _window$wp$media === void 0 ? void 0 : (_window$wp$media$view = _window$wp$media.view) === null || _window$wp$media$view === void 0 ? void 0 : (_window$wp$media$view2 = _window$wp$media$view.settings) === null || _window$wp$media$view2 === void 0 ? void 0 : (_window$wp$media$view3 = _window$wp$media$view2.defaultProps) === null || _window$wp$media$view3 === void 0 ? void 0 : _window$wp$media$view3.link) || LINK_DESTINATION_NONE
  14253. });
  14254. }
  14255. }, [linkTo]);
  14256. const hasImages = !!images.length;
  14257. const hasImageIds = hasImages && images.some(image => !!image.id);
  14258. const imagesUploading = images.some(img => {
  14259. var _img$url;
  14260. return !img.id && ((_img$url = img.url) === null || _img$url === void 0 ? void 0 : _img$url.indexOf('blob:')) === 0;
  14261. }); // MediaPlaceholder props are different between web and native hence, we provide a platform-specific set.
  14262. const mediaPlaceholderProps = external_wp_element_namespaceObject.Platform.select({
  14263. web: {
  14264. addToGallery: false,
  14265. disableMediaButtons: imagesUploading,
  14266. value: {}
  14267. },
  14268. native: {
  14269. addToGallery: hasImageIds,
  14270. isAppender: hasImages,
  14271. disableMediaButtons: hasImages && !isSelected || imagesUploading,
  14272. value: hasImageIds ? images : {},
  14273. autoOpenMediaUpload: !hasImages && isSelected && wasBlockJustInserted
  14274. }
  14275. });
  14276. const mediaPlaceholder = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, _extends({
  14277. handleUpload: false,
  14278. icon: sharedIcon,
  14279. labels: {
  14280. title: (0,external_wp_i18n_namespaceObject.__)('Gallery'),
  14281. instructions: PLACEHOLDER_TEXT
  14282. },
  14283. onSelect: updateImages,
  14284. accept: "image/*",
  14285. allowedTypes: edit_ALLOWED_MEDIA_TYPES,
  14286. multiple: true,
  14287. onError: onUploadError,
  14288. notices: noticeUI
  14289. }, mediaPlaceholderProps));
  14290. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  14291. className: classnames_default()(className, 'has-nested-images')
  14292. });
  14293. if (!hasImages) {
  14294. return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, mediaPlaceholder);
  14295. }
  14296. const hasLinkTo = linkTo && linkTo !== 'none';
  14297. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  14298. title: (0,external_wp_i18n_namespaceObject.__)('Gallery settings')
  14299. }, images.length > 1 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, _extends({
  14300. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  14301. value: columns ? columns : defaultColumnsNumber(images.length),
  14302. onChange: setColumnsNumber,
  14303. min: 1,
  14304. max: Math.min(MAX_COLUMNS, images.length)
  14305. }, MOBILE_CONTROL_PROPS_RANGE_CONTROL, {
  14306. required: true
  14307. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  14308. label: (0,external_wp_i18n_namespaceObject.__)('Crop images'),
  14309. checked: !!imageCrop,
  14310. onChange: toggleImageCrop,
  14311. help: getImageCropHelp
  14312. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  14313. label: (0,external_wp_i18n_namespaceObject.__)('Link to'),
  14314. value: linkTo,
  14315. onChange: setLinkTo,
  14316. options: linkOptions,
  14317. hideCancelButton: true
  14318. }), hasLinkTo && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  14319. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  14320. checked: linkTarget === '_blank',
  14321. onChange: toggleOpenInNewTab
  14322. }), (imageSizeOptions === null || imageSizeOptions === void 0 ? void 0 : imageSizeOptions.length) > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  14323. label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
  14324. value: sizeSlug,
  14325. options: imageSizeOptions,
  14326. onChange: updateImagesSize,
  14327. hideCancelButton: true
  14328. }), external_wp_element_namespaceObject.Platform.isWeb && !imageSizeOptions && hasImageIds && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  14329. className: 'gallery-image-sizes'
  14330. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_wp_i18n_namespaceObject.__)('Image size')), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, {
  14331. className: 'gallery-image-sizes__loading'
  14332. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_i18n_namespaceObject.__)('Loading options…'))))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  14333. group: "other"
  14334. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  14335. allowedTypes: edit_ALLOWED_MEDIA_TYPES,
  14336. accept: "image/*",
  14337. handleUpload: false,
  14338. onSelect: updateImages,
  14339. name: (0,external_wp_i18n_namespaceObject.__)('Add'),
  14340. multiple: true,
  14341. mediaIds: images.map(image => image.id),
  14342. addToGallery: hasImageIds
  14343. })), noticeUI, external_wp_element_namespaceObject.Platform.isWeb && (0,external_wp_element_namespaceObject.createElement)(GapStyles, {
  14344. blockGap: (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : (_attributes$style$spa = _attributes$style.spacing) === null || _attributes$style$spa === void 0 ? void 0 : _attributes$style$spa.blockGap,
  14345. clientId: clientId
  14346. }), (0,external_wp_element_namespaceObject.createElement)(gallery_gallery, _extends({}, props, {
  14347. images: images,
  14348. mediaPlaceholder: !hasImages || external_wp_element_namespaceObject.Platform.isNative ? mediaPlaceholder : undefined,
  14349. blockProps: blockProps,
  14350. insertBlocksAfter: insertBlocksAfter
  14351. })));
  14352. }
  14353. /* harmony default export */ var gallery_edit = ((0,external_wp_compose_namespaceObject.compose)([external_wp_components_namespaceObject.withNotices, (0,external_wp_viewport_namespaceObject.withViewportMatch)({
  14354. isNarrow: '< small'
  14355. })])(GalleryEdit));
  14356. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/shared.js
  14357. /**
  14358. * External dependencies
  14359. */
  14360. const shared_pickRelevantMediaFiles = function (image) {
  14361. let sizeSlug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'large';
  14362. const imageProps = (0,external_lodash_namespaceObject.pick)(image, ['alt', 'id', 'link', 'caption']);
  14363. imageProps.url = (0,external_lodash_namespaceObject.get)(image, ['sizes', sizeSlug, 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', sizeSlug, 'source_url']) || image.url;
  14364. const fullUrl = (0,external_lodash_namespaceObject.get)(image, ['sizes', 'full', 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', 'full', 'source_url']);
  14365. if (fullUrl) {
  14366. imageProps.fullUrl = fullUrl;
  14367. }
  14368. return imageProps;
  14369. };
  14370. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/image.js
  14371. /**
  14372. * WordPress dependencies
  14373. */
  14374. const image_image = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  14375. viewBox: "0 0 24 24",
  14376. xmlns: "http://www.w3.org/2000/svg"
  14377. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  14378. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"
  14379. }));
  14380. /* harmony default export */ var library_image = (image_image);
  14381. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left.js
  14382. /**
  14383. * WordPress dependencies
  14384. */
  14385. const chevronLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  14386. xmlns: "http://www.w3.org/2000/svg",
  14387. viewBox: "0 0 24 24"
  14388. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  14389. d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"
  14390. }));
  14391. /* harmony default export */ var chevron_left = (chevronLeft);
  14392. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js
  14393. /**
  14394. * WordPress dependencies
  14395. */
  14396. const chevronRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  14397. xmlns: "http://www.w3.org/2000/svg",
  14398. viewBox: "0 0 24 24"
  14399. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  14400. d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
  14401. }));
  14402. /* harmony default export */ var chevron_right = (chevronRight);
  14403. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
  14404. /**
  14405. * WordPress dependencies
  14406. */
  14407. const closeSmall = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  14408. xmlns: "http://www.w3.org/2000/svg",
  14409. viewBox: "0 0 24 24"
  14410. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  14411. d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"
  14412. }));
  14413. /* harmony default export */ var close_small = (closeSmall);
  14414. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/constants.js
  14415. const v1_constants_LINK_DESTINATION_NONE = 'none';
  14416. const v1_constants_LINK_DESTINATION_MEDIA = 'file';
  14417. const v1_constants_LINK_DESTINATION_ATTACHMENT = 'post';
  14418. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/gallery-image.js
  14419. /**
  14420. * External dependencies
  14421. */
  14422. /**
  14423. * WordPress dependencies
  14424. */
  14425. /**
  14426. * Internal dependencies
  14427. */
  14428. const isTemporaryImage = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url);
  14429. class GalleryImage extends external_wp_element_namespaceObject.Component {
  14430. constructor() {
  14431. super(...arguments);
  14432. this.onSelectImage = this.onSelectImage.bind(this);
  14433. this.onRemoveImage = this.onRemoveImage.bind(this);
  14434. this.bindContainer = this.bindContainer.bind(this);
  14435. this.onEdit = this.onEdit.bind(this);
  14436. this.onSelectImageFromLibrary = this.onSelectImageFromLibrary.bind(this);
  14437. this.onSelectCustomURL = this.onSelectCustomURL.bind(this);
  14438. this.state = {
  14439. isEditing: false
  14440. };
  14441. }
  14442. bindContainer(ref) {
  14443. this.container = ref;
  14444. }
  14445. onSelectImage() {
  14446. if (!this.props.isSelected) {
  14447. this.props.onSelect();
  14448. }
  14449. }
  14450. onRemoveImage(event) {
  14451. if (this.container === this.container.ownerDocument.activeElement && this.props.isSelected && [external_wp_keycodes_namespaceObject.BACKSPACE, external_wp_keycodes_namespaceObject.DELETE].indexOf(event.keyCode) !== -1) {
  14452. event.preventDefault();
  14453. this.props.onRemove();
  14454. }
  14455. }
  14456. onEdit() {
  14457. this.setState({
  14458. isEditing: true
  14459. });
  14460. }
  14461. componentDidUpdate() {
  14462. const {
  14463. image,
  14464. url,
  14465. __unstableMarkNextChangeAsNotPersistent
  14466. } = this.props;
  14467. if (image && !url) {
  14468. __unstableMarkNextChangeAsNotPersistent();
  14469. this.props.setAttributes({
  14470. url: image.source_url,
  14471. alt: image.alt_text
  14472. });
  14473. }
  14474. }
  14475. deselectOnBlur() {
  14476. this.props.onDeselect();
  14477. }
  14478. onSelectImageFromLibrary(media) {
  14479. const {
  14480. setAttributes,
  14481. id,
  14482. url,
  14483. alt,
  14484. caption,
  14485. sizeSlug
  14486. } = this.props;
  14487. if (!media || !media.url) {
  14488. return;
  14489. }
  14490. let mediaAttributes = shared_pickRelevantMediaFiles(media, sizeSlug); // If the current image is temporary but an alt text was meanwhile
  14491. // written by the user, make sure the text is not overwritten.
  14492. if (isTemporaryImage(id, url)) {
  14493. if (alt) {
  14494. mediaAttributes = (0,external_lodash_namespaceObject.omit)(mediaAttributes, ['alt']);
  14495. }
  14496. } // If a caption text was meanwhile written by the user,
  14497. // make sure the text is not overwritten by empty captions.
  14498. if (caption && !(0,external_lodash_namespaceObject.get)(mediaAttributes, ['caption'])) {
  14499. mediaAttributes = (0,external_lodash_namespaceObject.omit)(mediaAttributes, ['caption']);
  14500. }
  14501. setAttributes(mediaAttributes);
  14502. this.setState({
  14503. isEditing: false
  14504. });
  14505. }
  14506. onSelectCustomURL(newURL) {
  14507. const {
  14508. setAttributes,
  14509. url
  14510. } = this.props;
  14511. if (newURL !== url) {
  14512. setAttributes({
  14513. url: newURL,
  14514. id: undefined
  14515. });
  14516. this.setState({
  14517. isEditing: false
  14518. });
  14519. }
  14520. }
  14521. render() {
  14522. const {
  14523. url,
  14524. alt,
  14525. id,
  14526. linkTo,
  14527. link,
  14528. isFirstItem,
  14529. isLastItem,
  14530. isSelected,
  14531. caption,
  14532. onRemove,
  14533. onMoveForward,
  14534. onMoveBackward,
  14535. setAttributes,
  14536. 'aria-label': ariaLabel
  14537. } = this.props;
  14538. const {
  14539. isEditing
  14540. } = this.state;
  14541. let href;
  14542. switch (linkTo) {
  14543. case v1_constants_LINK_DESTINATION_MEDIA:
  14544. href = url;
  14545. break;
  14546. case v1_constants_LINK_DESTINATION_ATTACHMENT:
  14547. href = link;
  14548. break;
  14549. }
  14550. const img = // Disable reason: Image itself is not meant to be interactive, but should
  14551. // direct image selection and unfocus caption fields.
  14552. /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
  14553. (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("img", {
  14554. src: url,
  14555. alt: alt,
  14556. "data-id": id,
  14557. onKeyDown: this.onRemoveImage,
  14558. tabIndex: "0",
  14559. "aria-label": ariaLabel,
  14560. ref: this.bindContainer
  14561. }), (0,external_wp_blob_namespaceObject.isBlobURL)(url) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null))
  14562. /* eslint-enable jsx-a11y/no-noninteractive-element-interactions */
  14563. ;
  14564. const className = classnames_default()({
  14565. 'is-selected': isSelected,
  14566. 'is-transient': (0,external_wp_blob_namespaceObject.isBlobURL)(url)
  14567. });
  14568. return (// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
  14569. (0,external_wp_element_namespaceObject.createElement)("figure", {
  14570. className: className,
  14571. onClick: this.onSelectImage,
  14572. onFocus: this.onSelectImage
  14573. }, !isEditing && (href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  14574. href: href
  14575. }, img) : img), isEditing && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  14576. labels: {
  14577. title: (0,external_wp_i18n_namespaceObject.__)('Edit gallery image')
  14578. },
  14579. icon: library_image,
  14580. onSelect: this.onSelectImageFromLibrary,
  14581. onSelectURL: this.onSelectCustomURL,
  14582. accept: "image/*",
  14583. allowedTypes: ['image'],
  14584. value: {
  14585. id,
  14586. src: url
  14587. }
  14588. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, {
  14589. className: "block-library-gallery-item__inline-menu is-left"
  14590. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  14591. icon: chevron_left,
  14592. onClick: isFirstItem ? undefined : onMoveBackward,
  14593. label: (0,external_wp_i18n_namespaceObject.__)('Move image backward'),
  14594. "aria-disabled": isFirstItem,
  14595. disabled: !isSelected
  14596. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  14597. icon: chevron_right,
  14598. onClick: isLastItem ? undefined : onMoveForward,
  14599. label: (0,external_wp_i18n_namespaceObject.__)('Move image forward'),
  14600. "aria-disabled": isLastItem,
  14601. disabled: !isSelected
  14602. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, {
  14603. className: "block-library-gallery-item__inline-menu is-right"
  14604. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  14605. icon: library_edit,
  14606. onClick: this.onEdit,
  14607. label: (0,external_wp_i18n_namespaceObject.__)('Replace image'),
  14608. disabled: !isSelected
  14609. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  14610. icon: close_small,
  14611. onClick: onRemove,
  14612. label: (0,external_wp_i18n_namespaceObject.__)('Remove image'),
  14613. disabled: !isSelected
  14614. })), !isEditing && (isSelected || caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  14615. tagName: "figcaption",
  14616. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Image caption text'),
  14617. placeholder: isSelected ? (0,external_wp_i18n_namespaceObject.__)('Add caption') : null,
  14618. value: caption,
  14619. onChange: newCaption => setAttributes({
  14620. caption: newCaption
  14621. }),
  14622. inlineToolbar: true
  14623. }))
  14624. );
  14625. }
  14626. }
  14627. /* harmony default export */ var gallery_image = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)((select, ownProps) => {
  14628. const {
  14629. getMedia
  14630. } = select(external_wp_coreData_namespaceObject.store);
  14631. const {
  14632. id
  14633. } = ownProps;
  14634. return {
  14635. image: id ? getMedia(parseInt(id, 10)) : null
  14636. };
  14637. }), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => {
  14638. const {
  14639. __unstableMarkNextChangeAsNotPersistent
  14640. } = dispatch(external_wp_blockEditor_namespaceObject.store);
  14641. return {
  14642. __unstableMarkNextChangeAsNotPersistent
  14643. };
  14644. })])(GalleryImage));
  14645. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/gallery.js
  14646. /**
  14647. * External dependencies
  14648. */
  14649. /**
  14650. * WordPress dependencies
  14651. */
  14652. /**
  14653. * Internal dependencies
  14654. */
  14655. const gallery_Gallery = props => {
  14656. const {
  14657. attributes,
  14658. isSelected,
  14659. setAttributes,
  14660. selectedImage,
  14661. mediaPlaceholder,
  14662. onMoveBackward,
  14663. onMoveForward,
  14664. onRemoveImage,
  14665. onSelectImage,
  14666. onDeselectImage,
  14667. onSetImageAttributes,
  14668. insertBlocksAfter,
  14669. blockProps
  14670. } = props;
  14671. const {
  14672. align,
  14673. columns = defaultColumnsNumberV1(attributes),
  14674. caption,
  14675. imageCrop,
  14676. images
  14677. } = attributes;
  14678. return (0,external_wp_element_namespaceObject.createElement)("figure", _extends({}, blockProps, {
  14679. className: classnames_default()(blockProps.className, {
  14680. [`align${align}`]: align,
  14681. [`columns-${columns}`]: columns,
  14682. 'is-cropped': imageCrop
  14683. })
  14684. }), (0,external_wp_element_namespaceObject.createElement)("ul", {
  14685. className: "blocks-gallery-grid"
  14686. }, images.map((img, index) => {
  14687. const ariaLabel = (0,external_wp_i18n_namespaceObject.sprintf)(
  14688. /* translators: 1: the order number of the image. 2: the total number of images. */
  14689. (0,external_wp_i18n_namespaceObject.__)('image %1$d of %2$d in gallery'), index + 1, images.length);
  14690. return (0,external_wp_element_namespaceObject.createElement)("li", {
  14691. className: "blocks-gallery-item",
  14692. key: img.id ? `${img.id}-${index}` : img.url
  14693. }, (0,external_wp_element_namespaceObject.createElement)(gallery_image, {
  14694. url: img.url,
  14695. alt: img.alt,
  14696. id: img.id,
  14697. isFirstItem: index === 0,
  14698. isLastItem: index + 1 === images.length,
  14699. isSelected: isSelected && selectedImage === index,
  14700. onMoveBackward: onMoveBackward(index),
  14701. onMoveForward: onMoveForward(index),
  14702. onRemove: onRemoveImage(index),
  14703. onSelect: onSelectImage(index),
  14704. onDeselect: onDeselectImage(index),
  14705. setAttributes: attrs => onSetImageAttributes(index, attrs),
  14706. caption: img.caption,
  14707. "aria-label": ariaLabel,
  14708. sizeSlug: attributes.sizeSlug
  14709. }));
  14710. })), mediaPlaceholder, (0,external_wp_element_namespaceObject.createElement)(gallery_RichTextVisibilityHelper, {
  14711. isHidden: !isSelected && external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption),
  14712. tagName: "figcaption",
  14713. className: "blocks-gallery-caption",
  14714. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Gallery caption text'),
  14715. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write gallery caption…'),
  14716. value: caption,
  14717. onChange: value => setAttributes({
  14718. caption: value
  14719. }),
  14720. inlineToolbar: true,
  14721. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
  14722. }));
  14723. };
  14724. function gallery_RichTextVisibilityHelper(_ref) {
  14725. let {
  14726. isHidden,
  14727. ...richTextProps
  14728. } = _ref;
  14729. return isHidden ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, _extends({
  14730. as: external_wp_blockEditor_namespaceObject.RichText
  14731. }, richTextProps)) : (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, richTextProps);
  14732. }
  14733. /* harmony default export */ var v1_gallery = (gallery_Gallery);
  14734. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/edit.js
  14735. /**
  14736. * External dependencies
  14737. */
  14738. /**
  14739. * WordPress dependencies
  14740. */
  14741. /**
  14742. * Internal dependencies
  14743. */
  14744. const edit_MAX_COLUMNS = 8;
  14745. const edit_linkOptions = [{
  14746. value: v1_constants_LINK_DESTINATION_ATTACHMENT,
  14747. label: (0,external_wp_i18n_namespaceObject.__)('Attachment Page')
  14748. }, {
  14749. value: v1_constants_LINK_DESTINATION_MEDIA,
  14750. label: (0,external_wp_i18n_namespaceObject.__)('Media File')
  14751. }, {
  14752. value: v1_constants_LINK_DESTINATION_NONE,
  14753. label: (0,external_wp_i18n_namespaceObject.__)('None')
  14754. }];
  14755. const v1_edit_ALLOWED_MEDIA_TYPES = ['image'];
  14756. const edit_PLACEHOLDER_TEXT = external_wp_element_namespaceObject.Platform.select({
  14757. web: (0,external_wp_i18n_namespaceObject.__)('Drag images, upload new ones or select files from your library.'),
  14758. native: (0,external_wp_i18n_namespaceObject.__)('ADD MEDIA')
  14759. });
  14760. const edit_MOBILE_CONTROL_PROPS_RANGE_CONTROL = external_wp_element_namespaceObject.Platform.select({
  14761. web: {},
  14762. native: {
  14763. type: 'stepper'
  14764. }
  14765. });
  14766. function edit_GalleryEdit(props) {
  14767. const {
  14768. attributes,
  14769. clientId,
  14770. isSelected,
  14771. noticeUI,
  14772. noticeOperations,
  14773. onFocus
  14774. } = props;
  14775. const {
  14776. columns = defaultColumnsNumberV1(attributes),
  14777. imageCrop,
  14778. images,
  14779. linkTo,
  14780. sizeSlug
  14781. } = attributes;
  14782. const [selectedImage, setSelectedImage] = (0,external_wp_element_namespaceObject.useState)();
  14783. const [attachmentCaptions, setAttachmentCaptions] = (0,external_wp_element_namespaceObject.useState)();
  14784. const {
  14785. __unstableMarkNextChangeAsNotPersistent
  14786. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  14787. const {
  14788. imageSizes,
  14789. mediaUpload,
  14790. getMedia,
  14791. wasBlockJustInserted
  14792. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  14793. const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
  14794. return {
  14795. imageSizes: settings.imageSizes,
  14796. mediaUpload: settings.mediaUpload,
  14797. getMedia: select(external_wp_coreData_namespaceObject.store).getMedia,
  14798. wasBlockJustInserted: select(external_wp_blockEditor_namespaceObject.store).wasBlockJustInserted(clientId, 'inserter_menu')
  14799. };
  14800. });
  14801. const resizedImages = (0,external_wp_element_namespaceObject.useMemo)(() => {
  14802. if (isSelected) {
  14803. return (0,external_lodash_namespaceObject.reduce)(attributes.ids, (currentResizedImages, id) => {
  14804. if (!id) {
  14805. return currentResizedImages;
  14806. }
  14807. const image = getMedia(id);
  14808. const sizes = (0,external_lodash_namespaceObject.reduce)(imageSizes, (currentSizes, size) => {
  14809. const defaultUrl = (0,external_lodash_namespaceObject.get)(image, ['sizes', size.slug, 'url']);
  14810. const mediaDetailsUrl = (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', size.slug, 'source_url']);
  14811. return { ...currentSizes,
  14812. [size.slug]: defaultUrl || mediaDetailsUrl
  14813. };
  14814. }, {});
  14815. return { ...currentResizedImages,
  14816. [parseInt(id, 10)]: sizes
  14817. };
  14818. }, {});
  14819. }
  14820. return {};
  14821. }, [isSelected, attributes.ids, imageSizes]);
  14822. function onFocusGalleryCaption() {
  14823. setSelectedImage();
  14824. }
  14825. function setAttributes(newAttrs) {
  14826. if (newAttrs.ids) {
  14827. throw new Error('The "ids" attribute should not be changed directly. It is managed automatically when "images" attribute changes');
  14828. }
  14829. if (newAttrs.images) {
  14830. newAttrs = { ...newAttrs,
  14831. // Unlike images[ n ].id which is a string, always ensure the
  14832. // ids array contains numbers as per its attribute type.
  14833. ids: (0,external_lodash_namespaceObject.map)(newAttrs.images, _ref => {
  14834. let {
  14835. id
  14836. } = _ref;
  14837. return parseInt(id, 10);
  14838. })
  14839. };
  14840. }
  14841. props.setAttributes(newAttrs);
  14842. }
  14843. function onSelectImage(index) {
  14844. return () => {
  14845. setSelectedImage(index);
  14846. };
  14847. }
  14848. function onDeselectImage() {
  14849. return () => {
  14850. setSelectedImage();
  14851. };
  14852. }
  14853. function onMove(oldIndex, newIndex) {
  14854. const newImages = [...images];
  14855. newImages.splice(newIndex, 1, images[oldIndex]);
  14856. newImages.splice(oldIndex, 1, images[newIndex]);
  14857. setSelectedImage(newIndex);
  14858. setAttributes({
  14859. images: newImages
  14860. });
  14861. }
  14862. function onMoveForward(oldIndex) {
  14863. return () => {
  14864. if (oldIndex === images.length - 1) {
  14865. return;
  14866. }
  14867. onMove(oldIndex, oldIndex + 1);
  14868. };
  14869. }
  14870. function onMoveBackward(oldIndex) {
  14871. return () => {
  14872. if (oldIndex === 0) {
  14873. return;
  14874. }
  14875. onMove(oldIndex, oldIndex - 1);
  14876. };
  14877. }
  14878. function onRemoveImage(index) {
  14879. return () => {
  14880. const newImages = (0,external_lodash_namespaceObject.filter)(images, (img, i) => index !== i);
  14881. setSelectedImage();
  14882. setAttributes({
  14883. images: newImages,
  14884. columns: attributes.columns ? Math.min(newImages.length, attributes.columns) : attributes.columns
  14885. });
  14886. };
  14887. }
  14888. function selectCaption(newImage) {
  14889. // The image id in both the images and attachmentCaptions arrays is a
  14890. // string, so ensure comparison works correctly by converting the
  14891. // newImage.id to a string.
  14892. const newImageId = (0,external_lodash_namespaceObject.toString)(newImage.id);
  14893. const currentImage = (0,external_lodash_namespaceObject.find)(images, {
  14894. id: newImageId
  14895. });
  14896. const currentImageCaption = currentImage ? currentImage.caption : newImage.caption;
  14897. if (!attachmentCaptions) {
  14898. return currentImageCaption;
  14899. }
  14900. const attachment = (0,external_lodash_namespaceObject.find)(attachmentCaptions, {
  14901. id: newImageId
  14902. }); // If the attachment caption is updated.
  14903. if (attachment && attachment.caption !== newImage.caption) {
  14904. return newImage.caption;
  14905. }
  14906. return currentImageCaption;
  14907. }
  14908. function onSelectImages(newImages) {
  14909. setAttachmentCaptions(newImages.map(newImage => ({
  14910. // Store the attachmentCaption id as a string for consistency
  14911. // with the type of the id in the images attribute.
  14912. id: (0,external_lodash_namespaceObject.toString)(newImage.id),
  14913. caption: newImage.caption
  14914. })));
  14915. setAttributes({
  14916. images: newImages.map(newImage => ({ ...shared_pickRelevantMediaFiles(newImage, sizeSlug),
  14917. caption: selectCaption(newImage, images, attachmentCaptions),
  14918. // The id value is stored in a data attribute, so when the
  14919. // block is parsed it's converted to a string. Converting
  14920. // to a string here ensures it's type is consistent.
  14921. id: (0,external_lodash_namespaceObject.toString)(newImage.id)
  14922. })),
  14923. columns: attributes.columns ? Math.min(newImages.length, attributes.columns) : attributes.columns
  14924. });
  14925. }
  14926. function onUploadError(message) {
  14927. noticeOperations.removeAllNotices();
  14928. noticeOperations.createErrorNotice(message);
  14929. }
  14930. function setLinkTo(value) {
  14931. setAttributes({
  14932. linkTo: value
  14933. });
  14934. }
  14935. function setColumnsNumber(value) {
  14936. setAttributes({
  14937. columns: value
  14938. });
  14939. }
  14940. function toggleImageCrop() {
  14941. setAttributes({
  14942. imageCrop: !imageCrop
  14943. });
  14944. }
  14945. function getImageCropHelp(checked) {
  14946. return checked ? (0,external_wp_i18n_namespaceObject.__)('Thumbnails are cropped to align.') : (0,external_wp_i18n_namespaceObject.__)('Thumbnails are not cropped.');
  14947. }
  14948. function setImageAttributes(index, newAttributes) {
  14949. if (!images[index]) {
  14950. return;
  14951. }
  14952. setAttributes({
  14953. images: [...images.slice(0, index), { ...images[index],
  14954. ...newAttributes
  14955. }, ...images.slice(index + 1)]
  14956. });
  14957. }
  14958. function getImagesSizeOptions() {
  14959. return (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(imageSizes, _ref2 => {
  14960. let {
  14961. slug
  14962. } = _ref2;
  14963. return (0,external_lodash_namespaceObject.some)(resizedImages, sizes => sizes[slug]);
  14964. }), _ref3 => {
  14965. let {
  14966. name,
  14967. slug
  14968. } = _ref3;
  14969. return {
  14970. value: slug,
  14971. label: name
  14972. };
  14973. });
  14974. }
  14975. function updateImagesSize(newSizeSlug) {
  14976. const updatedImages = (0,external_lodash_namespaceObject.map)(images, image => {
  14977. if (!image.id) {
  14978. return image;
  14979. }
  14980. const url = (0,external_lodash_namespaceObject.get)(resizedImages, [parseInt(image.id, 10), newSizeSlug]);
  14981. return { ...image,
  14982. ...(url && {
  14983. url
  14984. })
  14985. };
  14986. });
  14987. setAttributes({
  14988. images: updatedImages,
  14989. sizeSlug: newSizeSlug
  14990. });
  14991. }
  14992. (0,external_wp_element_namespaceObject.useEffect)(() => {
  14993. if (external_wp_element_namespaceObject.Platform.OS === 'web' && images && images.length > 0 && (0,external_lodash_namespaceObject.every)(images, _ref4 => {
  14994. let {
  14995. url
  14996. } = _ref4;
  14997. return (0,external_wp_blob_namespaceObject.isBlobURL)(url);
  14998. })) {
  14999. const filesList = (0,external_lodash_namespaceObject.map)(images, _ref5 => {
  15000. let {
  15001. url
  15002. } = _ref5;
  15003. return (0,external_wp_blob_namespaceObject.getBlobByURL)(url);
  15004. });
  15005. (0,external_lodash_namespaceObject.forEach)(images, _ref6 => {
  15006. let {
  15007. url
  15008. } = _ref6;
  15009. return (0,external_wp_blob_namespaceObject.revokeBlobURL)(url);
  15010. });
  15011. mediaUpload({
  15012. filesList,
  15013. onFileChange: onSelectImages,
  15014. allowedTypes: ['image']
  15015. });
  15016. }
  15017. }, []);
  15018. (0,external_wp_element_namespaceObject.useEffect)(() => {
  15019. // Deselect images when deselecting the block.
  15020. if (!isSelected) {
  15021. setSelectedImage();
  15022. }
  15023. }, [isSelected]);
  15024. (0,external_wp_element_namespaceObject.useEffect)(() => {
  15025. // linkTo attribute must be saved so blocks don't break when changing
  15026. // image_default_link_type in options.php.
  15027. if (!linkTo) {
  15028. var _window, _window$wp, _window$wp$media, _window$wp$media$view, _window$wp$media$view2, _window$wp$media$view3;
  15029. __unstableMarkNextChangeAsNotPersistent();
  15030. setAttributes({
  15031. linkTo: ((_window = window) === null || _window === void 0 ? void 0 : (_window$wp = _window.wp) === null || _window$wp === void 0 ? void 0 : (_window$wp$media = _window$wp.media) === null || _window$wp$media === void 0 ? void 0 : (_window$wp$media$view = _window$wp$media.view) === null || _window$wp$media$view === void 0 ? void 0 : (_window$wp$media$view2 = _window$wp$media$view.settings) === null || _window$wp$media$view2 === void 0 ? void 0 : (_window$wp$media$view3 = _window$wp$media$view2.defaultProps) === null || _window$wp$media$view3 === void 0 ? void 0 : _window$wp$media$view3.link) || v1_constants_LINK_DESTINATION_NONE
  15032. });
  15033. }
  15034. }, [linkTo]);
  15035. const hasImages = !!images.length;
  15036. const hasImageIds = hasImages && images.some(image => !!image.id);
  15037. const mediaPlaceholder = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  15038. addToGallery: hasImageIds,
  15039. isAppender: hasImages,
  15040. disableMediaButtons: hasImages && !isSelected,
  15041. icon: !hasImages && sharedIcon,
  15042. labels: {
  15043. title: !hasImages && (0,external_wp_i18n_namespaceObject.__)('Gallery'),
  15044. instructions: !hasImages && edit_PLACEHOLDER_TEXT
  15045. },
  15046. onSelect: onSelectImages,
  15047. accept: "image/*",
  15048. allowedTypes: v1_edit_ALLOWED_MEDIA_TYPES,
  15049. multiple: true,
  15050. value: hasImageIds ? images : {},
  15051. onError: onUploadError,
  15052. notices: hasImages ? undefined : noticeUI,
  15053. onFocus: onFocus,
  15054. autoOpenMediaUpload: !hasImages && isSelected && wasBlockJustInserted
  15055. });
  15056. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  15057. if (!hasImages) {
  15058. return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, mediaPlaceholder);
  15059. }
  15060. const imageSizeOptions = getImagesSizeOptions();
  15061. const shouldShowSizeOptions = hasImages && !(0,external_lodash_namespaceObject.isEmpty)(imageSizeOptions);
  15062. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  15063. title: (0,external_wp_i18n_namespaceObject.__)('Gallery settings')
  15064. }, images.length > 1 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, _extends({
  15065. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  15066. value: columns,
  15067. onChange: setColumnsNumber,
  15068. min: 1,
  15069. max: Math.min(edit_MAX_COLUMNS, images.length)
  15070. }, edit_MOBILE_CONTROL_PROPS_RANGE_CONTROL, {
  15071. required: true
  15072. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  15073. label: (0,external_wp_i18n_namespaceObject.__)('Crop images'),
  15074. checked: !!imageCrop,
  15075. onChange: toggleImageCrop,
  15076. help: getImageCropHelp
  15077. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  15078. label: (0,external_wp_i18n_namespaceObject.__)('Link to'),
  15079. value: linkTo,
  15080. onChange: setLinkTo,
  15081. options: edit_linkOptions,
  15082. hideCancelButton: true
  15083. }), shouldShowSizeOptions && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  15084. label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
  15085. value: sizeSlug,
  15086. options: imageSizeOptions,
  15087. onChange: updateImagesSize,
  15088. hideCancelButton: true
  15089. }))), noticeUI, (0,external_wp_element_namespaceObject.createElement)(v1_gallery, _extends({}, props, {
  15090. selectedImage: selectedImage,
  15091. mediaPlaceholder: mediaPlaceholder,
  15092. onMoveBackward: onMoveBackward,
  15093. onMoveForward: onMoveForward,
  15094. onRemoveImage: onRemoveImage,
  15095. onSelectImage: onSelectImage,
  15096. onDeselectImage: onDeselectImage,
  15097. onSetImageAttributes: setImageAttributes,
  15098. blockProps: blockProps // This prop is used by gallery.native.js.
  15099. ,
  15100. onFocusGalleryCaption: onFocusGalleryCaption
  15101. })));
  15102. }
  15103. /* harmony default export */ var v1_edit = ((0,external_wp_compose_namespaceObject.compose)([external_wp_components_namespaceObject.withNotices, (0,external_wp_viewport_namespaceObject.withViewportMatch)({
  15104. isNarrow: '< small'
  15105. })])(edit_GalleryEdit));
  15106. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/edit-wrapper.js
  15107. /**
  15108. * WordPress dependencies
  15109. */
  15110. /**
  15111. * Internal dependencies
  15112. */
  15113. /*
  15114. * Using a wrapper around the logic to load the edit for v1 of Gallery block
  15115. * or the refactored version with InnerBlocks. This is to prevent conditional
  15116. * use of hooks lint errors if adding this logic to the top of the edit component.
  15117. */
  15118. function GalleryEditWrapper(props) {
  15119. if (!isGalleryV2Enabled()) {
  15120. return (0,external_wp_element_namespaceObject.createElement)(v1_edit, props);
  15121. }
  15122. return (0,external_wp_element_namespaceObject.createElement)(gallery_edit, props);
  15123. }
  15124. /* harmony default export */ var edit_wrapper = ((0,external_wp_compose_namespaceObject.compose)([external_wp_components_namespaceObject.withNotices])(GalleryEditWrapper));
  15125. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/save.js
  15126. /**
  15127. * WordPress dependencies
  15128. */
  15129. /**
  15130. * Internal dependencies
  15131. */
  15132. function saveV1(_ref) {
  15133. let {
  15134. attributes
  15135. } = _ref;
  15136. const {
  15137. images,
  15138. columns = defaultColumnsNumberV1(attributes),
  15139. imageCrop,
  15140. caption,
  15141. linkTo
  15142. } = attributes;
  15143. const className = `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`;
  15144. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  15145. className
  15146. }), (0,external_wp_element_namespaceObject.createElement)("ul", {
  15147. className: "blocks-gallery-grid"
  15148. }, images.map(image => {
  15149. let href;
  15150. switch (linkTo) {
  15151. case v1_constants_LINK_DESTINATION_MEDIA:
  15152. href = image.fullUrl || image.url;
  15153. break;
  15154. case v1_constants_LINK_DESTINATION_ATTACHMENT:
  15155. href = image.link;
  15156. break;
  15157. }
  15158. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  15159. src: image.url,
  15160. alt: image.alt,
  15161. "data-id": image.id,
  15162. "data-full-url": image.fullUrl,
  15163. "data-link": image.link,
  15164. className: image.id ? `wp-image-${image.id}` : null
  15165. });
  15166. return (0,external_wp_element_namespaceObject.createElement)("li", {
  15167. key: image.id || image.url,
  15168. className: "blocks-gallery-item"
  15169. }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  15170. href: href
  15171. }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  15172. tagName: "figcaption",
  15173. className: "blocks-gallery-item__caption",
  15174. value: image.caption
  15175. })));
  15176. })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  15177. tagName: "figcaption",
  15178. className: "blocks-gallery-caption",
  15179. value: caption
  15180. }));
  15181. }
  15182. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/save.js
  15183. /**
  15184. * External dependencies
  15185. */
  15186. /**
  15187. * WordPress dependencies
  15188. */
  15189. /**
  15190. * Internal dependencies
  15191. */
  15192. function saveWithInnerBlocks(_ref) {
  15193. let {
  15194. attributes
  15195. } = _ref;
  15196. if (!isGalleryV2Enabled()) {
  15197. return saveV1({
  15198. attributes
  15199. });
  15200. }
  15201. const {
  15202. caption,
  15203. columns,
  15204. imageCrop
  15205. } = attributes;
  15206. const className = classnames_default()('has-nested-images', {
  15207. [`columns-${columns}`]: columns !== undefined,
  15208. [`columns-default`]: columns === undefined,
  15209. 'is-cropped': imageCrop
  15210. });
  15211. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
  15212. className
  15213. });
  15214. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  15215. return (0,external_wp_element_namespaceObject.createElement)("figure", innerBlocksProps, innerBlocksProps.children, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  15216. tagName: "figcaption",
  15217. className: "blocks-gallery-caption",
  15218. value: caption
  15219. }));
  15220. }
  15221. ;// CONCATENATED MODULE: external ["wp","hooks"]
  15222. var external_wp_hooks_namespaceObject = window["wp"]["hooks"];
  15223. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/transforms.js
  15224. /**
  15225. * External dependencies
  15226. */
  15227. /**
  15228. * WordPress dependencies
  15229. */
  15230. /**
  15231. * Internal dependencies
  15232. */
  15233. const parseShortcodeIds = ids => {
  15234. if (!ids) {
  15235. return [];
  15236. }
  15237. return ids.split(',').map(id => parseInt(id, 10));
  15238. };
  15239. /**
  15240. * Third party block plugins don't have an easy way to detect if the
  15241. * innerBlocks version of the Gallery is running when they run a
  15242. * 3rdPartyBlock -> GalleryBlock transform so this tranform filter
  15243. * will handle this. Once the innerBlocks version is the default
  15244. * in a core release, this could be deprecated and removed after
  15245. * plugin authors have been given time to update transforms.
  15246. *
  15247. * @typedef {Object} Attributes
  15248. * @typedef {Object} Block
  15249. * @property {Attributes} attributes The attributes of the block.
  15250. * @param {Block} block The transformed block.
  15251. * @return {Block} The transformed block.
  15252. */
  15253. function updateThirdPartyTransformToGallery(block) {
  15254. var _block$attributes;
  15255. if (isGalleryV2Enabled() && block.name === 'core/gallery' && ((_block$attributes = block.attributes) === null || _block$attributes === void 0 ? void 0 : _block$attributes.images.length) > 0) {
  15256. const innerBlocks = block.attributes.images.map(_ref => {
  15257. let {
  15258. url,
  15259. id,
  15260. alt
  15261. } = _ref;
  15262. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  15263. url,
  15264. id: id ? parseInt(id, 10) : null,
  15265. alt,
  15266. sizeSlug: block.attributes.sizeSlug,
  15267. linkDestination: block.attributes.linkDestination
  15268. });
  15269. });
  15270. delete block.attributes.ids;
  15271. delete block.attributes.images;
  15272. block.innerBlocks = innerBlocks;
  15273. }
  15274. return block;
  15275. }
  15276. (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/gallery/update-third-party-transform-to', updateThirdPartyTransformToGallery);
  15277. /**
  15278. * Third party block plugins don't have an easy way to detect if the
  15279. * innerBlocks version of the Gallery is running when they run a
  15280. * GalleryBlock -> 3rdPartyBlock transform so this transform filter
  15281. * will handle this. Once the innerBlocks version is the default
  15282. * in a core release, this could be deprecated and removed after
  15283. * plugin authors have been given time to update transforms.
  15284. *
  15285. * @typedef {Object} Attributes
  15286. * @typedef {Object} Block
  15287. * @property {Attributes} attributes The attributes of the block.
  15288. * @param {Block} toBlock The block to transform to.
  15289. * @param {Block[]} fromBlocks The blocks to transform from.
  15290. * @return {Block} The transformed block.
  15291. */
  15292. function updateThirdPartyTransformFromGallery(toBlock, fromBlocks) {
  15293. const from = Array.isArray(fromBlocks) ? fromBlocks : [fromBlocks];
  15294. const galleryBlock = from.find(transformedBlock => {
  15295. var _transformedBlock$att;
  15296. return transformedBlock.name === 'core/gallery' && transformedBlock.innerBlocks.length > 0 && !((_transformedBlock$att = transformedBlock.attributes.images) !== null && _transformedBlock$att !== void 0 && _transformedBlock$att.length) > 0 && !toBlock.name.includes('core/');
  15297. });
  15298. if (galleryBlock) {
  15299. const images = galleryBlock.innerBlocks.map(_ref2 => {
  15300. let {
  15301. attributes: {
  15302. url,
  15303. id,
  15304. alt
  15305. }
  15306. } = _ref2;
  15307. return {
  15308. url,
  15309. id: id ? parseInt(id, 10) : null,
  15310. alt
  15311. };
  15312. });
  15313. const ids = images.map(_ref3 => {
  15314. let {
  15315. id
  15316. } = _ref3;
  15317. return id;
  15318. });
  15319. galleryBlock.attributes.images = images;
  15320. galleryBlock.attributes.ids = ids;
  15321. }
  15322. return toBlock;
  15323. }
  15324. (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/gallery/update-third-party-transform-from', updateThirdPartyTransformFromGallery);
  15325. const gallery_transforms_transforms = {
  15326. from: [{
  15327. type: 'block',
  15328. isMultiBlock: true,
  15329. blocks: ['core/image'],
  15330. transform: attributes => {
  15331. // Init the align and size from the first item which may be either the placeholder or an image.
  15332. let {
  15333. align,
  15334. sizeSlug
  15335. } = attributes[0]; // Loop through all the images and check if they have the same align and size.
  15336. align = (0,external_lodash_namespaceObject.every)(attributes, ['align', align]) ? align : undefined;
  15337. sizeSlug = (0,external_lodash_namespaceObject.every)(attributes, ['sizeSlug', sizeSlug]) ? sizeSlug : undefined;
  15338. const validImages = (0,external_lodash_namespaceObject.filter)(attributes, _ref4 => {
  15339. let {
  15340. url
  15341. } = _ref4;
  15342. return url;
  15343. });
  15344. if (isGalleryV2Enabled()) {
  15345. const innerBlocks = validImages.map(image => {
  15346. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', image);
  15347. });
  15348. return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {
  15349. align,
  15350. sizeSlug
  15351. }, innerBlocks);
  15352. }
  15353. return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {
  15354. images: validImages.map(_ref5 => {
  15355. let {
  15356. id,
  15357. url,
  15358. alt,
  15359. caption
  15360. } = _ref5;
  15361. return {
  15362. id: (0,external_lodash_namespaceObject.toString)(id),
  15363. url,
  15364. alt,
  15365. caption
  15366. };
  15367. }),
  15368. ids: validImages.map(_ref6 => {
  15369. let {
  15370. id
  15371. } = _ref6;
  15372. return parseInt(id, 10);
  15373. }),
  15374. align,
  15375. sizeSlug
  15376. });
  15377. }
  15378. }, {
  15379. type: 'shortcode',
  15380. tag: 'gallery',
  15381. attributes: {
  15382. images: {
  15383. type: 'array',
  15384. shortcode: _ref7 => {
  15385. let {
  15386. named: {
  15387. ids
  15388. }
  15389. } = _ref7;
  15390. if (!isGalleryV2Enabled()) {
  15391. return parseShortcodeIds(ids).map(id => ({
  15392. id: (0,external_lodash_namespaceObject.toString)(id)
  15393. }));
  15394. }
  15395. }
  15396. },
  15397. ids: {
  15398. type: 'array',
  15399. shortcode: _ref8 => {
  15400. let {
  15401. named: {
  15402. ids
  15403. }
  15404. } = _ref8;
  15405. if (!isGalleryV2Enabled()) {
  15406. return parseShortcodeIds(ids);
  15407. }
  15408. }
  15409. },
  15410. shortCodeTransforms: {
  15411. type: 'array',
  15412. shortcode: _ref9 => {
  15413. let {
  15414. named: {
  15415. ids
  15416. }
  15417. } = _ref9;
  15418. if (isGalleryV2Enabled()) {
  15419. return parseShortcodeIds(ids).map(id => ({
  15420. id: parseInt(id)
  15421. }));
  15422. }
  15423. }
  15424. },
  15425. columns: {
  15426. type: 'number',
  15427. shortcode: _ref10 => {
  15428. let {
  15429. named: {
  15430. columns = '3'
  15431. }
  15432. } = _ref10;
  15433. return parseInt(columns, 10);
  15434. }
  15435. },
  15436. linkTo: {
  15437. type: 'string',
  15438. shortcode: _ref11 => {
  15439. let {
  15440. named: {
  15441. link
  15442. }
  15443. } = _ref11;
  15444. if (!isGalleryV2Enabled()) {
  15445. switch (link) {
  15446. case 'post':
  15447. return v1_constants_LINK_DESTINATION_ATTACHMENT;
  15448. case 'file':
  15449. return v1_constants_LINK_DESTINATION_MEDIA;
  15450. default:
  15451. return v1_constants_LINK_DESTINATION_ATTACHMENT;
  15452. }
  15453. }
  15454. switch (link) {
  15455. case 'post':
  15456. return LINK_DESTINATION_ATTACHMENT;
  15457. case 'file':
  15458. return LINK_DESTINATION_MEDIA;
  15459. default:
  15460. return LINK_DESTINATION_NONE;
  15461. }
  15462. }
  15463. }
  15464. },
  15465. isMatch(_ref12) {
  15466. let {
  15467. named
  15468. } = _ref12;
  15469. return undefined !== named.ids;
  15470. }
  15471. }, {
  15472. // When created by drag and dropping multiple files on an insertion point. Because multiple
  15473. // files must not be transformed to a gallery when dropped within a gallery there is another transform
  15474. // within the image block to handle that case. Therefore this transform has to have priority 1
  15475. // set so that it overrrides the image block transformation when mulitple images are dropped outside
  15476. // of a gallery block.
  15477. type: 'files',
  15478. priority: 1,
  15479. isMatch(files) {
  15480. return files.length !== 1 && (0,external_lodash_namespaceObject.every)(files, file => file.type.indexOf('image/') === 0);
  15481. },
  15482. transform(files) {
  15483. if (isGalleryV2Enabled()) {
  15484. const innerBlocks = files.map(file => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  15485. url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  15486. }));
  15487. return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {}, innerBlocks);
  15488. }
  15489. const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {
  15490. images: files.map(file => pickRelevantMediaFiles({
  15491. url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  15492. }))
  15493. });
  15494. return block;
  15495. }
  15496. }],
  15497. to: [{
  15498. type: 'block',
  15499. blocks: ['core/image'],
  15500. transform: (_ref13, innerBlocks) => {
  15501. let {
  15502. align,
  15503. images,
  15504. ids,
  15505. sizeSlug
  15506. } = _ref13;
  15507. if (isGalleryV2Enabled()) {
  15508. if (innerBlocks.length > 0) {
  15509. return innerBlocks.map(_ref14 => {
  15510. let {
  15511. attributes: {
  15512. id,
  15513. url,
  15514. alt,
  15515. caption,
  15516. sizeSlug: imageSizeSlug,
  15517. linkDestination,
  15518. href,
  15519. linkTarget
  15520. }
  15521. } = _ref14;
  15522. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  15523. id,
  15524. url,
  15525. alt,
  15526. caption,
  15527. sizeSlug: imageSizeSlug,
  15528. align,
  15529. linkDestination,
  15530. href,
  15531. linkTarget
  15532. });
  15533. });
  15534. }
  15535. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  15536. align
  15537. });
  15538. }
  15539. if (images.length > 0) {
  15540. return images.map((_ref15, index) => {
  15541. let {
  15542. url,
  15543. alt,
  15544. caption
  15545. } = _ref15;
  15546. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  15547. id: ids[index],
  15548. url,
  15549. alt,
  15550. caption,
  15551. align,
  15552. sizeSlug
  15553. });
  15554. });
  15555. }
  15556. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  15557. align
  15558. });
  15559. }
  15560. }]
  15561. };
  15562. /* harmony default export */ var gallery_transforms = (gallery_transforms_transforms);
  15563. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/index.js
  15564. /**
  15565. * WordPress dependencies
  15566. */
  15567. /**
  15568. * Internal dependencies
  15569. */
  15570. const gallery_metadata = {
  15571. $schema: "https://schemas.wp.org/trunk/block.json",
  15572. apiVersion: 2,
  15573. name: "core/gallery",
  15574. title: "Gallery",
  15575. category: "media",
  15576. description: "Display multiple images in a rich gallery.",
  15577. keywords: ["images", "photos"],
  15578. textdomain: "default",
  15579. attributes: {
  15580. images: {
  15581. type: "array",
  15582. "default": [],
  15583. source: "query",
  15584. selector: ".blocks-gallery-item",
  15585. query: {
  15586. url: {
  15587. type: "string",
  15588. source: "attribute",
  15589. selector: "img",
  15590. attribute: "src"
  15591. },
  15592. fullUrl: {
  15593. type: "string",
  15594. source: "attribute",
  15595. selector: "img",
  15596. attribute: "data-full-url"
  15597. },
  15598. link: {
  15599. type: "string",
  15600. source: "attribute",
  15601. selector: "img",
  15602. attribute: "data-link"
  15603. },
  15604. alt: {
  15605. type: "string",
  15606. source: "attribute",
  15607. selector: "img",
  15608. attribute: "alt",
  15609. "default": ""
  15610. },
  15611. id: {
  15612. type: "string",
  15613. source: "attribute",
  15614. selector: "img",
  15615. attribute: "data-id"
  15616. },
  15617. caption: {
  15618. type: "string",
  15619. source: "html",
  15620. selector: ".blocks-gallery-item__caption"
  15621. }
  15622. }
  15623. },
  15624. ids: {
  15625. type: "array",
  15626. items: {
  15627. type: "number"
  15628. },
  15629. "default": []
  15630. },
  15631. shortCodeTransforms: {
  15632. type: "array",
  15633. "default": [],
  15634. items: {
  15635. type: "object"
  15636. }
  15637. },
  15638. columns: {
  15639. type: "number",
  15640. minimum: 1,
  15641. maximum: 8
  15642. },
  15643. caption: {
  15644. type: "string",
  15645. source: "html",
  15646. selector: ".blocks-gallery-caption"
  15647. },
  15648. imageCrop: {
  15649. type: "boolean",
  15650. "default": true
  15651. },
  15652. fixedHeight: {
  15653. type: "boolean",
  15654. "default": true
  15655. },
  15656. linkTarget: {
  15657. type: "string"
  15658. },
  15659. linkTo: {
  15660. type: "string"
  15661. },
  15662. sizeSlug: {
  15663. type: "string",
  15664. "default": "large"
  15665. },
  15666. allowResize: {
  15667. type: "boolean",
  15668. "default": false
  15669. }
  15670. },
  15671. providesContext: {
  15672. allowResize: "allowResize",
  15673. imageCrop: "imageCrop",
  15674. fixedHeight: "fixedHeight"
  15675. },
  15676. supports: {
  15677. anchor: true,
  15678. align: true,
  15679. html: false,
  15680. units: ["px", "em", "rem", "vh", "vw"],
  15681. spacing: {
  15682. blockGap: true,
  15683. __experimentalSkipSerialization: ["blockGap"],
  15684. __experimentalDefaultControls: {
  15685. blockGap: true
  15686. }
  15687. },
  15688. __experimentalLayout: {
  15689. allowSwitching: false,
  15690. allowInheriting: false,
  15691. allowEditing: false,
  15692. "default": {
  15693. type: "flex"
  15694. }
  15695. }
  15696. },
  15697. editorStyle: "wp-block-gallery-editor",
  15698. style: "wp-block-gallery"
  15699. };
  15700. const {
  15701. name: gallery_name
  15702. } = gallery_metadata;
  15703. const gallery_settings = {
  15704. icon: library_gallery,
  15705. example: {
  15706. attributes: {
  15707. columns: 2
  15708. },
  15709. innerBlocks: [{
  15710. name: 'core/image',
  15711. attributes: {
  15712. url: 'https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg'
  15713. }
  15714. }, {
  15715. name: 'core/image',
  15716. attributes: {
  15717. url: 'https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg'
  15718. }
  15719. }]
  15720. },
  15721. transforms: gallery_transforms,
  15722. edit: edit_wrapper,
  15723. save: saveWithInnerBlocks,
  15724. deprecated: gallery_deprecated
  15725. };
  15726. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/group.js
  15727. /**
  15728. * WordPress dependencies
  15729. */
  15730. const group = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  15731. viewBox: "0 0 24 24",
  15732. xmlns: "http://www.w3.org/2000/svg"
  15733. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  15734. d: "M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"
  15735. }));
  15736. /* harmony default export */ var library_group = (group);
  15737. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/deprecated.js
  15738. /**
  15739. * External dependencies
  15740. */
  15741. /**
  15742. * WordPress dependencies
  15743. */
  15744. const migrateAttributes = attributes => {
  15745. if (!attributes.tagName) {
  15746. attributes = { ...attributes,
  15747. tagName: 'div'
  15748. };
  15749. }
  15750. if (!attributes.customTextColor && !attributes.customBackgroundColor) {
  15751. return attributes;
  15752. }
  15753. const style = {
  15754. color: {}
  15755. };
  15756. if (attributes.customTextColor) {
  15757. style.color.text = attributes.customTextColor;
  15758. }
  15759. if (attributes.customBackgroundColor) {
  15760. style.color.background = attributes.customBackgroundColor;
  15761. }
  15762. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor', 'customBackgroundColor']),
  15763. style
  15764. };
  15765. };
  15766. const group_deprecated_deprecated = [// Version of the block with the double div.
  15767. {
  15768. attributes: {
  15769. tagName: {
  15770. type: 'string',
  15771. default: 'div'
  15772. },
  15773. templateLock: {
  15774. type: 'string'
  15775. }
  15776. },
  15777. supports: {
  15778. align: ['wide', 'full'],
  15779. anchor: true,
  15780. color: {
  15781. gradients: true,
  15782. link: true
  15783. },
  15784. spacing: {
  15785. padding: true
  15786. },
  15787. __experimentalBorder: {
  15788. radius: true
  15789. }
  15790. },
  15791. save(_ref) {
  15792. let {
  15793. attributes
  15794. } = _ref;
  15795. const {
  15796. tagName: Tag
  15797. } = attributes;
  15798. return (0,external_wp_element_namespaceObject.createElement)(Tag, external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("div", {
  15799. className: "wp-block-group__inner-container"
  15800. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  15801. }
  15802. }, // Version of the block without global styles support
  15803. {
  15804. attributes: {
  15805. backgroundColor: {
  15806. type: 'string'
  15807. },
  15808. customBackgroundColor: {
  15809. type: 'string'
  15810. },
  15811. textColor: {
  15812. type: 'string'
  15813. },
  15814. customTextColor: {
  15815. type: 'string'
  15816. }
  15817. },
  15818. supports: {
  15819. align: ['wide', 'full'],
  15820. anchor: true,
  15821. html: false
  15822. },
  15823. migrate: migrateAttributes,
  15824. save(_ref2) {
  15825. let {
  15826. attributes
  15827. } = _ref2;
  15828. const {
  15829. backgroundColor,
  15830. customBackgroundColor,
  15831. textColor,
  15832. customTextColor
  15833. } = attributes;
  15834. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  15835. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  15836. const className = classnames_default()(backgroundClass, textClass, {
  15837. 'has-text-color': textColor || customTextColor,
  15838. 'has-background': backgroundColor || customBackgroundColor
  15839. });
  15840. const styles = {
  15841. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  15842. color: textClass ? undefined : customTextColor
  15843. };
  15844. return (0,external_wp_element_namespaceObject.createElement)("div", {
  15845. className: className,
  15846. style: styles
  15847. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  15848. className: "wp-block-group__inner-container"
  15849. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  15850. }
  15851. }, // Version of the group block with a bug that made text color class not applied.
  15852. {
  15853. attributes: {
  15854. backgroundColor: {
  15855. type: 'string'
  15856. },
  15857. customBackgroundColor: {
  15858. type: 'string'
  15859. },
  15860. textColor: {
  15861. type: 'string'
  15862. },
  15863. customTextColor: {
  15864. type: 'string'
  15865. }
  15866. },
  15867. migrate: migrateAttributes,
  15868. supports: {
  15869. align: ['wide', 'full'],
  15870. anchor: true,
  15871. html: false
  15872. },
  15873. save(_ref3) {
  15874. let {
  15875. attributes
  15876. } = _ref3;
  15877. const {
  15878. backgroundColor,
  15879. customBackgroundColor,
  15880. textColor,
  15881. customTextColor
  15882. } = attributes;
  15883. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  15884. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  15885. const className = classnames_default()(backgroundClass, {
  15886. 'has-text-color': textColor || customTextColor,
  15887. 'has-background': backgroundColor || customBackgroundColor
  15888. });
  15889. const styles = {
  15890. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  15891. color: textClass ? undefined : customTextColor
  15892. };
  15893. return (0,external_wp_element_namespaceObject.createElement)("div", {
  15894. className: className,
  15895. style: styles
  15896. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  15897. className: "wp-block-group__inner-container"
  15898. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  15899. }
  15900. }, // v1 of group block. Deprecated to add an inner-container div around `InnerBlocks.Content`.
  15901. {
  15902. attributes: {
  15903. backgroundColor: {
  15904. type: 'string'
  15905. },
  15906. customBackgroundColor: {
  15907. type: 'string'
  15908. }
  15909. },
  15910. supports: {
  15911. align: ['wide', 'full'],
  15912. anchor: true,
  15913. html: false
  15914. },
  15915. migrate: migrateAttributes,
  15916. save(_ref4) {
  15917. let {
  15918. attributes
  15919. } = _ref4;
  15920. const {
  15921. backgroundColor,
  15922. customBackgroundColor
  15923. } = attributes;
  15924. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  15925. const className = classnames_default()(backgroundClass, {
  15926. 'has-background': backgroundColor || customBackgroundColor
  15927. });
  15928. const styles = {
  15929. backgroundColor: backgroundClass ? undefined : customBackgroundColor
  15930. };
  15931. return (0,external_wp_element_namespaceObject.createElement)("div", {
  15932. className: className,
  15933. style: styles
  15934. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  15935. }
  15936. }];
  15937. /* harmony default export */ var group_deprecated = (group_deprecated_deprecated);
  15938. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/edit.js
  15939. /**
  15940. * WordPress dependencies
  15941. */
  15942. const htmlElementMessages = {
  15943. header: (0,external_wp_i18n_namespaceObject.__)('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'),
  15944. main: (0,external_wp_i18n_namespaceObject.__)('The <main> element should be used for the primary content of your document only. '),
  15945. section: (0,external_wp_i18n_namespaceObject.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element."),
  15946. article: (0,external_wp_i18n_namespaceObject.__)('The <article> element should represent a self contained, syndicatable portion of the document.'),
  15947. aside: (0,external_wp_i18n_namespaceObject.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),
  15948. footer: (0,external_wp_i18n_namespaceObject.__)('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).')
  15949. };
  15950. function GroupEdit(_ref) {
  15951. let {
  15952. attributes,
  15953. setAttributes,
  15954. clientId
  15955. } = _ref;
  15956. const {
  15957. hasInnerBlocks,
  15958. themeSupportsLayout
  15959. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  15960. var _getSettings;
  15961. const {
  15962. getBlock,
  15963. getSettings
  15964. } = select(external_wp_blockEditor_namespaceObject.store);
  15965. const block = getBlock(clientId);
  15966. return {
  15967. hasInnerBlocks: !!(block && block.innerBlocks.length),
  15968. themeSupportsLayout: (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout
  15969. };
  15970. }, [clientId]);
  15971. const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
  15972. const {
  15973. tagName: TagName = 'div',
  15974. templateLock,
  15975. layout = {}
  15976. } = attributes;
  15977. const usedLayout = !!layout && layout.inherit ? defaultLayout : layout;
  15978. const {
  15979. type = 'default'
  15980. } = usedLayout;
  15981. const layoutSupportEnabled = themeSupportsLayout || type !== 'default';
  15982. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  15983. className: `is-layout-${type}`
  15984. });
  15985. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(layoutSupportEnabled ? blockProps : {
  15986. className: 'wp-block-group__inner-container'
  15987. }, {
  15988. templateLock,
  15989. renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender,
  15990. __experimentalLayout: layoutSupportEnabled ? usedLayout : undefined
  15991. });
  15992. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  15993. __experimentalGroup: "advanced"
  15994. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  15995. label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
  15996. options: [{
  15997. label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'),
  15998. value: 'div'
  15999. }, {
  16000. label: '<header>',
  16001. value: 'header'
  16002. }, {
  16003. label: '<main>',
  16004. value: 'main'
  16005. }, {
  16006. label: '<section>',
  16007. value: 'section'
  16008. }, {
  16009. label: '<article>',
  16010. value: 'article'
  16011. }, {
  16012. label: '<aside>',
  16013. value: 'aside'
  16014. }, {
  16015. label: '<footer>',
  16016. value: 'footer'
  16017. }],
  16018. value: TagName,
  16019. onChange: value => setAttributes({
  16020. tagName: value
  16021. }),
  16022. help: htmlElementMessages[TagName]
  16023. })), layoutSupportEnabled && (0,external_wp_element_namespaceObject.createElement)(TagName, innerBlocksProps), !layoutSupportEnabled && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
  16024. }
  16025. /* harmony default export */ var group_edit = (GroupEdit);
  16026. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/save.js
  16027. /**
  16028. * WordPress dependencies
  16029. */
  16030. function group_save_save(_ref) {
  16031. let {
  16032. attributes: {
  16033. tagName: Tag
  16034. }
  16035. } = _ref;
  16036. return (0,external_wp_element_namespaceObject.createElement)(Tag, external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save()));
  16037. }
  16038. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/transforms.js
  16039. /**
  16040. * WordPress dependencies
  16041. */
  16042. const group_transforms_transforms = {
  16043. from: [{
  16044. type: 'block',
  16045. isMultiBlock: true,
  16046. blocks: ['*'],
  16047. __experimentalConvert(blocks) {
  16048. const alignments = ['wide', 'full']; // Determine the widest setting of all the blocks to be grouped
  16049. const widestAlignment = blocks.reduce((accumulator, block) => {
  16050. const {
  16051. align
  16052. } = block.attributes;
  16053. return alignments.indexOf(align) > alignments.indexOf(accumulator) ? align : accumulator;
  16054. }, undefined); // Clone the Blocks to be Grouped
  16055. // Failing to create new block references causes the original blocks
  16056. // to be replaced in the switchToBlockType call thereby meaning they
  16057. // are removed both from their original location and within the
  16058. // new group block.
  16059. const groupInnerBlocks = blocks.map(block => {
  16060. return (0,external_wp_blocks_namespaceObject.createBlock)(block.name, block.attributes, block.innerBlocks);
  16061. });
  16062. return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', {
  16063. align: widestAlignment
  16064. }, groupInnerBlocks);
  16065. }
  16066. }]
  16067. };
  16068. /* harmony default export */ var group_transforms = (group_transforms_transforms);
  16069. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/row.js
  16070. /**
  16071. * WordPress dependencies
  16072. */
  16073. const row = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  16074. xmlns: "http://www.w3.org/2000/svg",
  16075. viewBox: "0 0 24 24"
  16076. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  16077. d: "M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"
  16078. }));
  16079. /* harmony default export */ var library_row = (row);
  16080. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/stack.js
  16081. /**
  16082. * WordPress dependencies
  16083. */
  16084. const stack = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  16085. xmlns: "http://www.w3.org/2000/svg",
  16086. viewBox: "0 0 24 24"
  16087. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  16088. d: "M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"
  16089. }));
  16090. /* harmony default export */ var library_stack = (stack);
  16091. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/variations.js
  16092. /**
  16093. * WordPress dependencies
  16094. */
  16095. const group_variations_variations = [{
  16096. name: 'group',
  16097. title: (0,external_wp_i18n_namespaceObject.__)('Group'),
  16098. description: (0,external_wp_i18n_namespaceObject.__)('Gather blocks in a layout container.'),
  16099. attributes: {
  16100. layout: {
  16101. type: 'default'
  16102. }
  16103. },
  16104. scope: ['transform'],
  16105. isActive: blockAttributes => {
  16106. var _blockAttributes$layo, _blockAttributes$layo2;
  16107. return !blockAttributes.layout || !((_blockAttributes$layo = blockAttributes.layout) !== null && _blockAttributes$layo !== void 0 && _blockAttributes$layo.type) || ((_blockAttributes$layo2 = blockAttributes.layout) === null || _blockAttributes$layo2 === void 0 ? void 0 : _blockAttributes$layo2.type) === 'default';
  16108. },
  16109. icon: library_group
  16110. }, {
  16111. name: 'group-row',
  16112. title: (0,external_wp_i18n_namespaceObject.__)('Row'),
  16113. description: (0,external_wp_i18n_namespaceObject.__)('Arrange blocks horizontally.'),
  16114. attributes: {
  16115. layout: {
  16116. type: 'flex',
  16117. flexWrap: 'nowrap'
  16118. }
  16119. },
  16120. scope: ['inserter', 'transform'],
  16121. isActive: blockAttributes => {
  16122. var _blockAttributes$layo3, _blockAttributes$layo4, _blockAttributes$layo5;
  16123. return ((_blockAttributes$layo3 = blockAttributes.layout) === null || _blockAttributes$layo3 === void 0 ? void 0 : _blockAttributes$layo3.type) === 'flex' && (!((_blockAttributes$layo4 = blockAttributes.layout) !== null && _blockAttributes$layo4 !== void 0 && _blockAttributes$layo4.orientation) || ((_blockAttributes$layo5 = blockAttributes.layout) === null || _blockAttributes$layo5 === void 0 ? void 0 : _blockAttributes$layo5.orientation) === 'horizontal');
  16124. },
  16125. icon: library_row
  16126. }, {
  16127. name: 'group-stack',
  16128. title: (0,external_wp_i18n_namespaceObject.__)('Stack'),
  16129. description: (0,external_wp_i18n_namespaceObject.__)('Arrange blocks vertically.'),
  16130. attributes: {
  16131. layout: {
  16132. type: 'flex',
  16133. orientation: 'vertical'
  16134. }
  16135. },
  16136. scope: ['inserter', 'transform'],
  16137. isActive: blockAttributes => {
  16138. var _blockAttributes$layo6, _blockAttributes$layo7;
  16139. return ((_blockAttributes$layo6 = blockAttributes.layout) === null || _blockAttributes$layo6 === void 0 ? void 0 : _blockAttributes$layo6.type) === 'flex' && ((_blockAttributes$layo7 = blockAttributes.layout) === null || _blockAttributes$layo7 === void 0 ? void 0 : _blockAttributes$layo7.orientation) === 'vertical';
  16140. },
  16141. icon: library_stack
  16142. }];
  16143. /* harmony default export */ var group_variations = (group_variations_variations);
  16144. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/index.js
  16145. /**
  16146. * WordPress dependencies
  16147. */
  16148. /**
  16149. * Internal dependencies
  16150. */
  16151. const group_metadata = {
  16152. $schema: "https://schemas.wp.org/trunk/block.json",
  16153. apiVersion: 2,
  16154. name: "core/group",
  16155. title: "Group",
  16156. category: "design",
  16157. description: "Gather blocks in a layout container.",
  16158. keywords: ["container", "wrapper", "row", "section"],
  16159. textdomain: "default",
  16160. attributes: {
  16161. tagName: {
  16162. type: "string",
  16163. "default": "div"
  16164. },
  16165. templateLock: {
  16166. type: ["string", "boolean"],
  16167. "enum": ["all", "insert", false]
  16168. }
  16169. },
  16170. supports: {
  16171. align: ["wide", "full"],
  16172. anchor: true,
  16173. html: false,
  16174. color: {
  16175. gradients: true,
  16176. link: true,
  16177. __experimentalDefaultControls: {
  16178. background: true,
  16179. text: true
  16180. }
  16181. },
  16182. spacing: {
  16183. margin: ["top", "bottom"],
  16184. padding: true,
  16185. blockGap: true,
  16186. __experimentalDefaultControls: {
  16187. padding: true,
  16188. blockGap: true
  16189. }
  16190. },
  16191. __experimentalBorder: {
  16192. color: true,
  16193. radius: true,
  16194. style: true,
  16195. width: true,
  16196. __experimentalDefaultControls: {
  16197. color: true,
  16198. radius: true,
  16199. style: true,
  16200. width: true
  16201. }
  16202. },
  16203. typography: {
  16204. fontSize: true,
  16205. lineHeight: true,
  16206. __experimentalFontStyle: true,
  16207. __experimentalFontWeight: true,
  16208. __experimentalLetterSpacing: true,
  16209. __experimentalTextTransform: true,
  16210. __experimentalDefaultControls: {
  16211. fontSize: true
  16212. }
  16213. },
  16214. __experimentalLayout: true
  16215. },
  16216. editorStyle: "wp-block-group-editor",
  16217. style: "wp-block-group"
  16218. };
  16219. const {
  16220. name: group_name
  16221. } = group_metadata;
  16222. const group_settings = {
  16223. icon: library_group,
  16224. example: {
  16225. attributes: {
  16226. style: {
  16227. color: {
  16228. text: '#000000',
  16229. background: '#ffffff'
  16230. }
  16231. }
  16232. },
  16233. innerBlocks: [{
  16234. name: 'core/paragraph',
  16235. attributes: {
  16236. customTextColor: '#cf2e2e',
  16237. fontSize: 'large',
  16238. content: (0,external_wp_i18n_namespaceObject.__)('One.')
  16239. }
  16240. }, {
  16241. name: 'core/paragraph',
  16242. attributes: {
  16243. customTextColor: '#ff6900',
  16244. fontSize: 'large',
  16245. content: (0,external_wp_i18n_namespaceObject.__)('Two.')
  16246. }
  16247. }, {
  16248. name: 'core/paragraph',
  16249. attributes: {
  16250. customTextColor: '#fcb900',
  16251. fontSize: 'large',
  16252. content: (0,external_wp_i18n_namespaceObject.__)('Three.')
  16253. }
  16254. }, {
  16255. name: 'core/paragraph',
  16256. attributes: {
  16257. customTextColor: '#00d084',
  16258. fontSize: 'large',
  16259. content: (0,external_wp_i18n_namespaceObject.__)('Four.')
  16260. }
  16261. }, {
  16262. name: 'core/paragraph',
  16263. attributes: {
  16264. customTextColor: '#0693e3',
  16265. fontSize: 'large',
  16266. content: (0,external_wp_i18n_namespaceObject.__)('Five.')
  16267. }
  16268. }, {
  16269. name: 'core/paragraph',
  16270. attributes: {
  16271. customTextColor: '#9b51e0',
  16272. fontSize: 'large',
  16273. content: (0,external_wp_i18n_namespaceObject.__)('Six.')
  16274. }
  16275. }]
  16276. },
  16277. transforms: group_transforms,
  16278. edit: group_edit,
  16279. save: group_save_save,
  16280. deprecated: group_deprecated,
  16281. variations: group_variations
  16282. };
  16283. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/heading.js
  16284. /**
  16285. * WordPress dependencies
  16286. */
  16287. const heading = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  16288. xmlns: "http://www.w3.org/2000/svg",
  16289. viewBox: "0 0 24 24"
  16290. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  16291. d: "M6.2 5.2v13.4l5.8-4.8 5.8 4.8V5.2z"
  16292. }));
  16293. /* harmony default export */ var library_heading = (heading);
  16294. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/deprecated.js
  16295. /**
  16296. * External dependencies
  16297. */
  16298. /**
  16299. * WordPress dependencies
  16300. */
  16301. const blockSupports = {
  16302. className: false,
  16303. anchor: true
  16304. };
  16305. const heading_deprecated_blockAttributes = {
  16306. align: {
  16307. type: 'string'
  16308. },
  16309. content: {
  16310. type: 'string',
  16311. source: 'html',
  16312. selector: 'h1,h2,h3,h4,h5,h6',
  16313. default: ''
  16314. },
  16315. level: {
  16316. type: 'number',
  16317. default: 2
  16318. },
  16319. placeholder: {
  16320. type: 'string'
  16321. }
  16322. };
  16323. const deprecated_migrateCustomColors = attributes => {
  16324. if (!attributes.customTextColor) {
  16325. return attributes;
  16326. }
  16327. const style = {
  16328. color: {
  16329. text: attributes.customTextColor
  16330. }
  16331. };
  16332. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor']),
  16333. style
  16334. };
  16335. };
  16336. const TEXT_ALIGN_OPTIONS = ['left', 'right', 'center'];
  16337. const migrateTextAlign = attributes => {
  16338. const {
  16339. align,
  16340. ...rest
  16341. } = attributes;
  16342. return TEXT_ALIGN_OPTIONS.includes(align) ? { ...rest,
  16343. textAlign: align
  16344. } : attributes;
  16345. };
  16346. const heading_deprecated_deprecated = [{
  16347. supports: {
  16348. align: ['wide', 'full'],
  16349. anchor: true,
  16350. className: false,
  16351. color: {
  16352. link: true
  16353. },
  16354. fontSize: true,
  16355. lineHeight: true,
  16356. __experimentalSelector: {
  16357. 'core/heading/h1': 'h1',
  16358. 'core/heading/h2': 'h2',
  16359. 'core/heading/h3': 'h3',
  16360. 'core/heading/h4': 'h4',
  16361. 'core/heading/h5': 'h5',
  16362. 'core/heading/h6': 'h6'
  16363. },
  16364. __unstablePasteTextInline: true
  16365. },
  16366. attributes: heading_deprecated_blockAttributes,
  16367. isEligible: _ref => {
  16368. let {
  16369. align
  16370. } = _ref;
  16371. return TEXT_ALIGN_OPTIONS.includes(align);
  16372. },
  16373. migrate: migrateTextAlign,
  16374. save(_ref2) {
  16375. let {
  16376. attributes
  16377. } = _ref2;
  16378. const {
  16379. align,
  16380. content,
  16381. level
  16382. } = attributes;
  16383. const TagName = 'h' + level;
  16384. const className = classnames_default()({
  16385. [`has-text-align-${align}`]: align
  16386. });
  16387. return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
  16388. className
  16389. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  16390. value: content
  16391. }));
  16392. }
  16393. }, {
  16394. supports: blockSupports,
  16395. attributes: { ...heading_deprecated_blockAttributes,
  16396. customTextColor: {
  16397. type: 'string'
  16398. },
  16399. textColor: {
  16400. type: 'string'
  16401. }
  16402. },
  16403. migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)),
  16404. save(_ref3) {
  16405. let {
  16406. attributes
  16407. } = _ref3;
  16408. const {
  16409. align,
  16410. content,
  16411. customTextColor,
  16412. level,
  16413. textColor
  16414. } = attributes;
  16415. const tagName = 'h' + level;
  16416. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  16417. const className = classnames_default()({
  16418. [textClass]: textClass,
  16419. 'has-text-color': textColor || customTextColor,
  16420. [`has-text-align-${align}`]: align
  16421. });
  16422. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  16423. className: className ? className : undefined,
  16424. tagName: tagName,
  16425. style: {
  16426. color: textClass ? undefined : customTextColor
  16427. },
  16428. value: content
  16429. });
  16430. }
  16431. }, {
  16432. attributes: { ...heading_deprecated_blockAttributes,
  16433. customTextColor: {
  16434. type: 'string'
  16435. },
  16436. textColor: {
  16437. type: 'string'
  16438. }
  16439. },
  16440. migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)),
  16441. save(_ref4) {
  16442. let {
  16443. attributes
  16444. } = _ref4;
  16445. const {
  16446. align,
  16447. content,
  16448. customTextColor,
  16449. level,
  16450. textColor
  16451. } = attributes;
  16452. const tagName = 'h' + level;
  16453. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  16454. const className = classnames_default()({
  16455. [textClass]: textClass,
  16456. [`has-text-align-${align}`]: align
  16457. });
  16458. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  16459. className: className ? className : undefined,
  16460. tagName: tagName,
  16461. style: {
  16462. color: textClass ? undefined : customTextColor
  16463. },
  16464. value: content
  16465. });
  16466. },
  16467. supports: blockSupports
  16468. }, {
  16469. supports: blockSupports,
  16470. attributes: { ...heading_deprecated_blockAttributes,
  16471. customTextColor: {
  16472. type: 'string'
  16473. },
  16474. textColor: {
  16475. type: 'string'
  16476. }
  16477. },
  16478. migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)),
  16479. save(_ref5) {
  16480. let {
  16481. attributes
  16482. } = _ref5;
  16483. const {
  16484. align,
  16485. level,
  16486. content,
  16487. textColor,
  16488. customTextColor
  16489. } = attributes;
  16490. const tagName = 'h' + level;
  16491. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  16492. const className = classnames_default()({
  16493. [textClass]: textClass
  16494. });
  16495. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  16496. className: className ? className : undefined,
  16497. tagName: tagName,
  16498. style: {
  16499. textAlign: align,
  16500. color: textClass ? undefined : customTextColor
  16501. },
  16502. value: content
  16503. });
  16504. }
  16505. }];
  16506. /* harmony default export */ var heading_deprecated = (heading_deprecated_deprecated);
  16507. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/autogenerate-anchors.js
  16508. /**
  16509. * External dependencies
  16510. */
  16511. /**
  16512. * Object map tracking anchors.
  16513. *
  16514. * @type {Record<string, string | null>}
  16515. */
  16516. const autogenerate_anchors_anchors = {};
  16517. /**
  16518. * Returns the text without markup.
  16519. *
  16520. * @param {string} text The text.
  16521. *
  16522. * @return {string} The text without markup.
  16523. */
  16524. const getTextWithoutMarkup = text => {
  16525. const dummyElement = document.createElement('div');
  16526. dummyElement.innerHTML = text;
  16527. return dummyElement.innerText;
  16528. };
  16529. /**
  16530. * Get the slug from the content.
  16531. *
  16532. * @param {string} content The block content.
  16533. *
  16534. * @return {string} Returns the slug.
  16535. */
  16536. const getSlug = content => {
  16537. // Get the slug.
  16538. return (0,external_lodash_namespaceObject.trim)((0,external_lodash_namespaceObject.deburr)(getTextWithoutMarkup(content)).replace(/[^\p{L}\p{N}]+/gu, '-').toLowerCase(), '-');
  16539. };
  16540. /**
  16541. * Generate the anchor for a heading.
  16542. *
  16543. * @param {string} clientId The block ID.
  16544. * @param {string} content The block content.
  16545. *
  16546. * @return {string|null} Return the heading anchor.
  16547. */
  16548. const generateAnchor = (clientId, content) => {
  16549. const slug = getSlug(content); // If slug is empty, then return null.
  16550. // Returning null instead of an empty string allows us to check again when the content changes.
  16551. if ('' === slug) {
  16552. return null;
  16553. }
  16554. delete autogenerate_anchors_anchors[clientId];
  16555. let anchor = slug;
  16556. let i = 0; // If the anchor already exists in another heading, append -i.
  16557. while (Object.values(autogenerate_anchors_anchors).includes(anchor)) {
  16558. i += 1;
  16559. anchor = slug + '-' + i;
  16560. }
  16561. return anchor;
  16562. };
  16563. /**
  16564. * Set the anchor for a heading.
  16565. *
  16566. * @param {string} clientId The block ID.
  16567. * @param {string|null} anchor The block anchor.
  16568. */
  16569. const setAnchor = (clientId, anchor) => {
  16570. autogenerate_anchors_anchors[clientId] = anchor;
  16571. };
  16572. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/edit.js
  16573. /**
  16574. * External dependencies
  16575. */
  16576. /**
  16577. * WordPress dependencies
  16578. */
  16579. /**
  16580. * Internal dependencies
  16581. */
  16582. function HeadingEdit(_ref) {
  16583. let {
  16584. attributes,
  16585. setAttributes,
  16586. mergeBlocks,
  16587. onReplace,
  16588. style,
  16589. clientId
  16590. } = _ref;
  16591. const {
  16592. textAlign,
  16593. content,
  16594. level,
  16595. placeholder,
  16596. anchor
  16597. } = attributes;
  16598. const tagName = 'h' + level;
  16599. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  16600. className: classnames_default()({
  16601. [`has-text-align-${textAlign}`]: textAlign
  16602. }),
  16603. style
  16604. });
  16605. const {
  16606. canGenerateAnchors
  16607. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  16608. const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
  16609. return {
  16610. canGenerateAnchors: !!settings.generateAnchors
  16611. };
  16612. }, []);
  16613. const {
  16614. __unstableMarkNextChangeAsNotPersistent
  16615. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); // Initially set anchor for headings that have content but no anchor set.
  16616. // This is used when transforming a block to heading, or for legacy anchors.
  16617. (0,external_wp_element_namespaceObject.useEffect)(() => {
  16618. if (!canGenerateAnchors) {
  16619. return;
  16620. }
  16621. if (!anchor && content) {
  16622. // This side-effect should not create an undo level.
  16623. __unstableMarkNextChangeAsNotPersistent();
  16624. setAttributes({
  16625. anchor: generateAnchor(clientId, content)
  16626. });
  16627. }
  16628. setAnchor(clientId, anchor); // Remove anchor map when block unmounts.
  16629. return () => setAnchor(clientId, null);
  16630. }, [anchor, content, clientId, canGenerateAnchors]);
  16631. const onContentChange = value => {
  16632. const newAttrs = {
  16633. content: value
  16634. };
  16635. if (canGenerateAnchors && (!anchor || !value || generateAnchor(clientId, content) === anchor)) {
  16636. newAttrs.anchor = generateAnchor(clientId, value);
  16637. }
  16638. setAttributes(newAttrs);
  16639. };
  16640. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  16641. group: "block"
  16642. }, (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
  16643. selectedLevel: level,
  16644. onChange: newLevel => setAttributes({
  16645. level: newLevel
  16646. })
  16647. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  16648. value: textAlign,
  16649. onChange: nextAlign => {
  16650. setAttributes({
  16651. textAlign: nextAlign
  16652. });
  16653. }
  16654. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  16655. identifier: "content",
  16656. tagName: tagName,
  16657. value: content,
  16658. onChange: onContentChange,
  16659. onMerge: mergeBlocks,
  16660. onSplit: (value, isOriginal) => {
  16661. let block;
  16662. if (isOriginal || value) {
  16663. block = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { ...attributes,
  16664. content: value
  16665. });
  16666. } else {
  16667. var _getDefaultBlockName;
  16668. block = (0,external_wp_blocks_namespaceObject.createBlock)((_getDefaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)()) !== null && _getDefaultBlockName !== void 0 ? _getDefaultBlockName : 'core/heading');
  16669. }
  16670. if (isOriginal) {
  16671. block.clientId = clientId;
  16672. }
  16673. return block;
  16674. },
  16675. onReplace: onReplace,
  16676. onRemove: () => onReplace([]),
  16677. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Heading text'),
  16678. placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Heading'),
  16679. textAlign: textAlign
  16680. }, external_wp_element_namespaceObject.Platform.isNative && {
  16681. deleteEnter: true
  16682. }, blockProps)));
  16683. }
  16684. /* harmony default export */ var heading_edit = (HeadingEdit);
  16685. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/save.js
  16686. /**
  16687. * External dependencies
  16688. */
  16689. /**
  16690. * WordPress dependencies
  16691. */
  16692. function heading_save_save(_ref) {
  16693. let {
  16694. attributes
  16695. } = _ref;
  16696. const {
  16697. textAlign,
  16698. content,
  16699. level
  16700. } = attributes;
  16701. const TagName = 'h' + level;
  16702. const className = classnames_default()({
  16703. [`has-text-align-${textAlign}`]: textAlign
  16704. });
  16705. return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
  16706. className
  16707. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  16708. value: content
  16709. }));
  16710. }
  16711. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/shared.js
  16712. /**
  16713. * Given a node name string for a heading node, returns its numeric level.
  16714. *
  16715. * @param {string} nodeName Heading node name.
  16716. *
  16717. * @return {number} Heading level.
  16718. */
  16719. function getLevelFromHeadingNodeName(nodeName) {
  16720. return Number(nodeName.substr(1));
  16721. }
  16722. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/transforms.js
  16723. /**
  16724. * WordPress dependencies
  16725. */
  16726. /**
  16727. * Internal dependencies
  16728. */
  16729. const {
  16730. name: heading_transforms_name
  16731. } = {
  16732. $schema: "https://schemas.wp.org/trunk/block.json",
  16733. apiVersion: 2,
  16734. name: "core/heading",
  16735. title: "Heading",
  16736. category: "text",
  16737. description: "Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",
  16738. keywords: ["title", "subtitle"],
  16739. textdomain: "default",
  16740. attributes: {
  16741. textAlign: {
  16742. type: "string"
  16743. },
  16744. content: {
  16745. type: "string",
  16746. source: "html",
  16747. selector: "h1,h2,h3,h4,h5,h6",
  16748. "default": "",
  16749. __experimentalRole: "content"
  16750. },
  16751. level: {
  16752. type: "number",
  16753. "default": 2
  16754. },
  16755. placeholder: {
  16756. type: "string"
  16757. }
  16758. },
  16759. supports: {
  16760. align: ["wide", "full"],
  16761. anchor: true,
  16762. className: false,
  16763. color: {
  16764. link: true,
  16765. __experimentalDefaultControls: {
  16766. background: true,
  16767. text: true
  16768. }
  16769. },
  16770. spacing: {
  16771. margin: true
  16772. },
  16773. typography: {
  16774. fontSize: true,
  16775. lineHeight: true,
  16776. __experimentalFontStyle: true,
  16777. __experimentalFontWeight: true,
  16778. __experimentalLetterSpacing: true,
  16779. __experimentalTextTransform: true,
  16780. __experimentalDefaultControls: {
  16781. fontSize: true,
  16782. fontAppearance: true,
  16783. textTransform: true
  16784. }
  16785. },
  16786. __experimentalSelector: "h1,h2,h3,h4,h5,h6",
  16787. __unstablePasteTextInline: true,
  16788. __experimentalSlashInserter: true
  16789. },
  16790. editorStyle: "wp-block-heading-editor",
  16791. style: "wp-block-heading"
  16792. };
  16793. const heading_transforms_transforms = {
  16794. from: [{
  16795. type: 'block',
  16796. isMultiBlock: true,
  16797. blocks: ['core/paragraph'],
  16798. transform: attributes => attributes.map(_ref => {
  16799. let {
  16800. content,
  16801. anchor
  16802. } = _ref;
  16803. return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, {
  16804. content,
  16805. anchor
  16806. });
  16807. })
  16808. }, {
  16809. type: 'raw',
  16810. selector: 'h1,h2,h3,h4,h5,h6',
  16811. schema: _ref2 => {
  16812. let {
  16813. phrasingContentSchema,
  16814. isPaste
  16815. } = _ref2;
  16816. const schema = {
  16817. children: phrasingContentSchema,
  16818. attributes: isPaste ? [] : ['style', 'id']
  16819. };
  16820. return {
  16821. h1: schema,
  16822. h2: schema,
  16823. h3: schema,
  16824. h4: schema,
  16825. h5: schema,
  16826. h6: schema
  16827. };
  16828. },
  16829. transform(node) {
  16830. const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)(heading_transforms_name, node.outerHTML);
  16831. const {
  16832. textAlign
  16833. } = node.style || {};
  16834. attributes.level = getLevelFromHeadingNodeName(node.nodeName);
  16835. if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') {
  16836. attributes.align = textAlign;
  16837. }
  16838. return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, attributes);
  16839. }
  16840. }, ...[1, 2, 3, 4, 5, 6].map(level => ({
  16841. type: 'prefix',
  16842. prefix: Array(level + 1).join('#'),
  16843. transform(content) {
  16844. return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, {
  16845. level,
  16846. content
  16847. });
  16848. }
  16849. })), ...[1, 2, 3, 4, 5, 6].map(level => ({
  16850. type: 'enter',
  16851. regExp: new RegExp(`^/(h|H)${level}$`),
  16852. transform(content) {
  16853. return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, {
  16854. level,
  16855. content
  16856. });
  16857. }
  16858. }))],
  16859. to: [{
  16860. type: 'block',
  16861. isMultiBlock: true,
  16862. blocks: ['core/paragraph'],
  16863. transform: attributes => attributes.map(_ref3 => {
  16864. let {
  16865. content
  16866. } = _ref3;
  16867. return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  16868. content
  16869. });
  16870. })
  16871. }]
  16872. };
  16873. /* harmony default export */ var heading_transforms = (heading_transforms_transforms);
  16874. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/index.js
  16875. /**
  16876. * External dependencies
  16877. */
  16878. /**
  16879. * WordPress dependencies
  16880. */
  16881. /**
  16882. * Internal dependencies
  16883. */
  16884. const heading_metadata = {
  16885. $schema: "https://schemas.wp.org/trunk/block.json",
  16886. apiVersion: 2,
  16887. name: "core/heading",
  16888. title: "Heading",
  16889. category: "text",
  16890. description: "Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",
  16891. keywords: ["title", "subtitle"],
  16892. textdomain: "default",
  16893. attributes: {
  16894. textAlign: {
  16895. type: "string"
  16896. },
  16897. content: {
  16898. type: "string",
  16899. source: "html",
  16900. selector: "h1,h2,h3,h4,h5,h6",
  16901. "default": "",
  16902. __experimentalRole: "content"
  16903. },
  16904. level: {
  16905. type: "number",
  16906. "default": 2
  16907. },
  16908. placeholder: {
  16909. type: "string"
  16910. }
  16911. },
  16912. supports: {
  16913. align: ["wide", "full"],
  16914. anchor: true,
  16915. className: false,
  16916. color: {
  16917. link: true,
  16918. __experimentalDefaultControls: {
  16919. background: true,
  16920. text: true
  16921. }
  16922. },
  16923. spacing: {
  16924. margin: true
  16925. },
  16926. typography: {
  16927. fontSize: true,
  16928. lineHeight: true,
  16929. __experimentalFontStyle: true,
  16930. __experimentalFontWeight: true,
  16931. __experimentalLetterSpacing: true,
  16932. __experimentalTextTransform: true,
  16933. __experimentalDefaultControls: {
  16934. fontSize: true,
  16935. fontAppearance: true,
  16936. textTransform: true
  16937. }
  16938. },
  16939. __experimentalSelector: "h1,h2,h3,h4,h5,h6",
  16940. __unstablePasteTextInline: true,
  16941. __experimentalSlashInserter: true
  16942. },
  16943. editorStyle: "wp-block-heading-editor",
  16944. style: "wp-block-heading"
  16945. };
  16946. const {
  16947. name: heading_name
  16948. } = heading_metadata;
  16949. const heading_settings = {
  16950. icon: library_heading,
  16951. example: {
  16952. attributes: {
  16953. content: (0,external_wp_i18n_namespaceObject.__)('Code is Poetry'),
  16954. level: 2
  16955. }
  16956. },
  16957. __experimentalLabel(attributes, _ref) {
  16958. let {
  16959. context
  16960. } = _ref;
  16961. if (context === 'accessibility') {
  16962. const {
  16963. content,
  16964. level
  16965. } = attributes;
  16966. return (0,external_lodash_namespaceObject.isEmpty)(content) ? (0,external_wp_i18n_namespaceObject.sprintf)(
  16967. /* translators: accessibility text. %s: heading level. */
  16968. (0,external_wp_i18n_namespaceObject.__)('Level %s. Empty.'), level) : (0,external_wp_i18n_namespaceObject.sprintf)(
  16969. /* translators: accessibility text. 1: heading level. 2: heading content. */
  16970. (0,external_wp_i18n_namespaceObject.__)('Level %1$s. %2$s'), level, content);
  16971. }
  16972. },
  16973. transforms: heading_transforms,
  16974. deprecated: heading_deprecated,
  16975. merge(attributes, attributesToMerge) {
  16976. return {
  16977. content: (attributes.content || '') + (attributesToMerge.content || '')
  16978. };
  16979. },
  16980. edit: heading_edit,
  16981. save: heading_save_save
  16982. };
  16983. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/home.js
  16984. /**
  16985. * WordPress dependencies
  16986. */
  16987. const home = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  16988. xmlns: "http://www.w3.org/2000/svg",
  16989. viewBox: "0 0 24 24"
  16990. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  16991. d: "M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"
  16992. }));
  16993. /* harmony default export */ var library_home = (home);
  16994. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/home-link/edit.js
  16995. /**
  16996. * External dependencies
  16997. */
  16998. /**
  16999. * WordPress dependencies
  17000. */
  17001. const preventDefault = event => event.preventDefault();
  17002. function HomeEdit(_ref) {
  17003. var _style$color, _style$color2, _style$color3, _style$color4;
  17004. let {
  17005. attributes,
  17006. setAttributes,
  17007. context,
  17008. clientId
  17009. } = _ref;
  17010. const {
  17011. homeUrl
  17012. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  17013. var _getUnstableBase;
  17014. const {
  17015. getUnstableBase // Site index.
  17016. } = select(external_wp_coreData_namespaceObject.store);
  17017. return {
  17018. homeUrl: (_getUnstableBase = getUnstableBase()) === null || _getUnstableBase === void 0 ? void 0 : _getUnstableBase.home
  17019. };
  17020. }, [clientId]);
  17021. const {
  17022. textColor,
  17023. backgroundColor,
  17024. style
  17025. } = context;
  17026. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  17027. className: classnames_default()('wp-block-navigation-item', {
  17028. 'has-text-color': !!textColor || !!(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.text),
  17029. [`has-${textColor}-color`]: !!textColor,
  17030. 'has-background': !!backgroundColor || !!(style !== null && style !== void 0 && (_style$color2 = style.color) !== null && _style$color2 !== void 0 && _style$color2.background),
  17031. [`has-${backgroundColor}-background-color`]: !!backgroundColor
  17032. }),
  17033. style: {
  17034. color: style === null || style === void 0 ? void 0 : (_style$color3 = style.color) === null || _style$color3 === void 0 ? void 0 : _style$color3.text,
  17035. backgroundColor: style === null || style === void 0 ? void 0 : (_style$color4 = style.color) === null || _style$color4 === void 0 ? void 0 : _style$color4.background
  17036. }
  17037. });
  17038. const {
  17039. label
  17040. } = attributes;
  17041. (0,external_wp_element_namespaceObject.useEffect)(() => {
  17042. if (label === undefined) {
  17043. setAttributes({
  17044. label: (0,external_wp_i18n_namespaceObject.__)('Home')
  17045. });
  17046. }
  17047. }, [clientId, label]);
  17048. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
  17049. className: "wp-block-home-link__content wp-block-navigation-item__content",
  17050. href: homeUrl,
  17051. onClick: preventDefault
  17052. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  17053. identifier: "label",
  17054. className: "wp-block-home-link__label",
  17055. value: label,
  17056. onChange: labelValue => {
  17057. setAttributes({
  17058. label: labelValue
  17059. });
  17060. },
  17061. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Home link text'),
  17062. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add home link'),
  17063. withoutInteractiveFormatting: true,
  17064. allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough']
  17065. }))));
  17066. }
  17067. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/home-link/save.js
  17068. /**
  17069. * WordPress dependencies
  17070. */
  17071. function home_link_save_save() {
  17072. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  17073. }
  17074. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/home-link/index.js
  17075. /**
  17076. * WordPress dependencies
  17077. */
  17078. /**
  17079. * Internal dependencies
  17080. */
  17081. const home_link_metadata = {
  17082. $schema: "https://schemas.wp.org/trunk/block.json",
  17083. apiVersion: 2,
  17084. name: "core/home-link",
  17085. category: "design",
  17086. parent: ["core/navigation"],
  17087. title: "Home Link",
  17088. description: "Create a link that always points to the homepage of the site. Usually not necessary if there is already a site title link present in the header.",
  17089. textdomain: "default",
  17090. attributes: {
  17091. label: {
  17092. type: "string"
  17093. }
  17094. },
  17095. usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "fontSize", "customFontSize", "style"],
  17096. supports: {
  17097. reusable: false,
  17098. html: false
  17099. },
  17100. editorStyle: "wp-block-home-link-editor",
  17101. style: "wp-block-home-link"
  17102. };
  17103. const {
  17104. name: home_link_name
  17105. } = home_link_metadata;
  17106. const home_link_settings = {
  17107. icon: library_home,
  17108. edit: HomeEdit,
  17109. save: home_link_save_save,
  17110. example: {
  17111. attributes: {
  17112. label: (0,external_wp_i18n_namespaceObject._x)('Home Link', 'block example')
  17113. }
  17114. }
  17115. };
  17116. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/html.js
  17117. /**
  17118. * WordPress dependencies
  17119. */
  17120. const html = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  17121. viewBox: "0 0 24 24",
  17122. xmlns: "http://www.w3.org/2000/svg"
  17123. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  17124. d: "M4.8 11.4H2.1V9H1v6h1.1v-2.6h2.7V15h1.1V9H4.8v2.4zm1.9-1.3h1.7V15h1.1v-4.9h1.7V9H6.7v1.1zM16.2 9l-1.5 2.7L13.3 9h-.9l-.8 6h1.1l.5-4 1.5 2.8 1.5-2.8.5 4h1.1L17 9h-.8zm3.8 5V9h-1.1v6h3.6v-1H20z"
  17125. }));
  17126. /* harmony default export */ var library_html = (html);
  17127. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/edit.js
  17128. /**
  17129. * WordPress dependencies
  17130. */
  17131. function HTMLEdit(_ref) {
  17132. let {
  17133. attributes,
  17134. setAttributes,
  17135. isSelected
  17136. } = _ref;
  17137. const [isPreview, setIsPreview] = (0,external_wp_element_namespaceObject.useState)();
  17138. const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context);
  17139. const styles = (0,external_wp_data_namespaceObject.useSelect)(select => {
  17140. // Default styles used to unset some of the styles
  17141. // that might be inherited from the editor style.
  17142. const defaultStyles = `
  17143. html,body,:root {
  17144. margin: 0 !important;
  17145. padding: 0 !important;
  17146. overflow: visible !important;
  17147. min-height: auto !important;
  17148. }
  17149. `;
  17150. return [defaultStyles, ...(0,external_wp_blockEditor_namespaceObject.transformStyles)(select(external_wp_blockEditor_namespaceObject.store).getSettings().styles)];
  17151. }, []);
  17152. function switchToPreview() {
  17153. setIsPreview(true);
  17154. }
  17155. function switchToHTML() {
  17156. setIsPreview(false);
  17157. }
  17158. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  17159. className: 'block-library-html__edit'
  17160. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  17161. className: "components-tab-button",
  17162. isPressed: !isPreview,
  17163. onClick: switchToHTML
  17164. }, (0,external_wp_element_namespaceObject.createElement)("span", null, "HTML")), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  17165. className: "components-tab-button",
  17166. isPressed: isPreview,
  17167. onClick: switchToPreview
  17168. }, (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Preview'))))), isPreview || isDisabled ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SandBox, {
  17169. html: attributes.content,
  17170. styles: styles
  17171. }), !isSelected && (0,external_wp_element_namespaceObject.createElement)("div", {
  17172. className: "block-library-html__preview-overlay"
  17173. })) : (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  17174. value: attributes.content,
  17175. onChange: content => setAttributes({
  17176. content
  17177. }),
  17178. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write HTML…'),
  17179. "aria-label": (0,external_wp_i18n_namespaceObject.__)('HTML')
  17180. }));
  17181. }
  17182. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/save.js
  17183. /**
  17184. * WordPress dependencies
  17185. */
  17186. function html_save_save(_ref) {
  17187. let {
  17188. attributes
  17189. } = _ref;
  17190. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.content);
  17191. }
  17192. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/transforms.js
  17193. /**
  17194. * WordPress dependencies
  17195. */
  17196. const html_transforms_transforms = {
  17197. from: [{
  17198. type: 'block',
  17199. blocks: ['core/code'],
  17200. transform: _ref => {
  17201. let {
  17202. content
  17203. } = _ref;
  17204. return (0,external_wp_blocks_namespaceObject.createBlock)('core/html', {
  17205. content
  17206. });
  17207. }
  17208. }]
  17209. };
  17210. /* harmony default export */ var html_transforms = (html_transforms_transforms);
  17211. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/index.js
  17212. /**
  17213. * WordPress dependencies
  17214. */
  17215. /**
  17216. * Internal dependencies
  17217. */
  17218. const html_metadata = {
  17219. $schema: "https://schemas.wp.org/trunk/block.json",
  17220. apiVersion: 2,
  17221. name: "core/html",
  17222. title: "Custom HTML",
  17223. category: "widgets",
  17224. description: "Add custom HTML code and preview it as you edit.",
  17225. keywords: ["embed"],
  17226. textdomain: "default",
  17227. attributes: {
  17228. content: {
  17229. type: "string",
  17230. source: "html"
  17231. }
  17232. },
  17233. supports: {
  17234. customClassName: false,
  17235. className: false,
  17236. html: false
  17237. },
  17238. editorStyle: "wp-block-html-editor"
  17239. };
  17240. const {
  17241. name: html_name
  17242. } = html_metadata;
  17243. const html_settings = {
  17244. icon: library_html,
  17245. example: {
  17246. attributes: {
  17247. content: '<marquee>' + (0,external_wp_i18n_namespaceObject.__)('Welcome to the wonderful world of blocks…') + '</marquee>'
  17248. }
  17249. },
  17250. edit: HTMLEdit,
  17251. save: html_save_save,
  17252. transforms: html_transforms
  17253. };
  17254. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/deprecated.js
  17255. /**
  17256. * External dependencies
  17257. */
  17258. /**
  17259. * WordPress dependencies
  17260. */
  17261. const image_deprecated_blockAttributes = {
  17262. align: {
  17263. type: 'string'
  17264. },
  17265. url: {
  17266. type: 'string',
  17267. source: 'attribute',
  17268. selector: 'img',
  17269. attribute: 'src'
  17270. },
  17271. alt: {
  17272. type: 'string',
  17273. source: 'attribute',
  17274. selector: 'img',
  17275. attribute: 'alt',
  17276. default: ''
  17277. },
  17278. caption: {
  17279. type: 'string',
  17280. source: 'html',
  17281. selector: 'figcaption'
  17282. },
  17283. href: {
  17284. type: 'string',
  17285. source: 'attribute',
  17286. selector: 'figure > a',
  17287. attribute: 'href'
  17288. },
  17289. rel: {
  17290. type: 'string',
  17291. source: 'attribute',
  17292. selector: 'figure > a',
  17293. attribute: 'rel'
  17294. },
  17295. linkClass: {
  17296. type: 'string',
  17297. source: 'attribute',
  17298. selector: 'figure > a',
  17299. attribute: 'class'
  17300. },
  17301. id: {
  17302. type: 'number'
  17303. },
  17304. width: {
  17305. type: 'number'
  17306. },
  17307. height: {
  17308. type: 'number'
  17309. },
  17310. linkDestination: {
  17311. type: 'string'
  17312. },
  17313. linkTarget: {
  17314. type: 'string',
  17315. source: 'attribute',
  17316. selector: 'figure > a',
  17317. attribute: 'target'
  17318. }
  17319. };
  17320. const deprecated_blockSupports = {
  17321. anchor: true,
  17322. color: {
  17323. __experimentalDuotone: 'img',
  17324. text: false,
  17325. background: false
  17326. },
  17327. __experimentalBorder: {
  17328. radius: true,
  17329. __experimentalDefaultControls: {
  17330. radius: true
  17331. }
  17332. }
  17333. };
  17334. const image_deprecated_deprecated = [{
  17335. attributes: { ...image_deprecated_blockAttributes,
  17336. title: {
  17337. type: 'string',
  17338. source: 'attribute',
  17339. selector: 'img',
  17340. attribute: 'title'
  17341. },
  17342. sizeSlug: {
  17343. type: 'string'
  17344. }
  17345. },
  17346. supports: deprecated_blockSupports,
  17347. save(_ref) {
  17348. let {
  17349. attributes
  17350. } = _ref;
  17351. const {
  17352. url,
  17353. alt,
  17354. caption,
  17355. align,
  17356. href,
  17357. rel,
  17358. linkClass,
  17359. width,
  17360. height,
  17361. id,
  17362. linkTarget,
  17363. sizeSlug,
  17364. title
  17365. } = attributes;
  17366. const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
  17367. const classes = classnames_default()({
  17368. [`align${align}`]: align,
  17369. [`size-${sizeSlug}`]: sizeSlug,
  17370. 'is-resized': width || height
  17371. });
  17372. const image = (0,external_wp_element_namespaceObject.createElement)("img", {
  17373. src: url,
  17374. alt: alt,
  17375. className: id ? `wp-image-${id}` : null,
  17376. width: width,
  17377. height: height,
  17378. title: title
  17379. });
  17380. const figure = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  17381. className: linkClass,
  17382. href: href,
  17383. target: linkTarget,
  17384. rel: newRel
  17385. }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  17386. tagName: "figcaption",
  17387. value: caption
  17388. }));
  17389. if ('left' === align || 'right' === align || 'center' === align) {
  17390. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("figure", {
  17391. className: classes
  17392. }, figure));
  17393. }
  17394. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  17395. className: classes
  17396. }), figure);
  17397. }
  17398. }, {
  17399. attributes: image_deprecated_blockAttributes,
  17400. save(_ref2) {
  17401. let {
  17402. attributes
  17403. } = _ref2;
  17404. const {
  17405. url,
  17406. alt,
  17407. caption,
  17408. align,
  17409. href,
  17410. width,
  17411. height,
  17412. id
  17413. } = attributes;
  17414. const classes = classnames_default()({
  17415. [`align${align}`]: align,
  17416. 'is-resized': width || height
  17417. });
  17418. const image = (0,external_wp_element_namespaceObject.createElement)("img", {
  17419. src: url,
  17420. alt: alt,
  17421. className: id ? `wp-image-${id}` : null,
  17422. width: width,
  17423. height: height
  17424. });
  17425. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  17426. className: classes
  17427. }, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  17428. href: href
  17429. }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  17430. tagName: "figcaption",
  17431. value: caption
  17432. }));
  17433. }
  17434. }, {
  17435. attributes: image_deprecated_blockAttributes,
  17436. save(_ref3) {
  17437. let {
  17438. attributes
  17439. } = _ref3;
  17440. const {
  17441. url,
  17442. alt,
  17443. caption,
  17444. align,
  17445. href,
  17446. width,
  17447. height,
  17448. id
  17449. } = attributes;
  17450. const image = (0,external_wp_element_namespaceObject.createElement)("img", {
  17451. src: url,
  17452. alt: alt,
  17453. className: id ? `wp-image-${id}` : null,
  17454. width: width,
  17455. height: height
  17456. });
  17457. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  17458. className: align ? `align${align}` : null
  17459. }, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  17460. href: href
  17461. }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  17462. tagName: "figcaption",
  17463. value: caption
  17464. }));
  17465. }
  17466. }, {
  17467. attributes: image_deprecated_blockAttributes,
  17468. save(_ref4) {
  17469. let {
  17470. attributes
  17471. } = _ref4;
  17472. const {
  17473. url,
  17474. alt,
  17475. caption,
  17476. align,
  17477. href,
  17478. width,
  17479. height
  17480. } = attributes;
  17481. const extraImageProps = width || height ? {
  17482. width,
  17483. height
  17484. } : {};
  17485. const image = (0,external_wp_element_namespaceObject.createElement)("img", _extends({
  17486. src: url,
  17487. alt: alt
  17488. }, extraImageProps));
  17489. let figureStyle = {};
  17490. if (width) {
  17491. figureStyle = {
  17492. width
  17493. };
  17494. } else if (align === 'left' || align === 'right') {
  17495. figureStyle = {
  17496. maxWidth: '50%'
  17497. };
  17498. }
  17499. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  17500. className: align ? `align${align}` : null,
  17501. style: figureStyle
  17502. }, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  17503. href: href
  17504. }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  17505. tagName: "figcaption",
  17506. value: caption
  17507. }));
  17508. }
  17509. }];
  17510. /* harmony default export */ var image_deprecated = (image_deprecated_deprecated);
  17511. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/crop.js
  17512. /**
  17513. * WordPress dependencies
  17514. */
  17515. const crop = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  17516. xmlns: "http://www.w3.org/2000/svg",
  17517. viewBox: "0 0 24 24"
  17518. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  17519. d: "M16.5 7.8v7H18v-7c0-1-.8-1.8-1.8-1.8h-7v1.5h7c.2 0 .3.1.3.3zm-8.7 8.7c-.1 0-.2-.1-.2-.2V2H6v4H2v1.5h4v8.8c0 1 .8 1.8 1.8 1.8h8.8v4H18v-4h4v-1.5H7.8z"
  17520. }));
  17521. /* harmony default export */ var library_crop = (crop);
  17522. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/upload.js
  17523. /**
  17524. * WordPress dependencies
  17525. */
  17526. const upload = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  17527. xmlns: "http://www.w3.org/2000/svg",
  17528. viewBox: "0 0 24 24"
  17529. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  17530. d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"
  17531. }));
  17532. /* harmony default export */ var library_upload = (upload);
  17533. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/overlay-text.js
  17534. /**
  17535. * WordPress dependencies
  17536. */
  17537. const overlayText = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  17538. xmlns: "http://www.w3.org/2000/svg",
  17539. viewBox: "0 0 24 24"
  17540. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  17541. d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12-9.8c.4 0 .8-.3.9-.7l1.1-3h3.6l.5 1.7h1.9L13 9h-2.2l-3.4 9.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12H20V6c0-1.1-.9-2-2-2zm-6 7l1.4 3.9h-2.7L12 11z"
  17542. }));
  17543. /* harmony default export */ var overlay_text = (overlayText);
  17544. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/use-client-width.js
  17545. /**
  17546. * WordPress dependencies
  17547. */
  17548. function useClientWidth(ref, dependencies) {
  17549. const [clientWidth, setClientWidth] = (0,external_wp_element_namespaceObject.useState)();
  17550. function calculateClientWidth() {
  17551. setClientWidth(ref.current.clientWidth);
  17552. }
  17553. (0,external_wp_element_namespaceObject.useEffect)(calculateClientWidth, dependencies);
  17554. (0,external_wp_element_namespaceObject.useEffect)(() => {
  17555. const {
  17556. defaultView
  17557. } = ref.current.ownerDocument;
  17558. defaultView.addEventListener('resize', calculateClientWidth);
  17559. return () => {
  17560. defaultView.removeEventListener('resize', calculateClientWidth);
  17561. };
  17562. }, []);
  17563. return clientWidth;
  17564. }
  17565. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image.js
  17566. /**
  17567. * External dependencies
  17568. */
  17569. /**
  17570. * WordPress dependencies
  17571. */
  17572. /**
  17573. * Internal dependencies
  17574. */
  17575. /**
  17576. * Module constants
  17577. */
  17578. function Image(_ref) {
  17579. var _imageRef$current3;
  17580. let {
  17581. temporaryURL,
  17582. attributes: {
  17583. url = '',
  17584. alt,
  17585. caption,
  17586. align,
  17587. id,
  17588. href,
  17589. rel,
  17590. linkClass,
  17591. linkDestination,
  17592. title,
  17593. width,
  17594. height,
  17595. linkTarget,
  17596. sizeSlug
  17597. },
  17598. setAttributes,
  17599. isSelected,
  17600. insertBlocksAfter,
  17601. onReplace,
  17602. onSelectImage,
  17603. onSelectURL,
  17604. onUploadError,
  17605. containerRef,
  17606. context,
  17607. clientId
  17608. } = _ref;
  17609. const imageRef = (0,external_wp_element_namespaceObject.useRef)();
  17610. const captionRef = (0,external_wp_element_namespaceObject.useRef)();
  17611. const prevUrl = (0,external_wp_compose_namespaceObject.usePrevious)(url);
  17612. const {
  17613. allowResize = true
  17614. } = context;
  17615. const {
  17616. getBlock
  17617. } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
  17618. const {
  17619. image,
  17620. multiImageSelection
  17621. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  17622. const {
  17623. getMedia
  17624. } = select(external_wp_coreData_namespaceObject.store);
  17625. const {
  17626. getMultiSelectedBlockClientIds,
  17627. getBlockName
  17628. } = select(external_wp_blockEditor_namespaceObject.store);
  17629. const multiSelectedClientIds = getMultiSelectedBlockClientIds();
  17630. return {
  17631. image: id && isSelected ? getMedia(id, {
  17632. context: 'view'
  17633. }) : null,
  17634. multiImageSelection: multiSelectedClientIds.length && multiSelectedClientIds.every(_clientId => getBlockName(_clientId) === 'core/image')
  17635. };
  17636. }, [id, isSelected]);
  17637. const {
  17638. canInsertCover,
  17639. imageEditing,
  17640. imageSizes,
  17641. maxWidth,
  17642. mediaUpload
  17643. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  17644. const {
  17645. getBlockRootClientId,
  17646. getSettings,
  17647. canInsertBlockType
  17648. } = select(external_wp_blockEditor_namespaceObject.store);
  17649. const rootClientId = getBlockRootClientId(clientId);
  17650. const settings = (0,external_lodash_namespaceObject.pick)(getSettings(), ['imageEditing', 'imageSizes', 'maxWidth', 'mediaUpload']);
  17651. return { ...settings,
  17652. canInsertCover: canInsertBlockType('core/cover', rootClientId)
  17653. };
  17654. }, [clientId]);
  17655. const {
  17656. replaceBlocks,
  17657. toggleSelection
  17658. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  17659. const {
  17660. createErrorNotice,
  17661. createSuccessNotice
  17662. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  17663. const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
  17664. const isWideAligned = (0,external_lodash_namespaceObject.includes)(['wide', 'full'], align);
  17665. const [{
  17666. loadedNaturalWidth,
  17667. loadedNaturalHeight
  17668. }, setLoadedNaturalSize] = (0,external_wp_element_namespaceObject.useState)({});
  17669. const [isEditingImage, setIsEditingImage] = (0,external_wp_element_namespaceObject.useState)(false);
  17670. const [externalBlob, setExternalBlob] = (0,external_wp_element_namespaceObject.useState)();
  17671. const clientWidth = useClientWidth(containerRef, [align]);
  17672. const isResizable = allowResize && !(isWideAligned && isLargeViewport);
  17673. const imageSizeOptions = (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(imageSizes, _ref2 => {
  17674. let {
  17675. slug
  17676. } = _ref2;
  17677. return (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', slug, 'source_url']);
  17678. }), _ref3 => {
  17679. let {
  17680. name,
  17681. slug
  17682. } = _ref3;
  17683. return {
  17684. value: slug,
  17685. label: name
  17686. };
  17687. }); // If an image is externally hosted, try to fetch the image data. This may
  17688. // fail if the image host doesn't allow CORS with the domain. If it works,
  17689. // we can enable a button in the toolbar to upload the image.
  17690. (0,external_wp_element_namespaceObject.useEffect)(() => {
  17691. if (!isExternalImage(id, url) || !isSelected || externalBlob) {
  17692. return;
  17693. }
  17694. window.fetch(url).then(response => response.blob()).then(blob => setExternalBlob(blob)) // Do nothing, cannot upload.
  17695. .catch(() => {});
  17696. }, [id, url, isSelected, externalBlob]); // Focus the caption after inserting an image from the placeholder. This is
  17697. // done to preserve the behaviour of focussing the first tabbable element
  17698. // when a block is mounted. Previously, the image block would remount when
  17699. // the placeholder is removed. Maybe this behaviour could be removed.
  17700. (0,external_wp_element_namespaceObject.useEffect)(() => {
  17701. if (url && !prevUrl && isSelected) {
  17702. captionRef.current.focus();
  17703. }
  17704. }, [url, prevUrl]); // Get naturalWidth and naturalHeight from image ref, and fall back to loaded natural
  17705. // width and height. This resolves an issue in Safari where the loaded natural
  17706. // witdth and height is otherwise lost when switching between alignments.
  17707. // See: https://github.com/WordPress/gutenberg/pull/37210.
  17708. const {
  17709. naturalWidth,
  17710. naturalHeight
  17711. } = (0,external_wp_element_namespaceObject.useMemo)(() => {
  17712. var _imageRef$current, _imageRef$current2;
  17713. return {
  17714. naturalWidth: ((_imageRef$current = imageRef.current) === null || _imageRef$current === void 0 ? void 0 : _imageRef$current.naturalWidth) || loadedNaturalWidth || undefined,
  17715. naturalHeight: ((_imageRef$current2 = imageRef.current) === null || _imageRef$current2 === void 0 ? void 0 : _imageRef$current2.naturalHeight) || loadedNaturalHeight || undefined
  17716. };
  17717. }, [loadedNaturalWidth, loadedNaturalHeight, (_imageRef$current3 = imageRef.current) === null || _imageRef$current3 === void 0 ? void 0 : _imageRef$current3.complete]);
  17718. function onResizeStart() {
  17719. toggleSelection(false);
  17720. }
  17721. function onResizeStop() {
  17722. toggleSelection(true);
  17723. }
  17724. function onImageError() {
  17725. // Check if there's an embed block that handles this URL.
  17726. const embedBlock = createUpgradedEmbedBlock({
  17727. attributes: {
  17728. url
  17729. }
  17730. });
  17731. if (undefined !== embedBlock) {
  17732. onReplace(embedBlock);
  17733. }
  17734. }
  17735. function onSetHref(props) {
  17736. setAttributes(props);
  17737. }
  17738. function onSetTitle(value) {
  17739. // This is the HTML title attribute, separate from the media object
  17740. // title.
  17741. setAttributes({
  17742. title: value
  17743. });
  17744. }
  17745. function updateAlt(newAlt) {
  17746. setAttributes({
  17747. alt: newAlt
  17748. });
  17749. }
  17750. function updateImage(newSizeSlug) {
  17751. const newUrl = (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', newSizeSlug, 'source_url']);
  17752. if (!newUrl) {
  17753. return null;
  17754. }
  17755. setAttributes({
  17756. url: newUrl,
  17757. width: undefined,
  17758. height: undefined,
  17759. sizeSlug: newSizeSlug
  17760. });
  17761. }
  17762. function uploadExternal() {
  17763. mediaUpload({
  17764. filesList: [externalBlob],
  17765. onFileChange(_ref4) {
  17766. let [img] = _ref4;
  17767. onSelectImage(img);
  17768. if ((0,external_wp_blob_namespaceObject.isBlobURL)(img.url)) {
  17769. return;
  17770. }
  17771. setExternalBlob();
  17772. createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Image uploaded.'), {
  17773. type: 'snackbar'
  17774. });
  17775. },
  17776. allowedTypes: constants_ALLOWED_MEDIA_TYPES,
  17777. onError(message) {
  17778. createErrorNotice(message, {
  17779. type: 'snackbar'
  17780. });
  17781. }
  17782. });
  17783. }
  17784. function updateAlignment(nextAlign) {
  17785. const extraUpdatedAttributes = ['wide', 'full'].includes(nextAlign) ? {
  17786. width: undefined,
  17787. height: undefined
  17788. } : {};
  17789. setAttributes({ ...extraUpdatedAttributes,
  17790. align: nextAlign
  17791. });
  17792. }
  17793. (0,external_wp_element_namespaceObject.useEffect)(() => {
  17794. if (!isSelected) {
  17795. setIsEditingImage(false);
  17796. }
  17797. }, [isSelected]);
  17798. const canEditImage = id && naturalWidth && naturalHeight && imageEditing;
  17799. const allowCrop = !multiImageSelection && canEditImage && !isEditingImage;
  17800. function switchToCover() {
  17801. replaceBlocks(clientId, (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(clientId), 'core/cover'));
  17802. }
  17803. const controls = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  17804. group: "block"
  17805. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentControl, {
  17806. value: align,
  17807. onChange: updateAlignment
  17808. }), !multiImageSelection && !isEditingImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageURLInputUI, {
  17809. url: href || '',
  17810. onChangeUrl: onSetHref,
  17811. linkDestination: linkDestination,
  17812. mediaUrl: image && image.source_url || url,
  17813. mediaLink: image && image.link,
  17814. linkTarget: linkTarget,
  17815. linkClass: linkClass,
  17816. rel: rel
  17817. }), allowCrop && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  17818. onClick: () => setIsEditingImage(true),
  17819. icon: library_crop,
  17820. label: (0,external_wp_i18n_namespaceObject.__)('Crop')
  17821. }), externalBlob && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  17822. onClick: uploadExternal,
  17823. icon: library_upload,
  17824. label: (0,external_wp_i18n_namespaceObject.__)('Upload external image')
  17825. }), !multiImageSelection && canInsertCover && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  17826. icon: overlay_text,
  17827. label: (0,external_wp_i18n_namespaceObject.__)('Add text over image'),
  17828. onClick: switchToCover
  17829. })), !multiImageSelection && !isEditingImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  17830. group: "other"
  17831. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  17832. mediaId: id,
  17833. mediaURL: url,
  17834. allowedTypes: constants_ALLOWED_MEDIA_TYPES,
  17835. accept: "image/*",
  17836. onSelect: onSelectImage,
  17837. onSelectURL: onSelectURL,
  17838. onError: onUploadError
  17839. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  17840. title: (0,external_wp_i18n_namespaceObject.__)('Image settings')
  17841. }, !multiImageSelection && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
  17842. label: (0,external_wp_i18n_namespaceObject.__)('Alt text (alternative text)'),
  17843. value: alt,
  17844. onChange: updateAlt,
  17845. help: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
  17846. href: "https://www.w3.org/WAI/tutorials/images/decision-tree"
  17847. }, (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image')), (0,external_wp_i18n_namespaceObject.__)('Leave empty if the image is purely decorative.'))
  17848. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageSizeControl, {
  17849. onChangeImage: updateImage,
  17850. onChange: value => setAttributes(value),
  17851. slug: sizeSlug,
  17852. width: width,
  17853. height: height,
  17854. imageSizeOptions: imageSizeOptions,
  17855. isResizable: isResizable,
  17856. imageWidth: naturalWidth,
  17857. imageHeight: naturalHeight
  17858. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  17859. __experimentalGroup: "advanced"
  17860. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  17861. label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'),
  17862. value: title || '',
  17863. onChange: onSetTitle,
  17864. help: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_i18n_namespaceObject.__)('Describe the role of this image on the page.'), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
  17865. href: "https://www.w3.org/TR/html52/dom.html#the-title-attribute"
  17866. }, (0,external_wp_i18n_namespaceObject.__)('(Note: many devices and browsers do not display this text.)')))
  17867. })));
  17868. const filename = (0,external_wp_url_namespaceObject.getFilename)(url);
  17869. let defaultedAlt;
  17870. if (alt) {
  17871. defaultedAlt = alt;
  17872. } else if (filename) {
  17873. defaultedAlt = (0,external_wp_i18n_namespaceObject.sprintf)(
  17874. /* translators: %s: file name */
  17875. (0,external_wp_i18n_namespaceObject.__)('This image has an empty alt attribute; its file name is %s'), filename);
  17876. } else {
  17877. defaultedAlt = (0,external_wp_i18n_namespaceObject.__)('This image has an empty alt attribute');
  17878. }
  17879. let img = // Disable reason: Image itself is not meant to be interactive, but
  17880. // should direct focus to block.
  17881. /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
  17882. (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("img", {
  17883. src: temporaryURL || url,
  17884. alt: defaultedAlt,
  17885. onError: () => onImageError(),
  17886. onLoad: event => {
  17887. var _event$target, _event$target2;
  17888. setLoadedNaturalSize({
  17889. loadedNaturalWidth: (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.naturalWidth,
  17890. loadedNaturalHeight: (_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.naturalHeight
  17891. });
  17892. },
  17893. ref: imageRef
  17894. }), temporaryURL && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null))
  17895. /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
  17896. ;
  17897. let imageWidthWithinContainer;
  17898. let imageHeightWithinContainer;
  17899. if (clientWidth && naturalWidth && naturalHeight) {
  17900. const exceedMaxWidth = naturalWidth > clientWidth;
  17901. const ratio = naturalHeight / naturalWidth;
  17902. imageWidthWithinContainer = exceedMaxWidth ? clientWidth : naturalWidth;
  17903. imageHeightWithinContainer = exceedMaxWidth ? clientWidth * ratio : naturalHeight;
  17904. }
  17905. if (canEditImage && isEditingImage) {
  17906. img = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditor, {
  17907. url: url,
  17908. width: width,
  17909. height: height,
  17910. clientWidth: clientWidth,
  17911. naturalHeight: naturalHeight,
  17912. naturalWidth: naturalWidth
  17913. });
  17914. } else if (!isResizable || !imageWidthWithinContainer) {
  17915. img = (0,external_wp_element_namespaceObject.createElement)("div", {
  17916. style: {
  17917. width,
  17918. height
  17919. }
  17920. }, img);
  17921. } else {
  17922. const currentWidth = width || imageWidthWithinContainer;
  17923. const currentHeight = height || imageHeightWithinContainer;
  17924. const ratio = naturalWidth / naturalHeight;
  17925. const minWidth = naturalWidth < naturalHeight ? MIN_SIZE : MIN_SIZE * ratio;
  17926. const minHeight = naturalHeight < naturalWidth ? MIN_SIZE : MIN_SIZE / ratio; // With the current implementation of ResizableBox, an image needs an
  17927. // explicit pixel value for the max-width. In absence of being able to
  17928. // set the content-width, this max-width is currently dictated by the
  17929. // vanilla editor style. The following variable adds a buffer to this
  17930. // vanilla style, so 3rd party themes have some wiggleroom. This does,
  17931. // in most cases, allow you to scale the image beyond the width of the
  17932. // main column, though not infinitely.
  17933. // @todo It would be good to revisit this once a content-width variable
  17934. // becomes available.
  17935. const maxWidthBuffer = maxWidth * 2.5;
  17936. let showRightHandle = false;
  17937. let showLeftHandle = false;
  17938. /* eslint-disable no-lonely-if */
  17939. // See https://github.com/WordPress/gutenberg/issues/7584.
  17940. if (align === 'center') {
  17941. // When the image is centered, show both handles.
  17942. showRightHandle = true;
  17943. showLeftHandle = true;
  17944. } else if ((0,external_wp_i18n_namespaceObject.isRTL)()) {
  17945. // In RTL mode the image is on the right by default.
  17946. // Show the right handle and hide the left handle only when it is
  17947. // aligned left. Otherwise always show the left handle.
  17948. if (align === 'left') {
  17949. showRightHandle = true;
  17950. } else {
  17951. showLeftHandle = true;
  17952. }
  17953. } else {
  17954. // Show the left handle and hide the right handle only when the
  17955. // image is aligned right. Otherwise always show the right handle.
  17956. if (align === 'right') {
  17957. showLeftHandle = true;
  17958. } else {
  17959. showRightHandle = true;
  17960. }
  17961. }
  17962. /* eslint-enable no-lonely-if */
  17963. img = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
  17964. size: {
  17965. width: width !== null && width !== void 0 ? width : 'auto',
  17966. height: height !== null && height !== void 0 ? height : 'auto'
  17967. },
  17968. showHandle: isSelected,
  17969. minWidth: minWidth,
  17970. maxWidth: maxWidthBuffer,
  17971. minHeight: minHeight,
  17972. maxHeight: maxWidthBuffer / ratio,
  17973. lockAspectRatio: true,
  17974. enable: {
  17975. top: false,
  17976. right: showRightHandle,
  17977. bottom: true,
  17978. left: showLeftHandle
  17979. },
  17980. onResizeStart: onResizeStart,
  17981. onResizeStop: (event, direction, elt, delta) => {
  17982. onResizeStop();
  17983. setAttributes({
  17984. width: parseInt(currentWidth + delta.width, 10),
  17985. height: parseInt(currentHeight + delta.height, 10)
  17986. });
  17987. }
  17988. }, img);
  17989. }
  17990. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditingProvider, {
  17991. id: id,
  17992. url: url,
  17993. naturalWidth: naturalWidth,
  17994. naturalHeight: naturalHeight,
  17995. clientWidth: clientWidth,
  17996. onSaveImage: imageAttributes => setAttributes(imageAttributes),
  17997. isEditing: isEditingImage,
  17998. onFinishEditing: () => setIsEditingImage(false)
  17999. }, !temporaryURL && controls, img, (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  18000. ref: captionRef,
  18001. tagName: "figcaption",
  18002. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Image caption text'),
  18003. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
  18004. value: caption,
  18005. onChange: value => setAttributes({
  18006. caption: value
  18007. }),
  18008. inlineToolbar: true,
  18009. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
  18010. }));
  18011. }
  18012. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/edit.js
  18013. /**
  18014. * External dependencies
  18015. */
  18016. /**
  18017. * WordPress dependencies
  18018. */
  18019. /* global wp */
  18020. /**
  18021. * Internal dependencies
  18022. */
  18023. /**
  18024. * Module constants
  18025. */
  18026. const edit_pickRelevantMediaFiles = (image, size) => {
  18027. const imageProps = (0,external_lodash_namespaceObject.pick)(image, ['alt', 'id', 'link', 'caption']);
  18028. imageProps.url = (0,external_lodash_namespaceObject.get)(image, ['sizes', size, 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', size, 'source_url']) || image.url;
  18029. return imageProps;
  18030. };
  18031. /**
  18032. * Is the URL a temporary blob URL? A blob URL is one that is used temporarily
  18033. * while the image is being uploaded and will not have an id yet allocated.
  18034. *
  18035. * @param {number=} id The id of the image.
  18036. * @param {string=} url The url of the image.
  18037. *
  18038. * @return {boolean} Is the URL a Blob URL
  18039. */
  18040. const edit_isTemporaryImage = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url);
  18041. /**
  18042. * Is the url for the image hosted externally. An externally hosted image has no
  18043. * id and is not a blob url.
  18044. *
  18045. * @param {number=} id The id of the image.
  18046. * @param {string=} url The url of the image.
  18047. *
  18048. * @return {boolean} Is the url an externally hosted url?
  18049. */
  18050. const isExternalImage = (id, url) => url && !id && !(0,external_wp_blob_namespaceObject.isBlobURL)(url);
  18051. /**
  18052. * Checks if WP generated default image size. Size generation is skipped
  18053. * when the image is smaller than the said size.
  18054. *
  18055. * @param {Object} image
  18056. * @param {string} defaultSize
  18057. *
  18058. * @return {boolean} Whether or not it has default image size.
  18059. */
  18060. function hasDefaultSize(image, defaultSize) {
  18061. return (0,external_lodash_namespaceObject.has)(image, ['sizes', defaultSize, 'url']) || (0,external_lodash_namespaceObject.has)(image, ['media_details', 'sizes', defaultSize, 'source_url']);
  18062. }
  18063. function ImageEdit(_ref) {
  18064. let {
  18065. attributes,
  18066. setAttributes,
  18067. isSelected,
  18068. className,
  18069. noticeUI,
  18070. insertBlocksAfter,
  18071. noticeOperations,
  18072. onReplace,
  18073. context,
  18074. clientId
  18075. } = _ref;
  18076. const {
  18077. url = '',
  18078. alt,
  18079. caption,
  18080. align,
  18081. id,
  18082. width,
  18083. height,
  18084. sizeSlug
  18085. } = attributes;
  18086. const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)();
  18087. const altRef = (0,external_wp_element_namespaceObject.useRef)();
  18088. (0,external_wp_element_namespaceObject.useEffect)(() => {
  18089. altRef.current = alt;
  18090. }, [alt]);
  18091. const captionRef = (0,external_wp_element_namespaceObject.useRef)();
  18092. (0,external_wp_element_namespaceObject.useEffect)(() => {
  18093. captionRef.current = caption;
  18094. }, [caption]);
  18095. const ref = (0,external_wp_element_namespaceObject.useRef)();
  18096. const {
  18097. imageDefaultSize,
  18098. mediaUpload
  18099. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  18100. const {
  18101. getSettings
  18102. } = select(external_wp_blockEditor_namespaceObject.store);
  18103. return (0,external_lodash_namespaceObject.pick)(getSettings(), ['imageDefaultSize', 'mediaUpload']);
  18104. }, []);
  18105. function onUploadError(message) {
  18106. noticeOperations.removeAllNotices();
  18107. noticeOperations.createErrorNotice(message);
  18108. setAttributes({
  18109. src: undefined,
  18110. id: undefined,
  18111. url: undefined
  18112. });
  18113. setTemporaryURL(undefined);
  18114. }
  18115. function onSelectImage(media) {
  18116. var _wp, _wp$media, _wp$media$view, _wp$media$view$settin, _wp$media$view$settin2;
  18117. if (!media || !media.url) {
  18118. setAttributes({
  18119. url: undefined,
  18120. alt: undefined,
  18121. id: undefined,
  18122. title: undefined,
  18123. caption: undefined
  18124. });
  18125. return;
  18126. }
  18127. if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
  18128. setTemporaryURL(media.url);
  18129. return;
  18130. }
  18131. setTemporaryURL();
  18132. let mediaAttributes = edit_pickRelevantMediaFiles(media, imageDefaultSize); // If a caption text was meanwhile written by the user,
  18133. // make sure the text is not overwritten by empty captions.
  18134. if (captionRef.current && !(0,external_lodash_namespaceObject.get)(mediaAttributes, ['caption'])) {
  18135. mediaAttributes = (0,external_lodash_namespaceObject.omit)(mediaAttributes, ['caption']);
  18136. }
  18137. let additionalAttributes; // Reset the dimension attributes if changing to a different image.
  18138. if (!media.id || media.id !== id) {
  18139. additionalAttributes = {
  18140. width: undefined,
  18141. height: undefined,
  18142. // Fallback to size "full" if there's no default image size.
  18143. // It means the image is smaller, and the block will use a full-size URL.
  18144. sizeSlug: hasDefaultSize(media, imageDefaultSize) ? imageDefaultSize : 'full'
  18145. };
  18146. } else {
  18147. // Keep the same url when selecting the same file, so "Image Size"
  18148. // option is not changed.
  18149. additionalAttributes = {
  18150. url
  18151. };
  18152. } // Check if default link setting should be used.
  18153. let linkDestination = attributes.linkDestination;
  18154. if (!linkDestination) {
  18155. // Use the WordPress option to determine the proper default.
  18156. // The constants used in Gutenberg do not match WP options so a little more complicated than ideal.
  18157. // TODO: fix this in a follow up PR, requires updating media-text and ui component.
  18158. switch (((_wp = wp) === null || _wp === void 0 ? void 0 : (_wp$media = _wp.media) === null || _wp$media === void 0 ? void 0 : (_wp$media$view = _wp$media.view) === null || _wp$media$view === void 0 ? void 0 : (_wp$media$view$settin = _wp$media$view.settings) === null || _wp$media$view$settin === void 0 ? void 0 : (_wp$media$view$settin2 = _wp$media$view$settin.defaultProps) === null || _wp$media$view$settin2 === void 0 ? void 0 : _wp$media$view$settin2.link) || constants_LINK_DESTINATION_NONE) {
  18159. case 'file':
  18160. case constants_LINK_DESTINATION_MEDIA:
  18161. linkDestination = constants_LINK_DESTINATION_MEDIA;
  18162. break;
  18163. case 'post':
  18164. case constants_LINK_DESTINATION_ATTACHMENT:
  18165. linkDestination = constants_LINK_DESTINATION_ATTACHMENT;
  18166. break;
  18167. case LINK_DESTINATION_CUSTOM:
  18168. linkDestination = LINK_DESTINATION_CUSTOM;
  18169. break;
  18170. case constants_LINK_DESTINATION_NONE:
  18171. linkDestination = constants_LINK_DESTINATION_NONE;
  18172. break;
  18173. }
  18174. } // Check if the image is linked to it's media.
  18175. let href;
  18176. switch (linkDestination) {
  18177. case constants_LINK_DESTINATION_MEDIA:
  18178. href = media.url;
  18179. break;
  18180. case constants_LINK_DESTINATION_ATTACHMENT:
  18181. href = media.link;
  18182. break;
  18183. }
  18184. mediaAttributes.href = href;
  18185. setAttributes({ ...mediaAttributes,
  18186. ...additionalAttributes,
  18187. linkDestination
  18188. });
  18189. }
  18190. function onSelectURL(newURL) {
  18191. if (newURL !== url) {
  18192. setAttributes({
  18193. url: newURL,
  18194. id: undefined,
  18195. width: undefined,
  18196. height: undefined,
  18197. sizeSlug: imageDefaultSize
  18198. });
  18199. }
  18200. }
  18201. function updateAlignment(nextAlign) {
  18202. const extraUpdatedAttributes = ['wide', 'full'].includes(nextAlign) ? {
  18203. width: undefined,
  18204. height: undefined
  18205. } : {};
  18206. setAttributes({ ...extraUpdatedAttributes,
  18207. align: nextAlign
  18208. });
  18209. }
  18210. let isTemp = edit_isTemporaryImage(id, url); // Upload a temporary image on mount.
  18211. (0,external_wp_element_namespaceObject.useEffect)(() => {
  18212. if (!isTemp) {
  18213. return;
  18214. }
  18215. const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(url);
  18216. if (file) {
  18217. mediaUpload({
  18218. filesList: [file],
  18219. onFileChange: _ref2 => {
  18220. let [img] = _ref2;
  18221. onSelectImage(img);
  18222. },
  18223. allowedTypes: constants_ALLOWED_MEDIA_TYPES,
  18224. onError: message => {
  18225. isTemp = false;
  18226. onUploadError(message);
  18227. }
  18228. });
  18229. }
  18230. }, []); // If an image is temporary, revoke the Blob url when it is uploaded (and is
  18231. // no longer temporary).
  18232. (0,external_wp_element_namespaceObject.useEffect)(() => {
  18233. if (isTemp) {
  18234. setTemporaryURL(url);
  18235. return;
  18236. }
  18237. (0,external_wp_blob_namespaceObject.revokeBlobURL)(temporaryURL);
  18238. }, [isTemp, url]);
  18239. const isExternal = isExternalImage(id, url);
  18240. const src = isExternal ? url : undefined;
  18241. const mediaPreview = !!url && (0,external_wp_element_namespaceObject.createElement)("img", {
  18242. alt: (0,external_wp_i18n_namespaceObject.__)('Edit image'),
  18243. title: (0,external_wp_i18n_namespaceObject.__)('Edit image'),
  18244. className: 'edit-image-preview',
  18245. src: url
  18246. });
  18247. const classes = classnames_default()(className, {
  18248. 'is-transient': temporaryURL,
  18249. 'is-resized': !!width || !!height,
  18250. [`size-${sizeSlug}`]: sizeSlug
  18251. });
  18252. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  18253. ref,
  18254. className: classes
  18255. });
  18256. return (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, (temporaryURL || url) && (0,external_wp_element_namespaceObject.createElement)(Image, {
  18257. temporaryURL: temporaryURL,
  18258. attributes: attributes,
  18259. setAttributes: setAttributes,
  18260. isSelected: isSelected,
  18261. insertBlocksAfter: insertBlocksAfter,
  18262. onReplace: onReplace,
  18263. onSelectImage: onSelectImage,
  18264. onSelectURL: onSelectURL,
  18265. onUploadError: onUploadError,
  18266. containerRef: ref,
  18267. context: context,
  18268. clientId: clientId
  18269. }), !url && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  18270. group: "block"
  18271. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentControl, {
  18272. value: align,
  18273. onChange: updateAlignment
  18274. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  18275. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  18276. icon: library_image
  18277. }),
  18278. onSelect: onSelectImage,
  18279. onSelectURL: onSelectURL,
  18280. notices: noticeUI,
  18281. onError: onUploadError,
  18282. accept: "image/*",
  18283. allowedTypes: constants_ALLOWED_MEDIA_TYPES,
  18284. value: {
  18285. id,
  18286. src
  18287. },
  18288. mediaPreview: mediaPreview,
  18289. disableMediaButtons: temporaryURL || url
  18290. }));
  18291. }
  18292. /* harmony default export */ var image_edit = ((0,external_wp_components_namespaceObject.withNotices)(ImageEdit));
  18293. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/save.js
  18294. /**
  18295. * External dependencies
  18296. */
  18297. /**
  18298. * WordPress dependencies
  18299. */
  18300. function image_save_save(_ref) {
  18301. let {
  18302. attributes
  18303. } = _ref;
  18304. const {
  18305. url,
  18306. alt,
  18307. caption,
  18308. align,
  18309. href,
  18310. rel,
  18311. linkClass,
  18312. width,
  18313. height,
  18314. id,
  18315. linkTarget,
  18316. sizeSlug,
  18317. title
  18318. } = attributes;
  18319. const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
  18320. const classes = classnames_default()({
  18321. [`align${align}`]: align,
  18322. [`size-${sizeSlug}`]: sizeSlug,
  18323. 'is-resized': width || height
  18324. });
  18325. const image = (0,external_wp_element_namespaceObject.createElement)("img", {
  18326. src: url,
  18327. alt: alt,
  18328. className: id ? `wp-image-${id}` : null,
  18329. width: width,
  18330. height: height,
  18331. title: title
  18332. });
  18333. const figure = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  18334. className: linkClass,
  18335. href: href,
  18336. target: linkTarget,
  18337. rel: newRel
  18338. }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  18339. tagName: "figcaption",
  18340. value: caption
  18341. }));
  18342. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  18343. className: classes
  18344. }), figure);
  18345. }
  18346. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/transforms.js
  18347. /**
  18348. * External dependencies
  18349. */
  18350. /**
  18351. * WordPress dependencies
  18352. */
  18353. function stripFirstImage(attributes, _ref) {
  18354. let {
  18355. shortcode
  18356. } = _ref;
  18357. const {
  18358. body
  18359. } = document.implementation.createHTMLDocument('');
  18360. body.innerHTML = shortcode.content;
  18361. let nodeToRemove = body.querySelector('img'); // If an image has parents, find the topmost node to remove.
  18362. while (nodeToRemove && nodeToRemove.parentNode && nodeToRemove.parentNode !== body) {
  18363. nodeToRemove = nodeToRemove.parentNode;
  18364. }
  18365. if (nodeToRemove) {
  18366. nodeToRemove.parentNode.removeChild(nodeToRemove);
  18367. }
  18368. return body.innerHTML.trim();
  18369. }
  18370. function getFirstAnchorAttributeFormHTML(html, attributeName) {
  18371. const {
  18372. body
  18373. } = document.implementation.createHTMLDocument('');
  18374. body.innerHTML = html;
  18375. const {
  18376. firstElementChild
  18377. } = body;
  18378. if (firstElementChild && firstElementChild.nodeName === 'A') {
  18379. return firstElementChild.getAttribute(attributeName) || undefined;
  18380. }
  18381. }
  18382. const imageSchema = {
  18383. img: {
  18384. attributes: ['src', 'alt', 'title'],
  18385. classes: ['alignleft', 'aligncenter', 'alignright', 'alignnone', /^wp-image-\d+$/]
  18386. }
  18387. };
  18388. const schema = _ref2 => {
  18389. let {
  18390. phrasingContentSchema
  18391. } = _ref2;
  18392. return {
  18393. figure: {
  18394. require: ['img'],
  18395. children: { ...imageSchema,
  18396. a: {
  18397. attributes: ['href', 'rel', 'target'],
  18398. children: imageSchema
  18399. },
  18400. figcaption: {
  18401. children: phrasingContentSchema
  18402. }
  18403. }
  18404. }
  18405. };
  18406. };
  18407. const image_transforms_transforms = {
  18408. from: [{
  18409. type: 'raw',
  18410. isMatch: node => node.nodeName === 'FIGURE' && !!node.querySelector('img'),
  18411. schema,
  18412. transform: node => {
  18413. // Search both figure and image classes. Alignment could be
  18414. // set on either. ID is set on the image.
  18415. const className = node.className + ' ' + node.querySelector('img').className;
  18416. const alignMatches = /(?:^|\s)align(left|center|right)(?:$|\s)/.exec(className);
  18417. const anchor = node.id === '' ? undefined : node.id;
  18418. const align = alignMatches ? alignMatches[1] : undefined;
  18419. const idMatches = /(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(className);
  18420. const id = idMatches ? Number(idMatches[1]) : undefined;
  18421. const anchorElement = node.querySelector('a');
  18422. const linkDestination = anchorElement && anchorElement.href ? 'custom' : undefined;
  18423. const href = anchorElement && anchorElement.href ? anchorElement.href : undefined;
  18424. const rel = anchorElement && anchorElement.rel ? anchorElement.rel : undefined;
  18425. const linkClass = anchorElement && anchorElement.className ? anchorElement.className : undefined;
  18426. const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)('core/image', node.outerHTML, {
  18427. align,
  18428. id,
  18429. linkDestination,
  18430. href,
  18431. rel,
  18432. linkClass,
  18433. anchor
  18434. });
  18435. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', attributes);
  18436. }
  18437. }, {
  18438. // Note: when dragging and dropping multiple files onto a gallery this overrides the
  18439. // gallery transform in order to add new images to the gallery instead of
  18440. // creating a new gallery.
  18441. type: 'files',
  18442. isMatch(files) {
  18443. // The following check is intended to catch non-image files when dropped together with images.
  18444. if (files.some(file => file.type.indexOf('image/') === 0) && files.some(file => file.type.indexOf('image/') !== 0)) {
  18445. const {
  18446. createErrorNotice
  18447. } = (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store);
  18448. createErrorNotice((0,external_wp_i18n_namespaceObject.__)('If uploading to a gallery all files need to be image formats'), {
  18449. id: 'gallery-transform-invalid-file'
  18450. });
  18451. }
  18452. return (0,external_lodash_namespaceObject.every)(files, file => file.type.indexOf('image/') === 0);
  18453. },
  18454. transform(files) {
  18455. const blocks = files.map(file => {
  18456. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  18457. url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  18458. });
  18459. });
  18460. return blocks;
  18461. }
  18462. }, {
  18463. type: 'shortcode',
  18464. tag: 'caption',
  18465. attributes: {
  18466. url: {
  18467. type: 'string',
  18468. source: 'attribute',
  18469. attribute: 'src',
  18470. selector: 'img'
  18471. },
  18472. alt: {
  18473. type: 'string',
  18474. source: 'attribute',
  18475. attribute: 'alt',
  18476. selector: 'img'
  18477. },
  18478. caption: {
  18479. shortcode: stripFirstImage
  18480. },
  18481. href: {
  18482. shortcode: (attributes, _ref3) => {
  18483. let {
  18484. shortcode
  18485. } = _ref3;
  18486. return getFirstAnchorAttributeFormHTML(shortcode.content, 'href');
  18487. }
  18488. },
  18489. rel: {
  18490. shortcode: (attributes, _ref4) => {
  18491. let {
  18492. shortcode
  18493. } = _ref4;
  18494. return getFirstAnchorAttributeFormHTML(shortcode.content, 'rel');
  18495. }
  18496. },
  18497. linkClass: {
  18498. shortcode: (attributes, _ref5) => {
  18499. let {
  18500. shortcode
  18501. } = _ref5;
  18502. return getFirstAnchorAttributeFormHTML(shortcode.content, 'class');
  18503. }
  18504. },
  18505. id: {
  18506. type: 'number',
  18507. shortcode: _ref6 => {
  18508. let {
  18509. named: {
  18510. id
  18511. }
  18512. } = _ref6;
  18513. if (!id) {
  18514. return;
  18515. }
  18516. return parseInt(id.replace('attachment_', ''), 10);
  18517. }
  18518. },
  18519. align: {
  18520. type: 'string',
  18521. shortcode: _ref7 => {
  18522. let {
  18523. named: {
  18524. align = 'alignnone'
  18525. }
  18526. } = _ref7;
  18527. return align.replace('align', '');
  18528. }
  18529. }
  18530. }
  18531. }]
  18532. };
  18533. /* harmony default export */ var image_transforms = (image_transforms_transforms);
  18534. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/index.js
  18535. /**
  18536. * WordPress dependencies
  18537. */
  18538. /**
  18539. * Internal dependencies
  18540. */
  18541. const image_metadata = {
  18542. $schema: "https://schemas.wp.org/trunk/block.json",
  18543. apiVersion: 2,
  18544. name: "core/image",
  18545. title: "Image",
  18546. category: "media",
  18547. usesContext: ["allowResize", "imageCrop", "fixedHeight"],
  18548. description: "Insert an image to make a visual statement.",
  18549. keywords: ["img", "photo", "picture"],
  18550. textdomain: "default",
  18551. attributes: {
  18552. align: {
  18553. type: "string"
  18554. },
  18555. url: {
  18556. type: "string",
  18557. source: "attribute",
  18558. selector: "img",
  18559. attribute: "src"
  18560. },
  18561. alt: {
  18562. type: "string",
  18563. source: "attribute",
  18564. selector: "img",
  18565. attribute: "alt",
  18566. "default": ""
  18567. },
  18568. caption: {
  18569. type: "string",
  18570. source: "html",
  18571. selector: "figcaption"
  18572. },
  18573. title: {
  18574. type: "string",
  18575. source: "attribute",
  18576. selector: "img",
  18577. attribute: "title"
  18578. },
  18579. href: {
  18580. type: "string",
  18581. source: "attribute",
  18582. selector: "figure > a",
  18583. attribute: "href"
  18584. },
  18585. rel: {
  18586. type: "string",
  18587. source: "attribute",
  18588. selector: "figure > a",
  18589. attribute: "rel"
  18590. },
  18591. linkClass: {
  18592. type: "string",
  18593. source: "attribute",
  18594. selector: "figure > a",
  18595. attribute: "class"
  18596. },
  18597. id: {
  18598. type: "number"
  18599. },
  18600. width: {
  18601. type: "number"
  18602. },
  18603. height: {
  18604. type: "number"
  18605. },
  18606. sizeSlug: {
  18607. type: "string"
  18608. },
  18609. linkDestination: {
  18610. type: "string"
  18611. },
  18612. linkTarget: {
  18613. type: "string",
  18614. source: "attribute",
  18615. selector: "figure > a",
  18616. attribute: "target"
  18617. }
  18618. },
  18619. supports: {
  18620. anchor: true,
  18621. color: {
  18622. __experimentalDuotone: "img",
  18623. text: false,
  18624. background: false
  18625. },
  18626. __experimentalBorder: {
  18627. radius: true,
  18628. __experimentalDefaultControls: {
  18629. radius: true
  18630. }
  18631. }
  18632. },
  18633. styles: [{
  18634. name: "default",
  18635. label: "Default",
  18636. isDefault: true
  18637. }, {
  18638. name: "rounded",
  18639. label: "Rounded"
  18640. }],
  18641. editorStyle: "wp-block-image-editor",
  18642. style: "wp-block-image"
  18643. };
  18644. const {
  18645. name: image_name
  18646. } = image_metadata;
  18647. const image_settings = {
  18648. icon: library_image,
  18649. example: {
  18650. attributes: {
  18651. sizeSlug: 'large',
  18652. url: 'https://s.w.org/images/core/5.3/MtBlanc1.jpg',
  18653. // translators: Caption accompanying an image of the Mont Blanc, which serves as an example for the Image block.
  18654. caption: (0,external_wp_i18n_namespaceObject.__)('Mont Blanc appears—still, snowy, and serene.')
  18655. }
  18656. },
  18657. __experimentalLabel(attributes, _ref) {
  18658. let {
  18659. context
  18660. } = _ref;
  18661. if (context === 'accessibility') {
  18662. const {
  18663. caption,
  18664. alt,
  18665. url
  18666. } = attributes;
  18667. if (!url) {
  18668. return (0,external_wp_i18n_namespaceObject.__)('Empty');
  18669. }
  18670. if (!alt) {
  18671. return caption || '';
  18672. } // This is intended to be read by a screen reader.
  18673. // A period simply means a pause, no need to translate it.
  18674. return alt + (caption ? '. ' + caption : '');
  18675. }
  18676. },
  18677. getEditWrapperProps(attributes) {
  18678. return {
  18679. 'data-align': attributes.align
  18680. };
  18681. },
  18682. transforms: image_transforms,
  18683. edit: image_edit,
  18684. save: image_save_save,
  18685. deprecated: image_deprecated
  18686. };
  18687. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment.js
  18688. /**
  18689. * WordPress dependencies
  18690. */
  18691. const comment = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  18692. viewBox: "0 0 24 24",
  18693. xmlns: "http://www.w3.org/2000/svg"
  18694. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  18695. d: "M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"
  18696. }));
  18697. /* harmony default export */ var library_comment = (comment);
  18698. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-comments/edit.js
  18699. /**
  18700. * WordPress dependencies
  18701. */
  18702. /**
  18703. * Minimum number of comments a user can show using this block.
  18704. *
  18705. * @type {number}
  18706. */
  18707. const MIN_COMMENTS = 1;
  18708. /**
  18709. * Maximum number of comments a user can show using this block.
  18710. *
  18711. * @type {number}
  18712. */
  18713. const MAX_COMMENTS = 100;
  18714. function LatestComments(_ref) {
  18715. let {
  18716. attributes,
  18717. setAttributes
  18718. } = _ref;
  18719. const {
  18720. commentsToShow,
  18721. displayAvatar,
  18722. displayDate,
  18723. displayExcerpt
  18724. } = attributes;
  18725. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  18726. title: (0,external_wp_i18n_namespaceObject.__)('Latest comments settings')
  18727. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  18728. label: (0,external_wp_i18n_namespaceObject.__)('Display avatar'),
  18729. checked: displayAvatar,
  18730. onChange: () => setAttributes({
  18731. displayAvatar: !displayAvatar
  18732. })
  18733. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  18734. label: (0,external_wp_i18n_namespaceObject.__)('Display date'),
  18735. checked: displayDate,
  18736. onChange: () => setAttributes({
  18737. displayDate: !displayDate
  18738. })
  18739. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  18740. label: (0,external_wp_i18n_namespaceObject.__)('Display excerpt'),
  18741. checked: displayExcerpt,
  18742. onChange: () => setAttributes({
  18743. displayExcerpt: !displayExcerpt
  18744. })
  18745. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  18746. label: (0,external_wp_i18n_namespaceObject.__)('Number of comments'),
  18747. value: commentsToShow,
  18748. onChange: value => setAttributes({
  18749. commentsToShow: value
  18750. }),
  18751. min: MIN_COMMENTS,
  18752. max: MAX_COMMENTS,
  18753. required: true
  18754. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
  18755. block: "core/latest-comments",
  18756. attributes: attributes // The preview uses the site's locale to make it more true to how
  18757. // the block appears on the frontend. Setting the locale
  18758. // explicitly prevents any middleware from setting it to 'user'.
  18759. ,
  18760. urlQueryArgs: {
  18761. _locale: 'site'
  18762. }
  18763. })));
  18764. }
  18765. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js
  18766. /**
  18767. * WordPress dependencies
  18768. */
  18769. /**
  18770. * Internal dependencies
  18771. */
  18772. const latest_comments_metadata = {
  18773. $schema: "https://schemas.wp.org/trunk/block.json",
  18774. apiVersion: 2,
  18775. name: "core/latest-comments",
  18776. title: "Latest Comments",
  18777. category: "widgets",
  18778. description: "Display a list of your most recent comments.",
  18779. keywords: ["recent comments"],
  18780. textdomain: "default",
  18781. attributes: {
  18782. commentsToShow: {
  18783. type: "number",
  18784. "default": 5,
  18785. minimum: 1,
  18786. maximum: 100
  18787. },
  18788. displayAvatar: {
  18789. type: "boolean",
  18790. "default": true
  18791. },
  18792. displayDate: {
  18793. type: "boolean",
  18794. "default": true
  18795. },
  18796. displayExcerpt: {
  18797. type: "boolean",
  18798. "default": true
  18799. }
  18800. },
  18801. supports: {
  18802. align: true,
  18803. html: false
  18804. },
  18805. editorStyle: "wp-block-latest-comments-editor",
  18806. style: "wp-block-latest-comments"
  18807. };
  18808. const {
  18809. name: latest_comments_name
  18810. } = latest_comments_metadata;
  18811. const latest_comments_settings = {
  18812. icon: library_comment,
  18813. example: {},
  18814. edit: LatestComments
  18815. };
  18816. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-list.js
  18817. /**
  18818. * WordPress dependencies
  18819. */
  18820. const postList = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  18821. viewBox: "0 0 24 24",
  18822. xmlns: "http://www.w3.org/2000/svg"
  18823. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  18824. d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 11h2V9H7v2zm0 4h2v-2H7v2zm3-4h7V9h-7v2zm0 4h7v-2h-7v2z"
  18825. }));
  18826. /* harmony default export */ var post_list = (postList);
  18827. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/deprecated.js
  18828. /**
  18829. * Internal dependencies
  18830. */
  18831. const latest_posts_deprecated_metadata = {
  18832. $schema: "https://schemas.wp.org/trunk/block.json",
  18833. apiVersion: 2,
  18834. name: "core/latest-posts",
  18835. title: "Latest Posts",
  18836. category: "widgets",
  18837. description: "Display a list of your most recent posts.",
  18838. keywords: ["recent posts"],
  18839. textdomain: "default",
  18840. attributes: {
  18841. categories: {
  18842. type: "array",
  18843. items: {
  18844. type: "object"
  18845. }
  18846. },
  18847. selectedAuthor: {
  18848. type: "number"
  18849. },
  18850. postsToShow: {
  18851. type: "number",
  18852. "default": 5
  18853. },
  18854. displayPostContent: {
  18855. type: "boolean",
  18856. "default": false
  18857. },
  18858. displayPostContentRadio: {
  18859. type: "string",
  18860. "default": "excerpt"
  18861. },
  18862. excerptLength: {
  18863. type: "number",
  18864. "default": 55
  18865. },
  18866. displayAuthor: {
  18867. type: "boolean",
  18868. "default": false
  18869. },
  18870. displayPostDate: {
  18871. type: "boolean",
  18872. "default": false
  18873. },
  18874. postLayout: {
  18875. type: "string",
  18876. "default": "list"
  18877. },
  18878. columns: {
  18879. type: "number",
  18880. "default": 3
  18881. },
  18882. order: {
  18883. type: "string",
  18884. "default": "desc"
  18885. },
  18886. orderBy: {
  18887. type: "string",
  18888. "default": "date"
  18889. },
  18890. displayFeaturedImage: {
  18891. type: "boolean",
  18892. "default": false
  18893. },
  18894. featuredImageAlign: {
  18895. type: "string",
  18896. "enum": ["left", "center", "right"]
  18897. },
  18898. featuredImageSizeSlug: {
  18899. type: "string",
  18900. "default": "thumbnail"
  18901. },
  18902. featuredImageSizeWidth: {
  18903. type: "number",
  18904. "default": null
  18905. },
  18906. featuredImageSizeHeight: {
  18907. type: "number",
  18908. "default": null
  18909. },
  18910. addLinkToFeaturedImage: {
  18911. type: "boolean",
  18912. "default": false
  18913. }
  18914. },
  18915. supports: {
  18916. align: true,
  18917. html: false
  18918. },
  18919. editorStyle: "wp-block-latest-posts-editor",
  18920. style: "wp-block-latest-posts"
  18921. };
  18922. const {
  18923. attributes: deprecated_attributes
  18924. } = latest_posts_deprecated_metadata;
  18925. /* harmony default export */ var latest_posts_deprecated = ([{
  18926. attributes: { ...deprecated_attributes,
  18927. categories: {
  18928. type: 'string'
  18929. }
  18930. },
  18931. supports: {
  18932. align: true,
  18933. html: false
  18934. },
  18935. migrate: oldAttributes => {
  18936. // This needs the full category object, not just the ID.
  18937. return { ...oldAttributes,
  18938. categories: [{
  18939. id: Number(oldAttributes.categories)
  18940. }]
  18941. };
  18942. },
  18943. isEligible: _ref => {
  18944. let {
  18945. categories
  18946. } = _ref;
  18947. return categories && 'string' === typeof categories;
  18948. },
  18949. save: () => null
  18950. }]);
  18951. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list.js
  18952. /**
  18953. * WordPress dependencies
  18954. */
  18955. const list = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  18956. viewBox: "0 0 24 24",
  18957. xmlns: "http://www.w3.org/2000/svg"
  18958. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  18959. d: "M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"
  18960. }));
  18961. /* harmony default export */ var library_list = (list);
  18962. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/grid.js
  18963. /**
  18964. * WordPress dependencies
  18965. */
  18966. const grid = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  18967. xmlns: "http://www.w3.org/2000/svg",
  18968. viewBox: "0 0 24 24"
  18969. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  18970. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",
  18971. fillRule: "evenodd",
  18972. clipRule: "evenodd"
  18973. }));
  18974. /* harmony default export */ var library_grid = (grid);
  18975. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/constants.js
  18976. const MIN_EXCERPT_LENGTH = 10;
  18977. const MAX_EXCERPT_LENGTH = 100;
  18978. const MAX_POSTS_COLUMNS = 6;
  18979. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/edit.js
  18980. /**
  18981. * External dependencies
  18982. */
  18983. /**
  18984. * WordPress dependencies
  18985. */
  18986. /**
  18987. * Internal dependencies
  18988. */
  18989. /**
  18990. * Module Constants
  18991. */
  18992. const CATEGORIES_LIST_QUERY = {
  18993. per_page: -1,
  18994. context: 'view'
  18995. };
  18996. const USERS_LIST_QUERY = {
  18997. per_page: -1,
  18998. has_published_posts: ['post'],
  18999. context: 'view'
  19000. };
  19001. function getFeaturedImageDetails(post, size) {
  19002. var _image$media_details$, _image$media_details, _image$media_details$2, _image$media_details$3;
  19003. const image = (0,external_lodash_namespaceObject.get)(post, ['_embedded', 'wp:featuredmedia', '0']);
  19004. return {
  19005. url: (_image$media_details$ = image === null || image === void 0 ? void 0 : (_image$media_details = image.media_details) === null || _image$media_details === void 0 ? void 0 : (_image$media_details$2 = _image$media_details.sizes) === null || _image$media_details$2 === void 0 ? void 0 : (_image$media_details$3 = _image$media_details$2[size]) === null || _image$media_details$3 === void 0 ? void 0 : _image$media_details$3.source_url) !== null && _image$media_details$ !== void 0 ? _image$media_details$ : image === null || image === void 0 ? void 0 : image.source_url,
  19006. alt: image === null || image === void 0 ? void 0 : image.alt_text
  19007. };
  19008. }
  19009. function LatestPostsEdit(_ref) {
  19010. var _categoriesList$reduc;
  19011. let {
  19012. attributes,
  19013. setAttributes
  19014. } = _ref;
  19015. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(LatestPostsEdit);
  19016. const {
  19017. postsToShow,
  19018. order,
  19019. orderBy,
  19020. categories,
  19021. selectedAuthor,
  19022. displayFeaturedImage,
  19023. displayPostContentRadio,
  19024. displayPostContent,
  19025. displayPostDate,
  19026. displayAuthor,
  19027. postLayout,
  19028. columns,
  19029. excerptLength,
  19030. featuredImageAlign,
  19031. featuredImageSizeSlug,
  19032. featuredImageSizeWidth,
  19033. featuredImageSizeHeight,
  19034. addLinkToFeaturedImage
  19035. } = attributes;
  19036. const {
  19037. imageSizes,
  19038. latestPosts,
  19039. defaultImageWidth,
  19040. defaultImageHeight,
  19041. categoriesList,
  19042. authorList
  19043. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  19044. const {
  19045. getEntityRecords,
  19046. getUsers
  19047. } = select(external_wp_coreData_namespaceObject.store);
  19048. const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
  19049. const catIds = categories && categories.length > 0 ? categories.map(cat => cat.id) : [];
  19050. const latestPostsQuery = (0,external_lodash_namespaceObject.pickBy)({
  19051. categories: catIds,
  19052. author: selectedAuthor,
  19053. order,
  19054. orderby: orderBy,
  19055. per_page: postsToShow,
  19056. _embed: 'wp:featuredmedia'
  19057. }, value => !(0,external_lodash_namespaceObject.isUndefined)(value));
  19058. return {
  19059. defaultImageWidth: (0,external_lodash_namespaceObject.get)(settings.imageDimensions, [featuredImageSizeSlug, 'width'], 0),
  19060. defaultImageHeight: (0,external_lodash_namespaceObject.get)(settings.imageDimensions, [featuredImageSizeSlug, 'height'], 0),
  19061. imageSizes: settings.imageSizes,
  19062. latestPosts: getEntityRecords('postType', 'post', latestPostsQuery),
  19063. categoriesList: getEntityRecords('taxonomy', 'category', CATEGORIES_LIST_QUERY),
  19064. authorList: getUsers(USERS_LIST_QUERY)
  19065. };
  19066. }, [featuredImageSizeSlug, postsToShow, order, orderBy, categories, selectedAuthor]); // If a user clicks to a link prevent redirection and show a warning.
  19067. const {
  19068. createWarningNotice,
  19069. removeNotice
  19070. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  19071. let noticeId;
  19072. const showRedirectionPreventedNotice = event => {
  19073. event.preventDefault(); // Remove previous warning if any, to show one at a time per block.
  19074. removeNotice(noticeId);
  19075. noticeId = `block-library/core/latest-posts/redirection-prevented/${instanceId}`;
  19076. createWarningNotice((0,external_wp_i18n_namespaceObject.__)('Links are disabled in the editor.'), {
  19077. id: noticeId,
  19078. type: 'snackbar'
  19079. });
  19080. };
  19081. const imageSizeOptions = imageSizes.filter(_ref2 => {
  19082. let {
  19083. slug
  19084. } = _ref2;
  19085. return slug !== 'full';
  19086. }).map(_ref3 => {
  19087. let {
  19088. name,
  19089. slug
  19090. } = _ref3;
  19091. return {
  19092. value: slug,
  19093. label: name
  19094. };
  19095. });
  19096. const categorySuggestions = (_categoriesList$reduc = categoriesList === null || categoriesList === void 0 ? void 0 : categoriesList.reduce((accumulator, category) => ({ ...accumulator,
  19097. [category.name]: category
  19098. }), {})) !== null && _categoriesList$reduc !== void 0 ? _categoriesList$reduc : {};
  19099. const selectCategories = tokens => {
  19100. const hasNoSuggestion = tokens.some(token => typeof token === 'string' && !categorySuggestions[token]);
  19101. if (hasNoSuggestion) {
  19102. return;
  19103. } // Categories that are already will be objects, while new additions will be strings (the name).
  19104. // allCategories nomalizes the array so that they are all objects.
  19105. const allCategories = tokens.map(token => {
  19106. return typeof token === 'string' ? categorySuggestions[token] : token;
  19107. }); // We do nothing if the category is not selected
  19108. // from suggestions.
  19109. if ((0,external_lodash_namespaceObject.includes)(allCategories, null)) {
  19110. return false;
  19111. }
  19112. setAttributes({
  19113. categories: allCategories
  19114. });
  19115. };
  19116. const hasPosts = !!(latestPosts !== null && latestPosts !== void 0 && latestPosts.length);
  19117. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  19118. title: (0,external_wp_i18n_namespaceObject.__)('Post content settings')
  19119. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  19120. label: (0,external_wp_i18n_namespaceObject.__)('Post content'),
  19121. checked: displayPostContent,
  19122. onChange: value => setAttributes({
  19123. displayPostContent: value
  19124. })
  19125. }), displayPostContent && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RadioControl, {
  19126. label: (0,external_wp_i18n_namespaceObject.__)('Show:'),
  19127. selected: displayPostContentRadio,
  19128. options: [{
  19129. label: (0,external_wp_i18n_namespaceObject.__)('Excerpt'),
  19130. value: 'excerpt'
  19131. }, {
  19132. label: (0,external_wp_i18n_namespaceObject.__)('Full post'),
  19133. value: 'full_post'
  19134. }],
  19135. onChange: value => setAttributes({
  19136. displayPostContentRadio: value
  19137. })
  19138. }), displayPostContent && displayPostContentRadio === 'excerpt' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  19139. label: (0,external_wp_i18n_namespaceObject.__)('Max number of words in excerpt'),
  19140. value: excerptLength,
  19141. onChange: value => setAttributes({
  19142. excerptLength: value
  19143. }),
  19144. min: MIN_EXCERPT_LENGTH,
  19145. max: MAX_EXCERPT_LENGTH
  19146. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  19147. title: (0,external_wp_i18n_namespaceObject.__)('Post meta settings')
  19148. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  19149. label: (0,external_wp_i18n_namespaceObject.__)('Display author name'),
  19150. checked: displayAuthor,
  19151. onChange: value => setAttributes({
  19152. displayAuthor: value
  19153. })
  19154. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  19155. label: (0,external_wp_i18n_namespaceObject.__)('Display post date'),
  19156. checked: displayPostDate,
  19157. onChange: value => setAttributes({
  19158. displayPostDate: value
  19159. })
  19160. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  19161. title: (0,external_wp_i18n_namespaceObject.__)('Featured image settings')
  19162. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  19163. label: (0,external_wp_i18n_namespaceObject.__)('Display featured image'),
  19164. checked: displayFeaturedImage,
  19165. onChange: value => setAttributes({
  19166. displayFeaturedImage: value
  19167. })
  19168. }), displayFeaturedImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageSizeControl, {
  19169. onChange: value => {
  19170. const newAttrs = {};
  19171. if (value.hasOwnProperty('width')) {
  19172. newAttrs.featuredImageSizeWidth = value.width;
  19173. }
  19174. if (value.hasOwnProperty('height')) {
  19175. newAttrs.featuredImageSizeHeight = value.height;
  19176. }
  19177. setAttributes(newAttrs);
  19178. },
  19179. slug: featuredImageSizeSlug,
  19180. width: featuredImageSizeWidth,
  19181. height: featuredImageSizeHeight,
  19182. imageWidth: defaultImageWidth,
  19183. imageHeight: defaultImageHeight,
  19184. imageSizeOptions: imageSizeOptions,
  19185. onChangeImage: value => setAttributes({
  19186. featuredImageSizeSlug: value,
  19187. featuredImageSizeWidth: undefined,
  19188. featuredImageSizeHeight: undefined
  19189. })
  19190. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  19191. className: "editor-latest-posts-image-alignment-control"
  19192. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_wp_i18n_namespaceObject.__)('Image alignment')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentToolbar, {
  19193. value: featuredImageAlign,
  19194. onChange: value => setAttributes({
  19195. featuredImageAlign: value
  19196. }),
  19197. controls: ['left', 'center', 'right'],
  19198. isCollapsed: false
  19199. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  19200. label: (0,external_wp_i18n_namespaceObject.__)('Add link to featured image'),
  19201. checked: addLinkToFeaturedImage,
  19202. onChange: value => setAttributes({
  19203. addLinkToFeaturedImage: value
  19204. })
  19205. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  19206. title: (0,external_wp_i18n_namespaceObject.__)('Sorting and filtering')
  19207. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.QueryControls, {
  19208. order,
  19209. orderBy,
  19210. numberOfItems: postsToShow,
  19211. onOrderChange: value => setAttributes({
  19212. order: value
  19213. }),
  19214. onOrderByChange: value => setAttributes({
  19215. orderBy: value
  19216. }),
  19217. onNumberOfItemsChange: value => setAttributes({
  19218. postsToShow: value
  19219. }),
  19220. categorySuggestions: categorySuggestions,
  19221. onCategoryChange: selectCategories,
  19222. selectedCategories: categories,
  19223. onAuthorChange: value => setAttributes({
  19224. selectedAuthor: '' !== value ? Number(value) : undefined
  19225. }),
  19226. authorList: authorList !== null && authorList !== void 0 ? authorList : [],
  19227. selectedAuthorId: selectedAuthor
  19228. }), postLayout === 'grid' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  19229. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  19230. value: columns,
  19231. onChange: value => setAttributes({
  19232. columns: value
  19233. }),
  19234. min: 2,
  19235. max: !hasPosts ? MAX_POSTS_COLUMNS : Math.min(MAX_POSTS_COLUMNS, latestPosts.length),
  19236. required: true
  19237. })));
  19238. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  19239. className: classnames_default()({
  19240. 'wp-block-latest-posts__list': true,
  19241. 'is-grid': postLayout === 'grid',
  19242. 'has-dates': displayPostDate,
  19243. 'has-author': displayAuthor,
  19244. [`columns-${columns}`]: postLayout === 'grid'
  19245. })
  19246. });
  19247. if (!hasPosts) {
  19248. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, inspectorControls, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  19249. icon: library_pin,
  19250. label: (0,external_wp_i18n_namespaceObject.__)('Latest Posts')
  19251. }, !Array.isArray(latestPosts) ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null) : (0,external_wp_i18n_namespaceObject.__)('No posts found.')));
  19252. } // Removing posts from display should be instant.
  19253. const displayPosts = latestPosts.length > postsToShow ? latestPosts.slice(0, postsToShow) : latestPosts;
  19254. const layoutControls = [{
  19255. icon: library_list,
  19256. title: (0,external_wp_i18n_namespaceObject.__)('List view'),
  19257. onClick: () => setAttributes({
  19258. postLayout: 'list'
  19259. }),
  19260. isActive: postLayout === 'list'
  19261. }, {
  19262. icon: library_grid,
  19263. title: (0,external_wp_i18n_namespaceObject.__)('Grid view'),
  19264. onClick: () => setAttributes({
  19265. postLayout: 'grid'
  19266. }),
  19267. isActive: postLayout === 'grid'
  19268. }];
  19269. const dateFormat = (0,external_wp_date_namespaceObject.__experimentalGetSettings)().formats.date;
  19270. return (0,external_wp_element_namespaceObject.createElement)("div", null, inspectorControls, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
  19271. controls: layoutControls
  19272. })), (0,external_wp_element_namespaceObject.createElement)("ul", blockProps, displayPosts.map((post, i) => {
  19273. const titleTrimmed = (0,external_lodash_namespaceObject.invoke)(post, ['title', 'rendered', 'trim']);
  19274. let excerpt = post.excerpt.rendered;
  19275. const currentAuthor = authorList === null || authorList === void 0 ? void 0 : authorList.find(author => author.id === post.author);
  19276. const excerptElement = document.createElement('div');
  19277. excerptElement.innerHTML = excerpt;
  19278. excerpt = excerptElement.textContent || excerptElement.innerText || '';
  19279. const {
  19280. url: imageSourceUrl,
  19281. alt: featuredImageAlt
  19282. } = getFeaturedImageDetails(post, featuredImageSizeSlug);
  19283. const imageClasses = classnames_default()({
  19284. 'wp-block-latest-posts__featured-image': true,
  19285. [`align${featuredImageAlign}`]: !!featuredImageAlign
  19286. });
  19287. const renderFeaturedImage = displayFeaturedImage && imageSourceUrl;
  19288. const featuredImage = renderFeaturedImage && (0,external_wp_element_namespaceObject.createElement)("img", {
  19289. src: imageSourceUrl,
  19290. alt: featuredImageAlt,
  19291. style: {
  19292. maxWidth: featuredImageSizeWidth,
  19293. maxHeight: featuredImageSizeHeight
  19294. }
  19295. });
  19296. const needsReadMore = excerptLength < excerpt.trim().split(' ').length && post.excerpt.raw === '';
  19297. const postExcerpt = needsReadMore ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, excerpt.trim().split(' ', excerptLength).join(' '), (0,external_wp_i18n_namespaceObject.__)(' … '), (0,external_wp_element_namespaceObject.createElement)("a", {
  19298. href: post.link,
  19299. rel: "noopener noreferrer",
  19300. onClick: showRedirectionPreventedNotice
  19301. }, (0,external_wp_i18n_namespaceObject.__)('Read more'))) : excerpt;
  19302. return (0,external_wp_element_namespaceObject.createElement)("li", {
  19303. key: i
  19304. }, renderFeaturedImage && (0,external_wp_element_namespaceObject.createElement)("div", {
  19305. className: imageClasses
  19306. }, addLinkToFeaturedImage ? (0,external_wp_element_namespaceObject.createElement)("a", {
  19307. className: "wp-block-latest-posts__post-title",
  19308. href: post.link,
  19309. rel: "noreferrer noopener",
  19310. onClick: showRedirectionPreventedNotice
  19311. }, featuredImage) : featuredImage), (0,external_wp_element_namespaceObject.createElement)("a", {
  19312. href: post.link,
  19313. rel: "noreferrer noopener",
  19314. dangerouslySetInnerHTML: !!titleTrimmed ? {
  19315. __html: titleTrimmed
  19316. } : undefined,
  19317. onClick: showRedirectionPreventedNotice
  19318. }, !titleTrimmed ? (0,external_wp_i18n_namespaceObject.__)('(no title)') : null), displayAuthor && currentAuthor && (0,external_wp_element_namespaceObject.createElement)("div", {
  19319. className: "wp-block-latest-posts__post-author"
  19320. }, (0,external_wp_i18n_namespaceObject.sprintf)(
  19321. /* translators: byline. %s: current author. */
  19322. (0,external_wp_i18n_namespaceObject.__)('by %s'), currentAuthor.name)), displayPostDate && post.date_gmt && (0,external_wp_element_namespaceObject.createElement)("time", {
  19323. dateTime: (0,external_wp_date_namespaceObject.format)('c', post.date_gmt),
  19324. className: "wp-block-latest-posts__post-date"
  19325. }, (0,external_wp_date_namespaceObject.dateI18n)(dateFormat, post.date_gmt)), displayPostContent && displayPostContentRadio === 'excerpt' && (0,external_wp_element_namespaceObject.createElement)("div", {
  19326. className: "wp-block-latest-posts__post-excerpt"
  19327. }, postExcerpt), displayPostContent && displayPostContentRadio === 'full_post' && (0,external_wp_element_namespaceObject.createElement)("div", {
  19328. className: "wp-block-latest-posts__post-full-content",
  19329. dangerouslySetInnerHTML: {
  19330. __html: post.content.raw.trim()
  19331. }
  19332. }));
  19333. })));
  19334. }
  19335. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js
  19336. /**
  19337. * WordPress dependencies
  19338. */
  19339. /**
  19340. * Internal dependencies
  19341. */
  19342. const latest_posts_metadata = {
  19343. $schema: "https://schemas.wp.org/trunk/block.json",
  19344. apiVersion: 2,
  19345. name: "core/latest-posts",
  19346. title: "Latest Posts",
  19347. category: "widgets",
  19348. description: "Display a list of your most recent posts.",
  19349. keywords: ["recent posts"],
  19350. textdomain: "default",
  19351. attributes: {
  19352. categories: {
  19353. type: "array",
  19354. items: {
  19355. type: "object"
  19356. }
  19357. },
  19358. selectedAuthor: {
  19359. type: "number"
  19360. },
  19361. postsToShow: {
  19362. type: "number",
  19363. "default": 5
  19364. },
  19365. displayPostContent: {
  19366. type: "boolean",
  19367. "default": false
  19368. },
  19369. displayPostContentRadio: {
  19370. type: "string",
  19371. "default": "excerpt"
  19372. },
  19373. excerptLength: {
  19374. type: "number",
  19375. "default": 55
  19376. },
  19377. displayAuthor: {
  19378. type: "boolean",
  19379. "default": false
  19380. },
  19381. displayPostDate: {
  19382. type: "boolean",
  19383. "default": false
  19384. },
  19385. postLayout: {
  19386. type: "string",
  19387. "default": "list"
  19388. },
  19389. columns: {
  19390. type: "number",
  19391. "default": 3
  19392. },
  19393. order: {
  19394. type: "string",
  19395. "default": "desc"
  19396. },
  19397. orderBy: {
  19398. type: "string",
  19399. "default": "date"
  19400. },
  19401. displayFeaturedImage: {
  19402. type: "boolean",
  19403. "default": false
  19404. },
  19405. featuredImageAlign: {
  19406. type: "string",
  19407. "enum": ["left", "center", "right"]
  19408. },
  19409. featuredImageSizeSlug: {
  19410. type: "string",
  19411. "default": "thumbnail"
  19412. },
  19413. featuredImageSizeWidth: {
  19414. type: "number",
  19415. "default": null
  19416. },
  19417. featuredImageSizeHeight: {
  19418. type: "number",
  19419. "default": null
  19420. },
  19421. addLinkToFeaturedImage: {
  19422. type: "boolean",
  19423. "default": false
  19424. }
  19425. },
  19426. supports: {
  19427. align: true,
  19428. html: false
  19429. },
  19430. editorStyle: "wp-block-latest-posts-editor",
  19431. style: "wp-block-latest-posts"
  19432. };
  19433. const {
  19434. name: latest_posts_name
  19435. } = latest_posts_metadata;
  19436. const latest_posts_settings = {
  19437. icon: post_list,
  19438. example: {},
  19439. edit: LatestPostsEdit,
  19440. deprecated: latest_posts_deprecated
  19441. };
  19442. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/deprecated.js
  19443. /**
  19444. * WordPress dependencies
  19445. */
  19446. /**
  19447. * Internal dependencies
  19448. */
  19449. const v0 = {
  19450. attributes: {
  19451. ordered: {
  19452. type: 'boolean',
  19453. default: false,
  19454. __experimentalRole: 'content'
  19455. },
  19456. values: {
  19457. type: 'string',
  19458. source: 'html',
  19459. selector: 'ol,ul',
  19460. multiline: 'li',
  19461. __unstableMultilineWrapperTags: ['ol', 'ul'],
  19462. default: '',
  19463. __experimentalRole: 'content'
  19464. },
  19465. type: {
  19466. type: 'string'
  19467. },
  19468. start: {
  19469. type: 'number'
  19470. },
  19471. reversed: {
  19472. type: 'boolean'
  19473. },
  19474. placeholder: {
  19475. type: 'string'
  19476. }
  19477. },
  19478. supports: {
  19479. anchor: true,
  19480. className: false,
  19481. typography: {
  19482. fontSize: true,
  19483. __experimentalFontFamily: true
  19484. },
  19485. color: {
  19486. gradients: true,
  19487. link: true
  19488. },
  19489. __unstablePasteTextInline: true,
  19490. __experimentalSelector: 'ol,ul',
  19491. __experimentalSlashInserter: true
  19492. },
  19493. save(_ref) {
  19494. let {
  19495. attributes
  19496. } = _ref;
  19497. const {
  19498. ordered,
  19499. values,
  19500. type,
  19501. reversed,
  19502. start
  19503. } = attributes;
  19504. const TagName = ordered ? 'ol' : 'ul';
  19505. return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
  19506. type,
  19507. reversed,
  19508. start
  19509. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  19510. value: values,
  19511. multiline: "li"
  19512. }));
  19513. },
  19514. migrate: migrate_font_family,
  19515. isEligible(_ref2) {
  19516. var _style$typography;
  19517. let {
  19518. style
  19519. } = _ref2;
  19520. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  19521. }
  19522. };
  19523. /**
  19524. * New deprecations need to be placed first
  19525. * for them to have higher priority.
  19526. *
  19527. * Old deprecations may need to be updated as well.
  19528. *
  19529. * See block-deprecation.md
  19530. */
  19531. /* harmony default export */ var list_deprecated = ([v0]);
  19532. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.js
  19533. /**
  19534. * WordPress dependencies
  19535. */
  19536. const formatListBulletsRTL = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  19537. xmlns: "http://www.w3.org/2000/svg",
  19538. viewBox: "0 0 24 24"
  19539. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  19540. d: "M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"
  19541. }));
  19542. /* harmony default export */ var format_list_bullets_rtl = (formatListBulletsRTL);
  19543. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js
  19544. /**
  19545. * WordPress dependencies
  19546. */
  19547. const formatListBullets = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  19548. xmlns: "http://www.w3.org/2000/svg",
  19549. viewBox: "0 0 24 24"
  19550. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  19551. d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
  19552. }));
  19553. /* harmony default export */ var format_list_bullets = (formatListBullets);
  19554. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-numbered-rtl.js
  19555. /**
  19556. * WordPress dependencies
  19557. */
  19558. const formatListNumberedRTL = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  19559. xmlns: "http://www.w3.org/2000/svg",
  19560. viewBox: "0 0 24 24"
  19561. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  19562. d: "M3.8 15.8h8.9v-1.5H3.8v1.5zm0-7h8.9V7.2H3.8v1.6zm14.7-2.1V10h1V5.3l-2.2.7.3 1 .9-.3zm1.2 6.1c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5H20v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3 0-.8-.3-1.1z"
  19563. }));
  19564. /* harmony default export */ var format_list_numbered_rtl = (formatListNumberedRTL);
  19565. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-numbered.js
  19566. /**
  19567. * WordPress dependencies
  19568. */
  19569. const formatListNumbered = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  19570. xmlns: "http://www.w3.org/2000/svg",
  19571. viewBox: "0 0 24 24"
  19572. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  19573. d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z"
  19574. }));
  19575. /* harmony default export */ var format_list_numbered = (formatListNumbered);
  19576. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-outdent-rtl.js
  19577. /**
  19578. * WordPress dependencies
  19579. */
  19580. const formatOutdentRTL = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  19581. xmlns: "http://www.w3.org/2000/svg",
  19582. viewBox: "0 0 24 24"
  19583. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  19584. d: "M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM15.4697 14.9697L18.4393 12L15.4697 9.03033L16.5303 7.96967L20.0303 11.4697L20.5607 12L20.0303 12.5303L16.5303 16.0303L15.4697 14.9697Z"
  19585. }));
  19586. /* harmony default export */ var format_outdent_rtl = (formatOutdentRTL);
  19587. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-outdent.js
  19588. /**
  19589. * WordPress dependencies
  19590. */
  19591. const formatOutdent = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  19592. xmlns: "http://www.w3.org/2000/svg",
  19593. viewBox: "0 0 24 24"
  19594. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  19595. d: "M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z"
  19596. }));
  19597. /* harmony default export */ var format_outdent = (formatOutdent);
  19598. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-indent-rtl.js
  19599. /**
  19600. * WordPress dependencies
  19601. */
  19602. const formatIndentRTL = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  19603. xmlns: "http://www.w3.org/2000/svg",
  19604. viewBox: "0 0 24 24"
  19605. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  19606. d: "M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM20.0303 9.03033L17.0607 12L20.0303 14.9697L18.9697 16.0303L15.4697 12.5303L14.9393 12L15.4697 11.4697L18.9697 7.96967L20.0303 9.03033Z"
  19607. }));
  19608. /* harmony default export */ var format_indent_rtl = (formatIndentRTL);
  19609. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-indent.js
  19610. /**
  19611. * WordPress dependencies
  19612. */
  19613. const formatIndent = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  19614. xmlns: "http://www.w3.org/2000/svg",
  19615. viewBox: "0 0 24 24"
  19616. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  19617. d: "M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z"
  19618. }));
  19619. /* harmony default export */ var format_indent = (formatIndent);
  19620. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/ordered-list-settings.js
  19621. /**
  19622. * WordPress dependencies
  19623. */
  19624. const OrderedListSettings = _ref => {
  19625. let {
  19626. setAttributes,
  19627. reversed,
  19628. start
  19629. } = _ref;
  19630. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  19631. title: (0,external_wp_i18n_namespaceObject.__)('Ordered list settings')
  19632. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  19633. label: (0,external_wp_i18n_namespaceObject.__)('Start value'),
  19634. type: "number",
  19635. onChange: value => {
  19636. const int = parseInt(value, 10);
  19637. setAttributes({
  19638. // It should be possible to unset the value,
  19639. // e.g. with an empty string.
  19640. start: isNaN(int) ? undefined : int
  19641. });
  19642. },
  19643. value: Number.isInteger(start) ? start.toString(10) : '',
  19644. step: "1"
  19645. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  19646. label: (0,external_wp_i18n_namespaceObject.__)('Reverse list numbering'),
  19647. checked: reversed || false,
  19648. onChange: value => {
  19649. setAttributes({
  19650. // Unset the attribute if not reversed.
  19651. reversed: value || undefined
  19652. });
  19653. }
  19654. })));
  19655. };
  19656. /* harmony default export */ var ordered_list_settings = (OrderedListSettings);
  19657. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/edit.js
  19658. /**
  19659. * WordPress dependencies
  19660. */
  19661. /**
  19662. * Internal dependencies
  19663. */
  19664. function ListEdit(_ref) {
  19665. let {
  19666. attributes,
  19667. setAttributes,
  19668. mergeBlocks,
  19669. onReplace,
  19670. style
  19671. } = _ref;
  19672. const {
  19673. ordered,
  19674. values,
  19675. type,
  19676. reversed,
  19677. start,
  19678. placeholder
  19679. } = attributes;
  19680. const tagName = ordered ? 'ol' : 'ul';
  19681. const controls = _ref2 => {
  19682. let {
  19683. value,
  19684. onChange,
  19685. onFocus
  19686. } = _ref2;
  19687. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
  19688. type: "primary",
  19689. character: "[",
  19690. onUse: () => {
  19691. onChange((0,external_wp_richText_namespaceObject.__unstableOutdentListItems)(value));
  19692. }
  19693. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
  19694. type: "primary",
  19695. character: "]",
  19696. onUse: () => {
  19697. onChange((0,external_wp_richText_namespaceObject.__unstableIndentListItems)(value, {
  19698. type: tagName
  19699. }));
  19700. }
  19701. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
  19702. type: "primary",
  19703. character: "m",
  19704. onUse: () => {
  19705. onChange((0,external_wp_richText_namespaceObject.__unstableIndentListItems)(value, {
  19706. type: tagName
  19707. }));
  19708. }
  19709. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
  19710. type: "primaryShift",
  19711. character: "m",
  19712. onUse: () => {
  19713. onChange((0,external_wp_richText_namespaceObject.__unstableOutdentListItems)(value));
  19714. }
  19715. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  19716. group: "block"
  19717. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  19718. icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_bullets_rtl : format_list_bullets,
  19719. title: (0,external_wp_i18n_namespaceObject.__)('Unordered'),
  19720. describedBy: (0,external_wp_i18n_namespaceObject.__)('Convert to unordered list'),
  19721. isActive: (0,external_wp_richText_namespaceObject.__unstableIsActiveListType)(value, 'ul', tagName),
  19722. onClick: () => {
  19723. onChange((0,external_wp_richText_namespaceObject.__unstableChangeListType)(value, {
  19724. type: 'ul'
  19725. }));
  19726. onFocus();
  19727. if ((0,external_wp_richText_namespaceObject.__unstableIsListRootSelected)(value)) {
  19728. setAttributes({
  19729. ordered: false
  19730. });
  19731. }
  19732. }
  19733. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  19734. icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_numbered_rtl : format_list_numbered,
  19735. title: (0,external_wp_i18n_namespaceObject.__)('Ordered'),
  19736. describedBy: (0,external_wp_i18n_namespaceObject.__)('Convert to ordered list'),
  19737. isActive: (0,external_wp_richText_namespaceObject.__unstableIsActiveListType)(value, 'ol', tagName),
  19738. onClick: () => {
  19739. onChange((0,external_wp_richText_namespaceObject.__unstableChangeListType)(value, {
  19740. type: 'ol'
  19741. }));
  19742. onFocus();
  19743. if ((0,external_wp_richText_namespaceObject.__unstableIsListRootSelected)(value)) {
  19744. setAttributes({
  19745. ordered: true
  19746. });
  19747. }
  19748. }
  19749. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  19750. icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_outdent_rtl : format_outdent,
  19751. title: (0,external_wp_i18n_namespaceObject.__)('Outdent'),
  19752. describedBy: (0,external_wp_i18n_namespaceObject.__)('Outdent list item'),
  19753. shortcut: (0,external_wp_i18n_namespaceObject._x)('Backspace', 'keyboard key'),
  19754. isDisabled: !(0,external_wp_richText_namespaceObject.__unstableCanOutdentListItems)(value),
  19755. onClick: () => {
  19756. onChange((0,external_wp_richText_namespaceObject.__unstableOutdentListItems)(value));
  19757. onFocus();
  19758. }
  19759. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  19760. icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_indent_rtl : format_indent,
  19761. title: (0,external_wp_i18n_namespaceObject.__)('Indent'),
  19762. describedBy: (0,external_wp_i18n_namespaceObject.__)('Indent list item'),
  19763. shortcut: (0,external_wp_i18n_namespaceObject._x)('Space', 'keyboard key'),
  19764. isDisabled: !(0,external_wp_richText_namespaceObject.__unstableCanIndentListItems)(value),
  19765. onClick: () => {
  19766. onChange((0,external_wp_richText_namespaceObject.__unstableIndentListItems)(value, {
  19767. type: tagName
  19768. }));
  19769. onFocus();
  19770. }
  19771. })));
  19772. };
  19773. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  19774. style
  19775. });
  19776. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  19777. identifier: "values",
  19778. multiline: "li",
  19779. tagName: tagName,
  19780. onChange: nextValues => setAttributes({
  19781. values: nextValues
  19782. }),
  19783. value: values,
  19784. "aria-label": (0,external_wp_i18n_namespaceObject.__)('List text'),
  19785. placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('List'),
  19786. onMerge: mergeBlocks,
  19787. onSplit: value => (0,external_wp_blocks_namespaceObject.createBlock)(list_name, { ...attributes,
  19788. values: value
  19789. }),
  19790. __unstableOnSplitMiddle: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'),
  19791. onReplace: onReplace,
  19792. onRemove: () => onReplace([]),
  19793. start: start,
  19794. reversed: reversed,
  19795. type: type
  19796. }, blockProps), controls), ordered && (0,external_wp_element_namespaceObject.createElement)(ordered_list_settings, {
  19797. setAttributes: setAttributes,
  19798. ordered: ordered,
  19799. reversed: reversed,
  19800. start: start,
  19801. placeholder: placeholder
  19802. }));
  19803. }
  19804. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/save.js
  19805. /**
  19806. * WordPress dependencies
  19807. */
  19808. function list_save_save(_ref) {
  19809. let {
  19810. attributes
  19811. } = _ref;
  19812. const {
  19813. ordered,
  19814. values,
  19815. type,
  19816. reversed,
  19817. start
  19818. } = attributes;
  19819. const TagName = ordered ? 'ol' : 'ul';
  19820. return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
  19821. type,
  19822. reversed,
  19823. start
  19824. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  19825. value: values,
  19826. multiline: "li"
  19827. }));
  19828. }
  19829. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/transforms.js
  19830. /**
  19831. * WordPress dependencies
  19832. */
  19833. function getListContentSchema(_ref) {
  19834. let {
  19835. phrasingContentSchema
  19836. } = _ref;
  19837. const listContentSchema = { ...phrasingContentSchema,
  19838. ul: {},
  19839. ol: {
  19840. attributes: ['type', 'start', 'reversed']
  19841. }
  19842. }; // Recursion is needed.
  19843. // Possible: ul > li > ul.
  19844. // Impossible: ul > ul.
  19845. ['ul', 'ol'].forEach(tag => {
  19846. listContentSchema[tag].children = {
  19847. li: {
  19848. children: listContentSchema
  19849. }
  19850. };
  19851. });
  19852. return listContentSchema;
  19853. }
  19854. const list_transforms_transforms = {
  19855. from: [{
  19856. type: 'block',
  19857. isMultiBlock: true,
  19858. blocks: ['core/paragraph', 'core/heading'],
  19859. transform: blockAttributes => {
  19860. return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
  19861. values: (0,external_wp_richText_namespaceObject.toHTMLString)({
  19862. value: (0,external_wp_richText_namespaceObject.join)(blockAttributes.map(_ref2 => {
  19863. let {
  19864. content
  19865. } = _ref2;
  19866. const value = (0,external_wp_richText_namespaceObject.create)({
  19867. html: content
  19868. });
  19869. if (blockAttributes.length > 1) {
  19870. return value;
  19871. } // When converting only one block, transform
  19872. // every line to a list item.
  19873. return (0,external_wp_richText_namespaceObject.replace)(value, /\n/g, external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR);
  19874. }), external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR),
  19875. multilineTag: 'li'
  19876. }),
  19877. anchor: blockAttributes.anchor
  19878. });
  19879. }
  19880. }, {
  19881. type: 'block',
  19882. blocks: ['core/quote', 'core/pullquote'],
  19883. transform: _ref3 => {
  19884. let {
  19885. value,
  19886. anchor
  19887. } = _ref3;
  19888. return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
  19889. values: (0,external_wp_richText_namespaceObject.toHTMLString)({
  19890. value: (0,external_wp_richText_namespaceObject.create)({
  19891. html: value,
  19892. multilineTag: 'p'
  19893. }),
  19894. multilineTag: 'li'
  19895. }),
  19896. anchor
  19897. });
  19898. }
  19899. }, {
  19900. type: 'raw',
  19901. selector: 'ol,ul',
  19902. schema: args => ({
  19903. ol: getListContentSchema(args).ol,
  19904. ul: getListContentSchema(args).ul
  19905. }),
  19906. transform(node) {
  19907. const attributes = {
  19908. ordered: node.nodeName === 'OL',
  19909. anchor: node.id === '' ? undefined : node.id
  19910. };
  19911. if (attributes.ordered) {
  19912. const type = node.getAttribute('type');
  19913. if (type) {
  19914. attributes.type = type;
  19915. }
  19916. if (node.getAttribute('reversed') !== null) {
  19917. attributes.reversed = true;
  19918. }
  19919. const start = parseInt(node.getAttribute('start'), 10);
  19920. if (!isNaN(start) && ( // start=1 only makes sense if the list is reversed.
  19921. start !== 1 || attributes.reversed)) {
  19922. attributes.start = start;
  19923. }
  19924. }
  19925. return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', { ...(0,external_wp_blocks_namespaceObject.getBlockAttributes)('core/list', node.outerHTML),
  19926. ...attributes
  19927. });
  19928. }
  19929. }, ...['*', '-'].map(prefix => ({
  19930. type: 'prefix',
  19931. prefix,
  19932. transform(content) {
  19933. return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
  19934. values: `<li>${content}</li>`
  19935. });
  19936. }
  19937. })), ...['1.', '1)'].map(prefix => ({
  19938. type: 'prefix',
  19939. prefix,
  19940. transform(content) {
  19941. return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
  19942. ordered: true,
  19943. values: `<li>${content}</li>`
  19944. });
  19945. }
  19946. }))],
  19947. to: [{
  19948. type: 'block',
  19949. blocks: ['core/paragraph'],
  19950. transform: _ref4 => {
  19951. let {
  19952. values
  19953. } = _ref4;
  19954. return (0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
  19955. html: values,
  19956. multilineTag: 'li',
  19957. multilineWrapperTags: ['ul', 'ol']
  19958. }), external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR).map(piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  19959. content: (0,external_wp_richText_namespaceObject.toHTMLString)({
  19960. value: piece
  19961. })
  19962. }));
  19963. }
  19964. }, {
  19965. type: 'block',
  19966. blocks: ['core/heading'],
  19967. transform: _ref5 => {
  19968. let {
  19969. values
  19970. } = _ref5;
  19971. return (0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
  19972. html: values,
  19973. multilineTag: 'li',
  19974. multilineWrapperTags: ['ul', 'ol']
  19975. }), external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR).map(piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
  19976. content: (0,external_wp_richText_namespaceObject.toHTMLString)({
  19977. value: piece
  19978. })
  19979. }));
  19980. }
  19981. }, {
  19982. type: 'block',
  19983. blocks: ['core/quote'],
  19984. transform: _ref6 => {
  19985. let {
  19986. values,
  19987. anchor
  19988. } = _ref6;
  19989. return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
  19990. value: (0,external_wp_richText_namespaceObject.toHTMLString)({
  19991. value: (0,external_wp_richText_namespaceObject.create)({
  19992. html: values,
  19993. multilineTag: 'li',
  19994. multilineWrapperTags: ['ul', 'ol']
  19995. }),
  19996. multilineTag: 'p'
  19997. }),
  19998. anchor
  19999. });
  20000. }
  20001. }, {
  20002. type: 'block',
  20003. blocks: ['core/pullquote'],
  20004. transform: _ref7 => {
  20005. let {
  20006. values,
  20007. anchor
  20008. } = _ref7;
  20009. return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
  20010. value: (0,external_wp_richText_namespaceObject.toHTMLString)({
  20011. value: (0,external_wp_richText_namespaceObject.create)({
  20012. html: values,
  20013. multilineTag: 'li',
  20014. multilineWrapperTags: ['ul', 'ol']
  20015. }),
  20016. multilineTag: 'p'
  20017. }),
  20018. anchor
  20019. });
  20020. }
  20021. }]
  20022. };
  20023. /* harmony default export */ var list_transforms = (list_transforms_transforms);
  20024. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/index.js
  20025. /**
  20026. * WordPress dependencies
  20027. */
  20028. /**
  20029. * Internal dependencies
  20030. */
  20031. const list_metadata = {
  20032. $schema: "https://schemas.wp.org/trunk/block.json",
  20033. apiVersion: 2,
  20034. name: "core/list",
  20035. title: "List",
  20036. category: "text",
  20037. description: "Create a bulleted or numbered list.",
  20038. keywords: ["bullet list", "ordered list", "numbered list"],
  20039. textdomain: "default",
  20040. attributes: {
  20041. ordered: {
  20042. type: "boolean",
  20043. "default": false,
  20044. __experimentalRole: "content"
  20045. },
  20046. values: {
  20047. type: "string",
  20048. source: "html",
  20049. selector: "ol,ul",
  20050. multiline: "li",
  20051. __unstableMultilineWrapperTags: ["ol", "ul"],
  20052. "default": "",
  20053. __experimentalRole: "content"
  20054. },
  20055. type: {
  20056. type: "string"
  20057. },
  20058. start: {
  20059. type: "number"
  20060. },
  20061. reversed: {
  20062. type: "boolean"
  20063. },
  20064. placeholder: {
  20065. type: "string"
  20066. }
  20067. },
  20068. supports: {
  20069. anchor: true,
  20070. className: false,
  20071. typography: {
  20072. fontSize: true,
  20073. __experimentalFontFamily: true,
  20074. lineHeight: true,
  20075. __experimentalFontStyle: true,
  20076. __experimentalFontWeight: true,
  20077. __experimentalLetterSpacing: true,
  20078. __experimentalTextTransform: true,
  20079. __experimentalDefaultControls: {
  20080. fontSize: true
  20081. }
  20082. },
  20083. color: {
  20084. gradients: true,
  20085. link: true,
  20086. __experimentalDefaultControls: {
  20087. background: true,
  20088. text: true
  20089. }
  20090. },
  20091. __unstablePasteTextInline: true,
  20092. __experimentalSelector: "ol,ul",
  20093. __experimentalSlashInserter: true
  20094. },
  20095. editorStyle: "wp-block-list-editor",
  20096. style: "wp-block-list"
  20097. };
  20098. const {
  20099. name: list_name
  20100. } = list_metadata;
  20101. const settingsV1 = {
  20102. icon: library_list,
  20103. example: {
  20104. attributes: {
  20105. values: '<li>Alice.</li><li>The White Rabbit.</li><li>The Cheshire Cat.</li><li>The Mad Hatter.</li><li>The Queen of Hearts.</li>'
  20106. }
  20107. },
  20108. transforms: list_transforms,
  20109. merge(attributes, attributesToMerge) {
  20110. const {
  20111. values
  20112. } = attributesToMerge;
  20113. if (!values || values === '<li></li>') {
  20114. return attributes;
  20115. }
  20116. return { ...attributes,
  20117. values: attributes.values + values
  20118. };
  20119. },
  20120. edit: ListEdit,
  20121. save: list_save_save,
  20122. deprecated: list_deprecated
  20123. };
  20124. let list_settings = settingsV1;
  20125. if (false) { var _window; }
  20126. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/login.js
  20127. /**
  20128. * WordPress dependencies
  20129. */
  20130. const login = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  20131. xmlns: "http://www.w3.org/2000/svg",
  20132. viewBox: "0 0 24 24"
  20133. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  20134. d: "M11 14.5l1.1 1.1 3-3 .5-.5-.6-.6-3-3-1 1 1.7 1.7H5v1.5h7.7L11 14.5zM16.8 5h-7c-1.1 0-2 .9-2 2v1.5h1.5V7c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v10c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5v-1.5H7.8V17c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2z"
  20135. }));
  20136. /* harmony default export */ var library_login = (login);
  20137. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/loginout/edit.js
  20138. /**
  20139. * WordPress dependencies
  20140. */
  20141. function LoginOutEdit(_ref) {
  20142. let {
  20143. attributes,
  20144. setAttributes
  20145. } = _ref;
  20146. const {
  20147. displayLoginAsForm,
  20148. redirectToCurrent
  20149. } = attributes;
  20150. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  20151. title: (0,external_wp_i18n_namespaceObject.__)('Login/out settings')
  20152. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  20153. label: (0,external_wp_i18n_namespaceObject.__)('Display login as form'),
  20154. checked: displayLoginAsForm,
  20155. onChange: () => setAttributes({
  20156. displayLoginAsForm: !displayLoginAsForm
  20157. })
  20158. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  20159. label: (0,external_wp_i18n_namespaceObject.__)('Redirect to current URL'),
  20160. checked: redirectToCurrent,
  20161. onChange: () => setAttributes({
  20162. redirectToCurrent: !redirectToCurrent
  20163. })
  20164. }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  20165. className: 'logged-in'
  20166. }), (0,external_wp_element_namespaceObject.createElement)("a", {
  20167. href: "#login-pseudo-link"
  20168. }, (0,external_wp_i18n_namespaceObject.__)('Log out'))));
  20169. }
  20170. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/loginout/index.js
  20171. /**
  20172. * WordPress dependencies
  20173. */
  20174. /**
  20175. * Internal dependencies
  20176. */
  20177. const loginout_metadata = {
  20178. $schema: "https://schemas.wp.org/trunk/block.json",
  20179. apiVersion: 2,
  20180. name: "core/loginout",
  20181. title: "Login/out",
  20182. category: "theme",
  20183. description: "Show login & logout links.",
  20184. keywords: ["login", "logout", "form"],
  20185. textdomain: "default",
  20186. attributes: {
  20187. displayLoginAsForm: {
  20188. type: "boolean",
  20189. "default": false
  20190. },
  20191. redirectToCurrent: {
  20192. type: "boolean",
  20193. "default": true
  20194. }
  20195. },
  20196. supports: {
  20197. className: true,
  20198. typography: {
  20199. fontSize: false
  20200. }
  20201. }
  20202. };
  20203. const {
  20204. name: loginout_name
  20205. } = loginout_metadata;
  20206. const loginout_settings = {
  20207. icon: library_login,
  20208. edit: LoginOutEdit
  20209. };
  20210. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/media-and-text.js
  20211. /**
  20212. * WordPress dependencies
  20213. */
  20214. const mediaAndText = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  20215. xmlns: "http://www.w3.org/2000/svg",
  20216. viewBox: "0 0 24 24"
  20217. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  20218. d: "M3 18h8V6H3v12zM14 7.5V9h7V7.5h-7zm0 5.3h7v-1.5h-7v1.5zm0 3.7h7V15h-7v1.5z"
  20219. }));
  20220. /* harmony default export */ var media_and_text = (mediaAndText);
  20221. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/media-container-icon.js
  20222. /**
  20223. * WordPress dependencies
  20224. */
  20225. /* harmony default export */ var media_container_icon = ((0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  20226. xmlns: "http://www.w3.org/2000/svg",
  20227. viewBox: "0 0 24 24"
  20228. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  20229. d: "M18 2l2 4h-2l-2-4h-3l2 4h-2l-2-4h-1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V2zm2 12H10V4.4L11.8 8H20z"
  20230. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  20231. d: "M14 20H4V10h3V8H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3h-2z"
  20232. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  20233. d: "M5 19h8l-1.59-2H9.24l-.84 1.1L7 16.3 5 19z"
  20234. })));
  20235. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/media-container.js
  20236. /**
  20237. * External dependencies
  20238. */
  20239. /**
  20240. * WordPress dependencies
  20241. */
  20242. /**
  20243. * Internal dependencies
  20244. */
  20245. /**
  20246. * Constants
  20247. */
  20248. const media_container_ALLOWED_MEDIA_TYPES = ['image', 'video'];
  20249. function imageFillStyles(url, focalPoint) {
  20250. return url ? {
  20251. backgroundImage: `url(${url})`,
  20252. backgroundPosition: focalPoint ? `${focalPoint.x * 100}% ${focalPoint.y * 100}%` : `50% 50%`
  20253. } : {};
  20254. }
  20255. const ResizableBoxContainer = (0,external_wp_element_namespaceObject.forwardRef)((_ref, ref) => {
  20256. let {
  20257. isSelected,
  20258. isStackedOnMobile,
  20259. ...props
  20260. } = _ref;
  20261. const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('small', '<');
  20262. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, _extends({
  20263. ref: ref,
  20264. showHandle: isSelected && (!isMobile || !isStackedOnMobile)
  20265. }, props));
  20266. });
  20267. function ToolbarEditButton(_ref2) {
  20268. let {
  20269. mediaId,
  20270. mediaUrl,
  20271. onSelectMedia
  20272. } = _ref2;
  20273. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  20274. group: "other"
  20275. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  20276. mediaId: mediaId,
  20277. mediaURL: mediaUrl,
  20278. allowedTypes: media_container_ALLOWED_MEDIA_TYPES,
  20279. accept: "image/*,video/*",
  20280. onSelect: onSelectMedia
  20281. }));
  20282. }
  20283. function PlaceholderContainer(_ref3) {
  20284. let {
  20285. className,
  20286. noticeOperations,
  20287. noticeUI,
  20288. mediaUrl,
  20289. onSelectMedia
  20290. } = _ref3;
  20291. const onUploadError = message => {
  20292. noticeOperations.removeAllNotices();
  20293. noticeOperations.createErrorNotice(message);
  20294. };
  20295. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  20296. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  20297. icon: media_container_icon
  20298. }),
  20299. labels: {
  20300. title: (0,external_wp_i18n_namespaceObject.__)('Media area')
  20301. },
  20302. className: className,
  20303. onSelect: onSelectMedia,
  20304. accept: "image/*,video/*",
  20305. allowedTypes: media_container_ALLOWED_MEDIA_TYPES,
  20306. notices: noticeUI,
  20307. onError: onUploadError,
  20308. disableMediaButtons: mediaUrl
  20309. });
  20310. }
  20311. function MediaContainer(props, ref) {
  20312. const {
  20313. className,
  20314. commitWidthChange,
  20315. focalPoint,
  20316. imageFill,
  20317. isSelected,
  20318. isStackedOnMobile,
  20319. mediaAlt,
  20320. mediaId,
  20321. mediaPosition,
  20322. mediaType,
  20323. mediaUrl,
  20324. mediaWidth,
  20325. onSelectMedia,
  20326. onWidthChange
  20327. } = props;
  20328. const isTemporaryMedia = !mediaId && (0,external_wp_blob_namespaceObject.isBlobURL)(mediaUrl);
  20329. const {
  20330. toggleSelection
  20331. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  20332. if (mediaUrl) {
  20333. const onResizeStart = () => {
  20334. toggleSelection(false);
  20335. };
  20336. const onResize = (event, direction, elt) => {
  20337. onWidthChange(parseInt(elt.style.width));
  20338. };
  20339. const onResizeStop = (event, direction, elt) => {
  20340. toggleSelection(true);
  20341. commitWidthChange(parseInt(elt.style.width));
  20342. };
  20343. const enablePositions = {
  20344. right: mediaPosition === 'left',
  20345. left: mediaPosition === 'right'
  20346. };
  20347. const backgroundStyles = mediaType === 'image' && imageFill ? imageFillStyles(mediaUrl, focalPoint) : {};
  20348. const mediaTypeRenderers = {
  20349. image: () => (0,external_wp_element_namespaceObject.createElement)("img", {
  20350. src: mediaUrl,
  20351. alt: mediaAlt
  20352. }),
  20353. video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
  20354. controls: true,
  20355. src: mediaUrl
  20356. })
  20357. };
  20358. return (0,external_wp_element_namespaceObject.createElement)(ResizableBoxContainer, {
  20359. as: "figure",
  20360. className: classnames_default()(className, 'editor-media-container__resizer', {
  20361. 'is-transient': isTemporaryMedia
  20362. }),
  20363. style: backgroundStyles,
  20364. size: {
  20365. width: mediaWidth + '%'
  20366. },
  20367. minWidth: "10%",
  20368. maxWidth: "100%",
  20369. enable: enablePositions,
  20370. onResizeStart: onResizeStart,
  20371. onResize: onResize,
  20372. onResizeStop: onResizeStop,
  20373. axis: "x",
  20374. isSelected: isSelected,
  20375. isStackedOnMobile: isStackedOnMobile,
  20376. ref: ref
  20377. }, (0,external_wp_element_namespaceObject.createElement)(ToolbarEditButton, {
  20378. onSelectMedia: onSelectMedia,
  20379. mediaUrl: mediaUrl,
  20380. mediaId: mediaId
  20381. }), (mediaTypeRenderers[mediaType] || external_lodash_namespaceObject.noop)(), isTemporaryMedia && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_element_namespaceObject.createElement)(PlaceholderContainer, props));
  20382. }
  20383. return (0,external_wp_element_namespaceObject.createElement)(PlaceholderContainer, props);
  20384. }
  20385. /* harmony default export */ var media_container = ((0,external_wp_components_namespaceObject.withNotices)((0,external_wp_element_namespaceObject.forwardRef)(MediaContainer)));
  20386. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/deprecated.js
  20387. /**
  20388. * External dependencies
  20389. */
  20390. /**
  20391. * WordPress dependencies
  20392. */
  20393. /**
  20394. * Internal dependencies
  20395. */
  20396. const DEFAULT_MEDIA_WIDTH = 50;
  20397. const media_text_deprecated_migrateCustomColors = attributes => {
  20398. if (!attributes.customBackgroundColor) {
  20399. return attributes;
  20400. }
  20401. const style = {
  20402. color: {
  20403. background: attributes.customBackgroundColor
  20404. }
  20405. };
  20406. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customBackgroundColor']),
  20407. style
  20408. };
  20409. };
  20410. const baseAttributes = {
  20411. align: {
  20412. type: 'string',
  20413. default: 'wide'
  20414. },
  20415. backgroundColor: {
  20416. type: 'string'
  20417. },
  20418. mediaAlt: {
  20419. type: 'string',
  20420. source: 'attribute',
  20421. selector: 'figure img',
  20422. attribute: 'alt',
  20423. default: ''
  20424. },
  20425. mediaPosition: {
  20426. type: 'string',
  20427. default: 'left'
  20428. },
  20429. mediaId: {
  20430. type: 'number'
  20431. },
  20432. mediaType: {
  20433. type: 'string'
  20434. },
  20435. mediaWidth: {
  20436. type: 'number',
  20437. default: 50
  20438. },
  20439. isStackedOnMobile: {
  20440. type: 'boolean',
  20441. default: true
  20442. }
  20443. };
  20444. /* harmony default export */ var media_text_deprecated = ([{
  20445. attributes: { ...baseAttributes,
  20446. customBackgroundColor: {
  20447. type: 'string'
  20448. },
  20449. mediaLink: {
  20450. type: 'string'
  20451. },
  20452. linkDestination: {
  20453. type: 'string'
  20454. },
  20455. linkTarget: {
  20456. type: 'string',
  20457. source: 'attribute',
  20458. selector: 'figure a',
  20459. attribute: 'target'
  20460. },
  20461. href: {
  20462. type: 'string',
  20463. source: 'attribute',
  20464. selector: 'figure a',
  20465. attribute: 'href'
  20466. },
  20467. rel: {
  20468. type: 'string',
  20469. source: 'attribute',
  20470. selector: 'figure a',
  20471. attribute: 'rel'
  20472. },
  20473. linkClass: {
  20474. type: 'string',
  20475. source: 'attribute',
  20476. selector: 'figure a',
  20477. attribute: 'class'
  20478. },
  20479. verticalAlignment: {
  20480. type: 'string'
  20481. },
  20482. imageFill: {
  20483. type: 'boolean'
  20484. },
  20485. focalPoint: {
  20486. type: 'object'
  20487. }
  20488. },
  20489. migrate: media_text_deprecated_migrateCustomColors,
  20490. save(_ref) {
  20491. let {
  20492. attributes
  20493. } = _ref;
  20494. const {
  20495. backgroundColor,
  20496. customBackgroundColor,
  20497. isStackedOnMobile,
  20498. mediaAlt,
  20499. mediaPosition,
  20500. mediaType,
  20501. mediaUrl,
  20502. mediaWidth,
  20503. mediaId,
  20504. verticalAlignment,
  20505. imageFill,
  20506. focalPoint,
  20507. linkClass,
  20508. href,
  20509. linkTarget,
  20510. rel
  20511. } = attributes;
  20512. const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
  20513. let image = (0,external_wp_element_namespaceObject.createElement)("img", {
  20514. src: mediaUrl,
  20515. alt: mediaAlt,
  20516. className: mediaId && mediaType === 'image' ? `wp-image-${mediaId}` : null
  20517. });
  20518. if (href) {
  20519. image = (0,external_wp_element_namespaceObject.createElement)("a", {
  20520. className: linkClass,
  20521. href: href,
  20522. target: linkTarget,
  20523. rel: newRel
  20524. }, image);
  20525. }
  20526. const mediaTypeRenders = {
  20527. image: () => image,
  20528. video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
  20529. controls: true,
  20530. src: mediaUrl
  20531. })
  20532. };
  20533. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  20534. const className = classnames_default()({
  20535. 'has-media-on-the-right': 'right' === mediaPosition,
  20536. 'has-background': backgroundClass || customBackgroundColor,
  20537. [backgroundClass]: backgroundClass,
  20538. 'is-stacked-on-mobile': isStackedOnMobile,
  20539. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  20540. 'is-image-fill': imageFill
  20541. });
  20542. const backgroundStyles = imageFill ? imageFillStyles(mediaUrl, focalPoint) : {};
  20543. let gridTemplateColumns;
  20544. if (mediaWidth !== DEFAULT_MEDIA_WIDTH) {
  20545. gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
  20546. }
  20547. const style = {
  20548. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  20549. gridTemplateColumns
  20550. };
  20551. return (0,external_wp_element_namespaceObject.createElement)("div", {
  20552. className: className,
  20553. style: style
  20554. }, (0,external_wp_element_namespaceObject.createElement)("figure", {
  20555. className: "wp-block-media-text__media",
  20556. style: backgroundStyles
  20557. }, (mediaTypeRenders[mediaType] || external_lodash_namespaceObject.noop)()), (0,external_wp_element_namespaceObject.createElement)("div", {
  20558. className: "wp-block-media-text__content"
  20559. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  20560. }
  20561. }, {
  20562. attributes: { ...baseAttributes,
  20563. customBackgroundColor: {
  20564. type: 'string'
  20565. },
  20566. mediaUrl: {
  20567. type: 'string',
  20568. source: 'attribute',
  20569. selector: 'figure video,figure img',
  20570. attribute: 'src'
  20571. },
  20572. verticalAlignment: {
  20573. type: 'string'
  20574. },
  20575. imageFill: {
  20576. type: 'boolean'
  20577. },
  20578. focalPoint: {
  20579. type: 'object'
  20580. }
  20581. },
  20582. migrate: media_text_deprecated_migrateCustomColors,
  20583. save(_ref2) {
  20584. let {
  20585. attributes
  20586. } = _ref2;
  20587. const {
  20588. backgroundColor,
  20589. customBackgroundColor,
  20590. isStackedOnMobile,
  20591. mediaAlt,
  20592. mediaPosition,
  20593. mediaType,
  20594. mediaUrl,
  20595. mediaWidth,
  20596. mediaId,
  20597. verticalAlignment,
  20598. imageFill,
  20599. focalPoint
  20600. } = attributes;
  20601. const mediaTypeRenders = {
  20602. image: () => (0,external_wp_element_namespaceObject.createElement)("img", {
  20603. src: mediaUrl,
  20604. alt: mediaAlt,
  20605. className: mediaId && mediaType === 'image' ? `wp-image-${mediaId}` : null
  20606. }),
  20607. video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
  20608. controls: true,
  20609. src: mediaUrl
  20610. })
  20611. };
  20612. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  20613. const className = classnames_default()({
  20614. 'has-media-on-the-right': 'right' === mediaPosition,
  20615. [backgroundClass]: backgroundClass,
  20616. 'is-stacked-on-mobile': isStackedOnMobile,
  20617. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  20618. 'is-image-fill': imageFill
  20619. });
  20620. const backgroundStyles = imageFill ? imageFillStyles(mediaUrl, focalPoint) : {};
  20621. let gridTemplateColumns;
  20622. if (mediaWidth !== DEFAULT_MEDIA_WIDTH) {
  20623. gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
  20624. }
  20625. const style = {
  20626. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  20627. gridTemplateColumns
  20628. };
  20629. return (0,external_wp_element_namespaceObject.createElement)("div", {
  20630. className: className,
  20631. style: style
  20632. }, (0,external_wp_element_namespaceObject.createElement)("figure", {
  20633. className: "wp-block-media-text__media",
  20634. style: backgroundStyles
  20635. }, (mediaTypeRenders[mediaType] || external_lodash_namespaceObject.noop)()), (0,external_wp_element_namespaceObject.createElement)("div", {
  20636. className: "wp-block-media-text__content"
  20637. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  20638. }
  20639. }, {
  20640. attributes: { ...baseAttributes,
  20641. customBackgroundColor: {
  20642. type: 'string'
  20643. },
  20644. mediaUrl: {
  20645. type: 'string',
  20646. source: 'attribute',
  20647. selector: 'figure video,figure img',
  20648. attribute: 'src'
  20649. }
  20650. },
  20651. save(_ref3) {
  20652. let {
  20653. attributes
  20654. } = _ref3;
  20655. const {
  20656. backgroundColor,
  20657. customBackgroundColor,
  20658. isStackedOnMobile,
  20659. mediaAlt,
  20660. mediaPosition,
  20661. mediaType,
  20662. mediaUrl,
  20663. mediaWidth
  20664. } = attributes;
  20665. const mediaTypeRenders = {
  20666. image: () => (0,external_wp_element_namespaceObject.createElement)("img", {
  20667. src: mediaUrl,
  20668. alt: mediaAlt
  20669. }),
  20670. video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
  20671. controls: true,
  20672. src: mediaUrl
  20673. })
  20674. };
  20675. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  20676. const className = classnames_default()({
  20677. 'has-media-on-the-right': 'right' === mediaPosition,
  20678. [backgroundClass]: backgroundClass,
  20679. 'is-stacked-on-mobile': isStackedOnMobile
  20680. });
  20681. let gridTemplateColumns;
  20682. if (mediaWidth !== DEFAULT_MEDIA_WIDTH) {
  20683. gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
  20684. }
  20685. const style = {
  20686. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  20687. gridTemplateColumns
  20688. };
  20689. return (0,external_wp_element_namespaceObject.createElement)("div", {
  20690. className: className,
  20691. style: style
  20692. }, (0,external_wp_element_namespaceObject.createElement)("figure", {
  20693. className: "wp-block-media-text__media"
  20694. }, (mediaTypeRenders[mediaType] || external_lodash_namespaceObject.noop)()), (0,external_wp_element_namespaceObject.createElement)("div", {
  20695. className: "wp-block-media-text__content"
  20696. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  20697. }
  20698. }]);
  20699. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pull-left.js
  20700. /**
  20701. * WordPress dependencies
  20702. */
  20703. const pullLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  20704. xmlns: "http://www.w3.org/2000/svg",
  20705. viewBox: "0 0 24 24"
  20706. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  20707. d: "M4 18h6V6H4v12zm9-9.5V10h7V8.5h-7zm0 7h7V14h-7v1.5z"
  20708. }));
  20709. /* harmony default export */ var pull_left = (pullLeft);
  20710. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pull-right.js
  20711. /**
  20712. * WordPress dependencies
  20713. */
  20714. const pullRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  20715. xmlns: "http://www.w3.org/2000/svg",
  20716. viewBox: "0 0 24 24"
  20717. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  20718. d: "M14 6v12h6V6h-6zM4 10h7V8.5H4V10zm0 5.5h7V14H4v1.5z"
  20719. }));
  20720. /* harmony default export */ var pull_right = (pullRight);
  20721. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/constants.js
  20722. const DEFAULT_MEDIA_SIZE_SLUG = 'full';
  20723. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/edit.js
  20724. /**
  20725. * External dependencies
  20726. */
  20727. /**
  20728. * WordPress dependencies
  20729. */
  20730. /**
  20731. * Internal dependencies
  20732. */
  20733. /**
  20734. * Constants
  20735. */
  20736. const media_text_edit_TEMPLATE = [['core/paragraph', {
  20737. placeholder: (0,external_wp_i18n_namespaceObject._x)('Content…', 'content placeholder')
  20738. }]]; // this limits the resize to a safe zone to avoid making broken layouts
  20739. const WIDTH_CONSTRAINT_PERCENTAGE = 15;
  20740. const applyWidthConstraints = width => Math.max(WIDTH_CONSTRAINT_PERCENTAGE, Math.min(width, 100 - WIDTH_CONSTRAINT_PERCENTAGE));
  20741. const edit_LINK_DESTINATION_MEDIA = 'media';
  20742. const edit_LINK_DESTINATION_ATTACHMENT = 'attachment';
  20743. function getImageSourceUrlBySizeSlug(image, slug) {
  20744. var _image$media_details, _image$media_details$, _image$media_details$2;
  20745. // eslint-disable-next-line camelcase
  20746. return image === null || image === void 0 ? void 0 : (_image$media_details = image.media_details) === null || _image$media_details === void 0 ? void 0 : (_image$media_details$ = _image$media_details.sizes) === null || _image$media_details$ === void 0 ? void 0 : (_image$media_details$2 = _image$media_details$[slug]) === null || _image$media_details$2 === void 0 ? void 0 : _image$media_details$2.source_url;
  20747. }
  20748. function edit_attributesFromMedia(_ref) {
  20749. let {
  20750. attributes: {
  20751. linkDestination,
  20752. href
  20753. },
  20754. setAttributes
  20755. } = _ref;
  20756. return media => {
  20757. if (!media || !media.url) {
  20758. setAttributes({
  20759. mediaAlt: undefined,
  20760. mediaId: undefined,
  20761. mediaType: undefined,
  20762. mediaUrl: undefined,
  20763. mediaLink: undefined,
  20764. href: undefined,
  20765. focalPoint: undefined
  20766. });
  20767. return;
  20768. }
  20769. if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
  20770. media.type = (0,external_wp_blob_namespaceObject.getBlobTypeByURL)(media.url);
  20771. }
  20772. let mediaType;
  20773. let src; // For media selections originated from a file upload.
  20774. if (media.media_type) {
  20775. if (media.media_type === 'image') {
  20776. mediaType = 'image';
  20777. } else {
  20778. // only images and videos are accepted so if the media_type is not an image we can assume it is a video.
  20779. // video contain the media type of 'file' in the object returned from the rest api.
  20780. mediaType = 'video';
  20781. }
  20782. } else {
  20783. // For media selections originated from existing files in the media library.
  20784. mediaType = media.type;
  20785. }
  20786. if (mediaType === 'image') {
  20787. var _media$sizes, _media$sizes$large, _media$media_details, _media$media_details$, _media$media_details$2;
  20788. // Try the "large" size URL, falling back to the "full" size URL below.
  20789. src = ((_media$sizes = media.sizes) === null || _media$sizes === void 0 ? void 0 : (_media$sizes$large = _media$sizes.large) === null || _media$sizes$large === void 0 ? void 0 : _media$sizes$large.url) || ( // eslint-disable-next-line camelcase
  20790. (_media$media_details = media.media_details) === null || _media$media_details === void 0 ? void 0 : (_media$media_details$ = _media$media_details.sizes) === null || _media$media_details$ === void 0 ? void 0 : (_media$media_details$2 = _media$media_details$.large) === null || _media$media_details$2 === void 0 ? void 0 : _media$media_details$2.source_url);
  20791. }
  20792. let newHref = href;
  20793. if (linkDestination === edit_LINK_DESTINATION_MEDIA) {
  20794. // Update the media link.
  20795. newHref = media.url;
  20796. } // Check if the image is linked to the attachment page.
  20797. if (linkDestination === edit_LINK_DESTINATION_ATTACHMENT) {
  20798. // Update the media link.
  20799. newHref = media.link;
  20800. }
  20801. setAttributes({
  20802. mediaAlt: media.alt,
  20803. mediaId: media.id,
  20804. mediaType,
  20805. mediaUrl: src || media.url,
  20806. mediaLink: media.link || undefined,
  20807. href: newHref,
  20808. focalPoint: undefined
  20809. });
  20810. };
  20811. }
  20812. function MediaTextEdit(_ref2) {
  20813. let {
  20814. attributes,
  20815. isSelected,
  20816. setAttributes
  20817. } = _ref2;
  20818. const {
  20819. focalPoint,
  20820. href,
  20821. imageFill,
  20822. isStackedOnMobile,
  20823. linkClass,
  20824. linkDestination,
  20825. linkTarget,
  20826. mediaAlt,
  20827. mediaId,
  20828. mediaPosition,
  20829. mediaType,
  20830. mediaUrl,
  20831. mediaWidth,
  20832. rel,
  20833. verticalAlignment
  20834. } = attributes;
  20835. const mediaSizeSlug = attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG;
  20836. const image = (0,external_wp_data_namespaceObject.useSelect)(select => mediaId && isSelected ? select(external_wp_coreData_namespaceObject.store).getMedia(mediaId, {
  20837. context: 'view'
  20838. }) : null, [isSelected, mediaId]);
  20839. const refMediaContainer = (0,external_wp_element_namespaceObject.useRef)();
  20840. const imperativeFocalPointPreview = value => {
  20841. const {
  20842. style
  20843. } = refMediaContainer.current.resizable;
  20844. const {
  20845. x,
  20846. y
  20847. } = value;
  20848. style.backgroundPosition = `${x * 100}% ${y * 100}%`;
  20849. };
  20850. const [temporaryMediaWidth, setTemporaryMediaWidth] = (0,external_wp_element_namespaceObject.useState)(null);
  20851. const onSelectMedia = edit_attributesFromMedia({
  20852. attributes,
  20853. setAttributes
  20854. });
  20855. const onSetHref = props => {
  20856. setAttributes(props);
  20857. };
  20858. const onWidthChange = width => {
  20859. setTemporaryMediaWidth(applyWidthConstraints(width));
  20860. };
  20861. const commitWidthChange = width => {
  20862. setAttributes({
  20863. mediaWidth: applyWidthConstraints(width)
  20864. });
  20865. setTemporaryMediaWidth(applyWidthConstraints(width));
  20866. };
  20867. const classNames = classnames_default()({
  20868. 'has-media-on-the-right': 'right' === mediaPosition,
  20869. 'is-selected': isSelected,
  20870. 'is-stacked-on-mobile': isStackedOnMobile,
  20871. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  20872. 'is-image-fill': imageFill
  20873. });
  20874. const widthString = `${temporaryMediaWidth || mediaWidth}%`;
  20875. const gridTemplateColumns = 'right' === mediaPosition ? `1fr ${widthString}` : `${widthString} 1fr`;
  20876. const style = {
  20877. gridTemplateColumns,
  20878. msGridColumns: gridTemplateColumns
  20879. };
  20880. const onMediaAltChange = newMediaAlt => {
  20881. setAttributes({
  20882. mediaAlt: newMediaAlt
  20883. });
  20884. };
  20885. const onVerticalAlignmentChange = alignment => {
  20886. setAttributes({
  20887. verticalAlignment: alignment
  20888. });
  20889. };
  20890. const imageSizes = (0,external_wp_data_namespaceObject.useSelect)(select => {
  20891. const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
  20892. return settings === null || settings === void 0 ? void 0 : settings.imageSizes;
  20893. }, []);
  20894. const imageSizeOptions = (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(imageSizes, _ref3 => {
  20895. let {
  20896. slug
  20897. } = _ref3;
  20898. return getImageSourceUrlBySizeSlug(image, slug);
  20899. }), _ref4 => {
  20900. let {
  20901. name,
  20902. slug
  20903. } = _ref4;
  20904. return {
  20905. value: slug,
  20906. label: name
  20907. };
  20908. });
  20909. const updateImage = newMediaSizeSlug => {
  20910. const newUrl = getImageSourceUrlBySizeSlug(image, newMediaSizeSlug);
  20911. if (!newUrl) {
  20912. return null;
  20913. }
  20914. setAttributes({
  20915. mediaUrl: newUrl,
  20916. mediaSizeSlug: newMediaSizeSlug
  20917. });
  20918. };
  20919. const mediaTextGeneralSettings = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  20920. title: (0,external_wp_i18n_namespaceObject.__)('Media & Text settings')
  20921. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  20922. label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'),
  20923. checked: isStackedOnMobile,
  20924. onChange: () => setAttributes({
  20925. isStackedOnMobile: !isStackedOnMobile
  20926. })
  20927. }), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  20928. label: (0,external_wp_i18n_namespaceObject.__)('Crop image to fill entire column'),
  20929. checked: imageFill,
  20930. onChange: () => setAttributes({
  20931. imageFill: !imageFill
  20932. })
  20933. }), imageFill && mediaUrl && mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FocalPointPicker, {
  20934. label: (0,external_wp_i18n_namespaceObject.__)('Focal point picker'),
  20935. url: mediaUrl,
  20936. value: focalPoint,
  20937. onChange: value => setAttributes({
  20938. focalPoint: value
  20939. }),
  20940. onDragStart: imperativeFocalPointPreview,
  20941. onDrag: imperativeFocalPointPreview
  20942. }), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
  20943. label: (0,external_wp_i18n_namespaceObject.__)('Alt text (alternative text)'),
  20944. value: mediaAlt,
  20945. onChange: onMediaAltChange,
  20946. help: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
  20947. href: "https://www.w3.org/WAI/tutorials/images/decision-tree"
  20948. }, (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image')), (0,external_wp_i18n_namespaceObject.__)('Leave empty if the image is purely decorative.'))
  20949. }), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageSizeControl, {
  20950. onChangeImage: updateImage,
  20951. slug: mediaSizeSlug,
  20952. imageSizeOptions: imageSizeOptions,
  20953. isResizable: false
  20954. }), mediaUrl && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  20955. label: (0,external_wp_i18n_namespaceObject.__)('Media width'),
  20956. value: temporaryMediaWidth || mediaWidth,
  20957. onChange: commitWidthChange,
  20958. min: WIDTH_CONSTRAINT_PERCENTAGE,
  20959. max: 100 - WIDTH_CONSTRAINT_PERCENTAGE
  20960. }));
  20961. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  20962. className: classNames,
  20963. style
  20964. });
  20965. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
  20966. className: 'wp-block-media-text__content'
  20967. }, {
  20968. template: media_text_edit_TEMPLATE
  20969. });
  20970. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, mediaTextGeneralSettings), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  20971. group: "block"
  20972. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentControl, {
  20973. onChange: onVerticalAlignmentChange,
  20974. value: verticalAlignment
  20975. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  20976. icon: pull_left,
  20977. title: (0,external_wp_i18n_namespaceObject.__)('Show media on left'),
  20978. isActive: mediaPosition === 'left',
  20979. onClick: () => setAttributes({
  20980. mediaPosition: 'left'
  20981. })
  20982. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  20983. icon: pull_right,
  20984. title: (0,external_wp_i18n_namespaceObject.__)('Show media on right'),
  20985. isActive: mediaPosition === 'right',
  20986. onClick: () => setAttributes({
  20987. mediaPosition: 'right'
  20988. })
  20989. }), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageURLInputUI, {
  20990. url: href || '',
  20991. onChangeUrl: onSetHref,
  20992. linkDestination: linkDestination,
  20993. mediaType: mediaType,
  20994. mediaUrl: image && image.source_url,
  20995. mediaLink: image && image.link,
  20996. linkTarget: linkTarget,
  20997. linkClass: linkClass,
  20998. rel: rel
  20999. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(media_container, {
  21000. className: "wp-block-media-text__media",
  21001. onSelectMedia: onSelectMedia,
  21002. onWidthChange: onWidthChange,
  21003. commitWidthChange: commitWidthChange,
  21004. ref: refMediaContainer,
  21005. focalPoint,
  21006. imageFill,
  21007. isSelected,
  21008. isStackedOnMobile,
  21009. mediaAlt,
  21010. mediaId,
  21011. mediaPosition,
  21012. mediaType,
  21013. mediaUrl,
  21014. mediaWidth
  21015. }), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
  21016. }
  21017. /* harmony default export */ var media_text_edit = (MediaTextEdit);
  21018. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/save.js
  21019. /**
  21020. * External dependencies
  21021. */
  21022. /**
  21023. * WordPress dependencies
  21024. */
  21025. /**
  21026. * Internal dependencies
  21027. */
  21028. const save_DEFAULT_MEDIA_WIDTH = 50;
  21029. function media_text_save_save(_ref) {
  21030. let {
  21031. attributes
  21032. } = _ref;
  21033. const {
  21034. isStackedOnMobile,
  21035. mediaAlt,
  21036. mediaPosition,
  21037. mediaType,
  21038. mediaUrl,
  21039. mediaWidth,
  21040. mediaId,
  21041. verticalAlignment,
  21042. imageFill,
  21043. focalPoint,
  21044. linkClass,
  21045. href,
  21046. linkTarget,
  21047. rel
  21048. } = attributes;
  21049. const mediaSizeSlug = attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG;
  21050. const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
  21051. const imageClasses = classnames_default()({
  21052. [`wp-image-${mediaId}`]: mediaId && mediaType === 'image',
  21053. [`size-${mediaSizeSlug}`]: mediaId && mediaType === 'image'
  21054. });
  21055. let image = (0,external_wp_element_namespaceObject.createElement)("img", {
  21056. src: mediaUrl,
  21057. alt: mediaAlt,
  21058. className: imageClasses || null
  21059. });
  21060. if (href) {
  21061. image = (0,external_wp_element_namespaceObject.createElement)("a", {
  21062. className: linkClass,
  21063. href: href,
  21064. target: linkTarget,
  21065. rel: newRel
  21066. }, image);
  21067. }
  21068. const mediaTypeRenders = {
  21069. image: () => image,
  21070. video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
  21071. controls: true,
  21072. src: mediaUrl
  21073. })
  21074. };
  21075. const className = classnames_default()({
  21076. 'has-media-on-the-right': 'right' === mediaPosition,
  21077. 'is-stacked-on-mobile': isStackedOnMobile,
  21078. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  21079. 'is-image-fill': imageFill
  21080. });
  21081. const backgroundStyles = imageFill ? imageFillStyles(mediaUrl, focalPoint) : {};
  21082. let gridTemplateColumns;
  21083. if (mediaWidth !== save_DEFAULT_MEDIA_WIDTH) {
  21084. gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
  21085. }
  21086. const style = {
  21087. gridTemplateColumns
  21088. };
  21089. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  21090. className,
  21091. style
  21092. }), (0,external_wp_element_namespaceObject.createElement)("figure", {
  21093. className: "wp-block-media-text__media",
  21094. style: backgroundStyles
  21095. }, (mediaTypeRenders[mediaType] || external_lodash_namespaceObject.noop)()), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
  21096. className: 'wp-block-media-text__content'
  21097. })));
  21098. }
  21099. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/transforms.js
  21100. /**
  21101. * WordPress dependencies
  21102. */
  21103. const media_text_transforms_transforms = {
  21104. from: [{
  21105. type: 'block',
  21106. blocks: ['core/image'],
  21107. transform: _ref => {
  21108. let {
  21109. alt,
  21110. url,
  21111. id,
  21112. anchor
  21113. } = _ref;
  21114. return (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', {
  21115. mediaAlt: alt,
  21116. mediaId: id,
  21117. mediaUrl: url,
  21118. mediaType: 'image',
  21119. anchor
  21120. });
  21121. }
  21122. }, {
  21123. type: 'block',
  21124. blocks: ['core/video'],
  21125. transform: _ref2 => {
  21126. let {
  21127. src,
  21128. id,
  21129. anchor
  21130. } = _ref2;
  21131. return (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', {
  21132. mediaId: id,
  21133. mediaUrl: src,
  21134. mediaType: 'video',
  21135. anchor
  21136. });
  21137. }
  21138. }],
  21139. to: [{
  21140. type: 'block',
  21141. blocks: ['core/image'],
  21142. isMatch: _ref3 => {
  21143. let {
  21144. mediaType,
  21145. mediaUrl
  21146. } = _ref3;
  21147. return !mediaUrl || mediaType === 'image';
  21148. },
  21149. transform: _ref4 => {
  21150. let {
  21151. mediaAlt,
  21152. mediaId,
  21153. mediaUrl,
  21154. anchor
  21155. } = _ref4;
  21156. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  21157. alt: mediaAlt,
  21158. id: mediaId,
  21159. url: mediaUrl,
  21160. anchor
  21161. });
  21162. }
  21163. }, {
  21164. type: 'block',
  21165. blocks: ['core/video'],
  21166. isMatch: _ref5 => {
  21167. let {
  21168. mediaType,
  21169. mediaUrl
  21170. } = _ref5;
  21171. return !mediaUrl || mediaType === 'video';
  21172. },
  21173. transform: _ref6 => {
  21174. let {
  21175. mediaId,
  21176. mediaUrl,
  21177. anchor
  21178. } = _ref6;
  21179. return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', {
  21180. id: mediaId,
  21181. src: mediaUrl,
  21182. anchor
  21183. });
  21184. }
  21185. }]
  21186. };
  21187. /* harmony default export */ var media_text_transforms = (media_text_transforms_transforms);
  21188. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/index.js
  21189. /**
  21190. * WordPress dependencies
  21191. */
  21192. /**
  21193. * Internal dependencies
  21194. */
  21195. const media_text_metadata = {
  21196. $schema: "https://schemas.wp.org/trunk/block.json",
  21197. apiVersion: 2,
  21198. name: "core/media-text",
  21199. title: "Media & Text",
  21200. category: "media",
  21201. description: "Set media and words side-by-side for a richer layout.",
  21202. keywords: ["image", "video"],
  21203. textdomain: "default",
  21204. attributes: {
  21205. align: {
  21206. type: "string",
  21207. "default": "wide"
  21208. },
  21209. mediaAlt: {
  21210. type: "string",
  21211. source: "attribute",
  21212. selector: "figure img",
  21213. attribute: "alt",
  21214. "default": ""
  21215. },
  21216. mediaPosition: {
  21217. type: "string",
  21218. "default": "left"
  21219. },
  21220. mediaId: {
  21221. type: "number"
  21222. },
  21223. mediaUrl: {
  21224. type: "string",
  21225. source: "attribute",
  21226. selector: "figure video,figure img",
  21227. attribute: "src"
  21228. },
  21229. mediaLink: {
  21230. type: "string"
  21231. },
  21232. linkDestination: {
  21233. type: "string"
  21234. },
  21235. linkTarget: {
  21236. type: "string",
  21237. source: "attribute",
  21238. selector: "figure a",
  21239. attribute: "target"
  21240. },
  21241. href: {
  21242. type: "string",
  21243. source: "attribute",
  21244. selector: "figure a",
  21245. attribute: "href"
  21246. },
  21247. rel: {
  21248. type: "string",
  21249. source: "attribute",
  21250. selector: "figure a",
  21251. attribute: "rel"
  21252. },
  21253. linkClass: {
  21254. type: "string",
  21255. source: "attribute",
  21256. selector: "figure a",
  21257. attribute: "class"
  21258. },
  21259. mediaType: {
  21260. type: "string"
  21261. },
  21262. mediaWidth: {
  21263. type: "number",
  21264. "default": 50
  21265. },
  21266. mediaSizeSlug: {
  21267. type: "string"
  21268. },
  21269. isStackedOnMobile: {
  21270. type: "boolean",
  21271. "default": true
  21272. },
  21273. verticalAlignment: {
  21274. type: "string"
  21275. },
  21276. imageFill: {
  21277. type: "boolean"
  21278. },
  21279. focalPoint: {
  21280. type: "object"
  21281. }
  21282. },
  21283. supports: {
  21284. anchor: true,
  21285. align: ["wide", "full"],
  21286. html: false,
  21287. color: {
  21288. gradients: true,
  21289. link: true,
  21290. __experimentalDefaultControls: {
  21291. background: true,
  21292. text: true
  21293. }
  21294. }
  21295. },
  21296. editorStyle: "wp-block-media-text-editor",
  21297. style: "wp-block-media-text"
  21298. };
  21299. const {
  21300. name: media_text_name
  21301. } = media_text_metadata;
  21302. const media_text_settings = {
  21303. icon: media_and_text,
  21304. example: {
  21305. viewportWidth: 601,
  21306. // Columns collapse "@media (max-width: 600px)".
  21307. attributes: {
  21308. mediaType: 'image',
  21309. mediaUrl: 'https://s.w.org/images/core/5.3/Biologia_Centrali-Americana_-_Cantorchilus_semibadius_1902.jpg'
  21310. },
  21311. innerBlocks: [{
  21312. name: 'core/paragraph',
  21313. attributes: {
  21314. content: (0,external_wp_i18n_namespaceObject.__)('The wren<br>Earns his living<br>Noiselessly.')
  21315. }
  21316. }, {
  21317. name: 'core/paragraph',
  21318. attributes: {
  21319. content: (0,external_wp_i18n_namespaceObject.__)('— Kobayashi Issa (一茶)')
  21320. }
  21321. }]
  21322. },
  21323. transforms: media_text_transforms,
  21324. edit: media_text_edit,
  21325. save: media_text_save_save,
  21326. deprecated: media_text_deprecated
  21327. };
  21328. ;// CONCATENATED MODULE: external ["wp","dom"]
  21329. var external_wp_dom_namespaceObject = window["wp"]["dom"];
  21330. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/edit.js
  21331. /**
  21332. * WordPress dependencies
  21333. */
  21334. function MissingBlockWarning(_ref) {
  21335. let {
  21336. attributes,
  21337. convertToHTML
  21338. } = _ref;
  21339. const {
  21340. originalName,
  21341. originalUndelimitedContent
  21342. } = attributes;
  21343. const hasContent = !!originalUndelimitedContent;
  21344. const hasHTMLBlock = (0,external_wp_blocks_namespaceObject.getBlockType)('core/html');
  21345. const actions = [];
  21346. let messageHTML;
  21347. if (hasContent && hasHTMLBlock) {
  21348. messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)(
  21349. /* translators: %s: block name */
  21350. (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely.'), originalName);
  21351. actions.push((0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  21352. key: "convert",
  21353. onClick: convertToHTML,
  21354. variant: "primary"
  21355. }, (0,external_wp_i18n_namespaceObject.__)('Keep as HTML')));
  21356. } else {
  21357. messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)(
  21358. /* translators: %s: block name */
  21359. (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact or remove it entirely.'), originalName);
  21360. }
  21361. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  21362. className: 'has-warning'
  21363. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, {
  21364. actions: actions
  21365. }, messageHTML), (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, (0,external_wp_dom_namespaceObject.safeHTML)(originalUndelimitedContent)));
  21366. }
  21367. const MissingEdit = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, _ref2) => {
  21368. let {
  21369. clientId,
  21370. attributes
  21371. } = _ref2;
  21372. const {
  21373. replaceBlock
  21374. } = dispatch(external_wp_blockEditor_namespaceObject.store);
  21375. return {
  21376. convertToHTML() {
  21377. replaceBlock(clientId, (0,external_wp_blocks_namespaceObject.createBlock)('core/html', {
  21378. content: attributes.originalUndelimitedContent
  21379. }));
  21380. }
  21381. };
  21382. })(MissingBlockWarning);
  21383. /* harmony default export */ var missing_edit = (MissingEdit);
  21384. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/save.js
  21385. /**
  21386. * WordPress dependencies
  21387. */
  21388. function missing_save_save(_ref) {
  21389. let {
  21390. attributes
  21391. } = _ref;
  21392. // Preserve the missing block's content.
  21393. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.originalContent);
  21394. }
  21395. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/index.js
  21396. /**
  21397. * WordPress dependencies
  21398. */
  21399. /**
  21400. * Internal dependencies
  21401. */
  21402. const missing_metadata = {
  21403. $schema: "https://schemas.wp.org/trunk/block.json",
  21404. apiVersion: 2,
  21405. name: "core/missing",
  21406. title: "Unsupported",
  21407. category: "text",
  21408. description: "Your site doesn\u2019t include support for this block.",
  21409. textdomain: "default",
  21410. attributes: {
  21411. originalName: {
  21412. type: "string"
  21413. },
  21414. originalUndelimitedContent: {
  21415. type: "string"
  21416. },
  21417. originalContent: {
  21418. type: "string",
  21419. source: "html"
  21420. }
  21421. },
  21422. supports: {
  21423. className: false,
  21424. customClassName: false,
  21425. inserter: false,
  21426. html: false,
  21427. reusable: false
  21428. }
  21429. };
  21430. const {
  21431. name: missing_name
  21432. } = missing_metadata;
  21433. const missing_settings = {
  21434. name: missing_name,
  21435. __experimentalLabel(attributes, _ref) {
  21436. let {
  21437. context
  21438. } = _ref;
  21439. if (context === 'accessibility') {
  21440. const {
  21441. originalName
  21442. } = attributes;
  21443. const originalBlockType = originalName ? (0,external_wp_blocks_namespaceObject.getBlockType)(originalName) : undefined;
  21444. if (originalBlockType) {
  21445. return originalBlockType.settings.title || originalName;
  21446. }
  21447. return '';
  21448. }
  21449. },
  21450. edit: missing_edit,
  21451. save: missing_save_save
  21452. };
  21453. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more.js
  21454. /**
  21455. * WordPress dependencies
  21456. */
  21457. const more = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  21458. viewBox: "0 0 24 24",
  21459. xmlns: "http://www.w3.org/2000/svg"
  21460. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  21461. d: "M4 9v1.5h16V9H4zm12 5.5h4V13h-4v1.5zm-6 0h4V13h-4v1.5zm-6 0h4V13H4v1.5z"
  21462. }));
  21463. /* harmony default export */ var library_more = (more);
  21464. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/edit.js
  21465. /**
  21466. * WordPress dependencies
  21467. */
  21468. const DEFAULT_TEXT = (0,external_wp_i18n_namespaceObject.__)('Read more');
  21469. function MoreEdit(_ref) {
  21470. let {
  21471. attributes: {
  21472. customText,
  21473. noTeaser
  21474. },
  21475. insertBlocksAfter,
  21476. setAttributes
  21477. } = _ref;
  21478. const onChangeInput = event => {
  21479. setAttributes({
  21480. customText: event.target.value !== '' ? event.target.value : undefined
  21481. });
  21482. };
  21483. const onKeyDown = _ref2 => {
  21484. let {
  21485. keyCode
  21486. } = _ref2;
  21487. if (keyCode === external_wp_keycodes_namespaceObject.ENTER) {
  21488. insertBlocksAfter([(0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())]);
  21489. }
  21490. };
  21491. const getHideExcerptHelp = checked => checked ? (0,external_wp_i18n_namespaceObject.__)('The excerpt is hidden.') : (0,external_wp_i18n_namespaceObject.__)('The excerpt is visible.');
  21492. const toggleHideExcerpt = () => setAttributes({
  21493. noTeaser: !noTeaser
  21494. });
  21495. const style = {
  21496. width: `${(customText ? customText : DEFAULT_TEXT).length + 1.2}em`
  21497. };
  21498. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  21499. label: (0,external_wp_i18n_namespaceObject.__)('Hide the excerpt on the full content page'),
  21500. checked: !!noTeaser,
  21501. onChange: toggleHideExcerpt,
  21502. help: getHideExcerptHelp
  21503. }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)("div", {
  21504. className: "wp-block-more"
  21505. }, (0,external_wp_element_namespaceObject.createElement)("input", {
  21506. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Read more link text'),
  21507. type: "text",
  21508. value: customText,
  21509. placeholder: DEFAULT_TEXT,
  21510. onChange: onChangeInput,
  21511. onKeyDown: onKeyDown,
  21512. style: style
  21513. }))));
  21514. }
  21515. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/save.js
  21516. /**
  21517. * External dependencies
  21518. */
  21519. /**
  21520. * WordPress dependencies
  21521. */
  21522. function more_save_save(_ref) {
  21523. let {
  21524. attributes: {
  21525. customText,
  21526. noTeaser
  21527. }
  21528. } = _ref;
  21529. const moreTag = customText ? `<!--more ${customText}-->` : '<!--more-->';
  21530. const noTeaserTag = noTeaser ? '<!--noteaser-->' : '';
  21531. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, (0,external_lodash_namespaceObject.compact)([moreTag, noTeaserTag]).join('\n'));
  21532. }
  21533. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/transforms.js
  21534. /**
  21535. * WordPress dependencies
  21536. */
  21537. const more_transforms_transforms = {
  21538. from: [{
  21539. type: 'raw',
  21540. schema: {
  21541. 'wp-block': {
  21542. attributes: ['data-block']
  21543. }
  21544. },
  21545. isMatch: node => node.dataset && node.dataset.block === 'core/more',
  21546. transform(node) {
  21547. const {
  21548. customText,
  21549. noTeaser
  21550. } = node.dataset;
  21551. const attrs = {}; // Don't copy unless defined and not an empty string.
  21552. if (customText) {
  21553. attrs.customText = customText;
  21554. } // Special handling for boolean.
  21555. if (noTeaser === '') {
  21556. attrs.noTeaser = true;
  21557. }
  21558. return (0,external_wp_blocks_namespaceObject.createBlock)('core/more', attrs);
  21559. }
  21560. }]
  21561. };
  21562. /* harmony default export */ var more_transforms = (more_transforms_transforms);
  21563. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/index.js
  21564. /**
  21565. * WordPress dependencies
  21566. */
  21567. /**
  21568. * Internal dependencies
  21569. */
  21570. const more_metadata = {
  21571. $schema: "https://schemas.wp.org/trunk/block.json",
  21572. apiVersion: 2,
  21573. name: "core/more",
  21574. title: "More",
  21575. category: "design",
  21576. description: "Content before this block will be shown in the excerpt on your archives page.",
  21577. keywords: ["read more"],
  21578. textdomain: "default",
  21579. attributes: {
  21580. customText: {
  21581. type: "string"
  21582. },
  21583. noTeaser: {
  21584. type: "boolean",
  21585. "default": false
  21586. }
  21587. },
  21588. supports: {
  21589. customClassName: false,
  21590. className: false,
  21591. html: false,
  21592. multiple: false
  21593. },
  21594. editorStyle: "wp-block-more-editor"
  21595. };
  21596. const {
  21597. name: more_name
  21598. } = more_metadata;
  21599. const more_settings = {
  21600. icon: library_more,
  21601. example: {},
  21602. __experimentalLabel(attributes, _ref) {
  21603. let {
  21604. context
  21605. } = _ref;
  21606. if (context === 'accessibility') {
  21607. return attributes.customText;
  21608. }
  21609. },
  21610. transforms: more_transforms,
  21611. edit: MoreEdit,
  21612. save: more_save_save
  21613. };
  21614. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/navigation.js
  21615. /**
  21616. * WordPress dependencies
  21617. */
  21618. const navigation = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  21619. viewBox: "0 0 24 24",
  21620. xmlns: "http://www.w3.org/2000/svg"
  21621. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  21622. d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"
  21623. }));
  21624. /* harmony default export */ var library_navigation = (navigation);
  21625. ;// CONCATENATED MODULE: external ["wp","a11y"]
  21626. var external_wp_a11y_namespaceObject = window["wp"]["a11y"];
  21627. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-navigation-menu.js
  21628. /**
  21629. * WordPress dependencies
  21630. */
  21631. function useNavigationMenu(ref) {
  21632. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  21633. var _navigationMenu;
  21634. const {
  21635. getEntityRecord,
  21636. getEditedEntityRecord,
  21637. getEntityRecords,
  21638. hasFinishedResolution,
  21639. isResolving,
  21640. canUser
  21641. } = select(external_wp_coreData_namespaceObject.store);
  21642. const navigationMenuSingleArgs = ['postType', 'wp_navigation', ref];
  21643. const rawNavigationMenu = ref ? getEntityRecord(...navigationMenuSingleArgs) : null;
  21644. let navigationMenu = ref ? getEditedEntityRecord(...navigationMenuSingleArgs) : null; // getEditedEntityRecord will return the post regardless of status.
  21645. // Therefore if the found post is not published then we should ignore it.
  21646. if (((_navigationMenu = navigationMenu) === null || _navigationMenu === void 0 ? void 0 : _navigationMenu.status) !== 'publish') {
  21647. navigationMenu = null;
  21648. }
  21649. const hasResolvedNavigationMenu = ref ? hasFinishedResolution('getEditedEntityRecord', navigationMenuSingleArgs) : false;
  21650. const navigationMenuMultipleArgs = ['postType', 'wp_navigation', {
  21651. per_page: -1,
  21652. status: 'publish'
  21653. }];
  21654. const navigationMenus = getEntityRecords(...navigationMenuMultipleArgs);
  21655. const canSwitchNavigationMenu = ref ? (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.length) > 1 : (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.length) > 0;
  21656. return {
  21657. isNavigationMenuResolved: hasResolvedNavigationMenu,
  21658. isNavigationMenuMissing: !ref || hasResolvedNavigationMenu && !rawNavigationMenu,
  21659. canSwitchNavigationMenu,
  21660. isResolvingNavigationMenus: isResolving('getEntityRecords', navigationMenuMultipleArgs),
  21661. hasResolvedNavigationMenus: hasFinishedResolution('getEntityRecords', navigationMenuMultipleArgs),
  21662. navigationMenu,
  21663. navigationMenus,
  21664. canUserUpdateNavigationMenu: ref ? canUser('update', 'navigation', ref) : undefined,
  21665. hasResolvedCanUserUpdateNavigationMenu: hasFinishedResolution('canUser', ['update', 'navigation', ref]),
  21666. canUserDeleteNavigationMenu: ref ? canUser('delete', 'navigation', ref) : undefined,
  21667. hasResolvedCanUserDeleteNavigationMenu: hasFinishedResolution('canUser', ['delete', 'navigation', ref]),
  21668. canUserCreateNavigationMenu: canUser('create', 'navigation'),
  21669. isResolvingCanUserCreateNavigationMenu: isResolving('canUser', ['create', 'navigation']),
  21670. hasResolvedCanUserCreateNavigationMenu: hasFinishedResolution('canUser', ['create', 'navigation'])
  21671. };
  21672. }, [ref]);
  21673. }
  21674. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-navigation-entities.js
  21675. /**
  21676. * WordPress dependencies
  21677. */
  21678. /**
  21679. * @typedef {Object} NavigationEntitiesData
  21680. * @property {Array|undefined} pages - a collection of WP Post entity objects of post type "Page".
  21681. * @property {boolean} isResolvingPages - indicates whether the request to fetch pages is currently resolving.
  21682. * @property {boolean} hasResolvedPages - indicates whether the request to fetch pages has finished resolving.
  21683. * @property {Array|undefined} menus - a collection of Menu entity objects.
  21684. * @property {boolean} isResolvingMenus - indicates whether the request to fetch menus is currently resolving.
  21685. * @property {boolean} hasResolvedMenus - indicates whether the request to fetch menus has finished resolving.
  21686. * @property {Array|undefined} menusItems - a collection of Menu Item entity objects for the current menuId.
  21687. * @property {boolean} hasResolvedMenuItems - indicates whether the request to fetch menuItems has finished resolving.
  21688. * @property {boolean} hasPages - indicates whether there is currently any data for pages.
  21689. * @property {boolean} hasMenus - indicates whether there is currently any data for menus.
  21690. */
  21691. /**
  21692. * Manages fetching and resolution state for all entities required
  21693. * for the Navigation block.
  21694. *
  21695. * @param {number} menuId the menu for which to retrieve menuItem data.
  21696. * @return { NavigationEntitiesData } the entity data.
  21697. */
  21698. function useNavigationEntities(menuId) {
  21699. const {
  21700. records: menus,
  21701. isResolving: isResolvingMenus,
  21702. hasResolved: hasResolvedMenus
  21703. } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('root', 'menu', {
  21704. per_page: -1,
  21705. context: 'view'
  21706. });
  21707. const {
  21708. records: pages,
  21709. isResolving: isResolvingPages,
  21710. hasResolved: hasResolvedPages
  21711. } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('postType', 'page', {
  21712. parent: 0,
  21713. order: 'asc',
  21714. orderby: 'id',
  21715. per_page: -1,
  21716. context: 'view'
  21717. });
  21718. const {
  21719. records: menuItems,
  21720. hasResolved: hasResolvedMenuItems
  21721. } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('root', 'menuItem', {
  21722. menus: menuId,
  21723. per_page: -1,
  21724. context: 'view'
  21725. }, {
  21726. enabled: !!menuId
  21727. });
  21728. return {
  21729. pages,
  21730. isResolvingPages,
  21731. hasResolvedPages,
  21732. hasPages: !!(hasResolvedPages && pages !== null && pages !== void 0 && pages.length),
  21733. menus,
  21734. isResolvingMenus,
  21735. hasResolvedMenus,
  21736. hasMenus: !!(hasResolvedMenus && menus !== null && menus !== void 0 && menus.length),
  21737. menuItems,
  21738. hasResolvedMenuItems
  21739. };
  21740. }
  21741. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
  21742. /**
  21743. * WordPress dependencies
  21744. */
  21745. /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
  21746. /**
  21747. * Return an SVG icon.
  21748. *
  21749. * @param {IconProps} props icon is the SVG component to render
  21750. * size is a number specifiying the icon size in pixels
  21751. * Other props will be passed to wrapped SVG component
  21752. *
  21753. * @return {JSX.Element} Icon component
  21754. */
  21755. function Icon(_ref) {
  21756. let {
  21757. icon,
  21758. size = 24,
  21759. ...props
  21760. } = _ref;
  21761. return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
  21762. width: size,
  21763. height: size,
  21764. ...props
  21765. });
  21766. }
  21767. /* harmony default export */ var icon = (Icon);
  21768. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/placeholder/placeholder-preview.js
  21769. /**
  21770. * WordPress dependencies
  21771. */
  21772. const PlaceholderPreview = _ref => {
  21773. let {
  21774. isVisible = true
  21775. } = _ref;
  21776. return (0,external_wp_element_namespaceObject.createElement)("div", {
  21777. "aria-hidden": !isVisible ? true : undefined,
  21778. className: "wp-block-navigation-placeholder__preview"
  21779. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  21780. className: "wp-block-navigation-placeholder__actions__indicator"
  21781. }, (0,external_wp_element_namespaceObject.createElement)(icon, {
  21782. icon: library_navigation
  21783. }), (0,external_wp_i18n_namespaceObject.__)('Navigation')));
  21784. };
  21785. /* harmony default export */ var placeholder_preview = (PlaceholderPreview);
  21786. ;// CONCATENATED MODULE: external ["wp","htmlEntities"]
  21787. var external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
  21788. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-selector.js
  21789. /**
  21790. * WordPress dependencies
  21791. */
  21792. /**
  21793. * Internal dependencies
  21794. */
  21795. function NavigationMenuSelector(_ref, forwardedRef) {
  21796. let {
  21797. currentMenuId,
  21798. onSelect,
  21799. onCreateNew,
  21800. showManageActions = false,
  21801. actionLabel,
  21802. toggleProps = {}
  21803. } = _ref;
  21804. /* translators: %s: The name of a menu. */
  21805. const createActionLabel = (0,external_wp_i18n_namespaceObject.__)("Create from '%s'");
  21806. actionLabel = actionLabel || createActionLabel;
  21807. const {
  21808. menus: classicMenus
  21809. } = useNavigationEntities();
  21810. const {
  21811. navigationMenus,
  21812. canUserCreateNavigationMenu,
  21813. canUserUpdateNavigationMenu,
  21814. canSwitchNavigationMenu
  21815. } = useNavigationMenu();
  21816. const handleSelect = (0,external_wp_element_namespaceObject.useCallback)(_onClose => selectedId => {
  21817. _onClose();
  21818. onSelect(navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.find(post => post.id === selectedId));
  21819. }, [navigationMenus]);
  21820. const handleSelectClassic = (0,external_wp_element_namespaceObject.useCallback)((_onClose, menu) => () => {
  21821. _onClose();
  21822. onSelect(menu);
  21823. }, []);
  21824. const menuChoices = (0,external_wp_element_namespaceObject.useMemo)(() => {
  21825. return (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.map(_ref2 => {
  21826. let {
  21827. id,
  21828. title
  21829. } = _ref2;
  21830. const label = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title.rendered);
  21831. return {
  21832. value: id,
  21833. label,
  21834. ariaLabel: (0,external_wp_i18n_namespaceObject.sprintf)(actionLabel, label)
  21835. };
  21836. })) || [];
  21837. }, [navigationMenus]);
  21838. const hasNavigationMenus = !!(navigationMenus !== null && navigationMenus !== void 0 && navigationMenus.length);
  21839. const hasClassicMenus = !!(classicMenus !== null && classicMenus !== void 0 && classicMenus.length);
  21840. const showNavigationMenus = !!canSwitchNavigationMenu;
  21841. const showClassicMenus = !!canUserCreateNavigationMenu;
  21842. const hasManagePermissions = canUserCreateNavigationMenu || canUserUpdateNavigationMenu; // Show the selector if:
  21843. // - has switch or create permissions and there are block or classic menus.
  21844. // - user has create or update permisisons and component should show the menu actions.
  21845. const showSelectMenus = (canSwitchNavigationMenu || canUserCreateNavigationMenu) && (hasNavigationMenus || hasClassicMenus) || hasManagePermissions && showManageActions;
  21846. if (!showSelectMenus) {
  21847. return null;
  21848. }
  21849. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
  21850. ref: forwardedRef,
  21851. label: (0,external_wp_i18n_namespaceObject.__)('Select Menu'),
  21852. text: (0,external_wp_i18n_namespaceObject.__)('Select Menu'),
  21853. icon: null,
  21854. toggleProps: toggleProps
  21855. }, _ref3 => {
  21856. let {
  21857. onClose
  21858. } = _ref3;
  21859. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, showNavigationMenus && hasNavigationMenus && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  21860. label: (0,external_wp_i18n_namespaceObject.__)('Menus')
  21861. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItemsChoice, {
  21862. value: currentMenuId,
  21863. onSelect: handleSelect(onClose),
  21864. choices: menuChoices
  21865. })), showClassicMenus && hasClassicMenus && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  21866. label: (0,external_wp_i18n_namespaceObject.__)('Classic Menus')
  21867. }, classicMenus === null || classicMenus === void 0 ? void 0 : classicMenus.map(menu => {
  21868. const label = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menu.name);
  21869. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  21870. onClick: handleSelectClassic(onClose, menu),
  21871. key: menu.id,
  21872. "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(createActionLabel, label)
  21873. }, label);
  21874. })), showManageActions && hasManagePermissions && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  21875. label: (0,external_wp_i18n_namespaceObject.__)('Tools')
  21876. }, canUserCreateNavigationMenu && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  21877. onClick: onCreateNew
  21878. }, (0,external_wp_i18n_namespaceObject.__)('Create new menu')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  21879. href: (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', {
  21880. post_type: 'wp_navigation'
  21881. })
  21882. }, (0,external_wp_i18n_namespaceObject.__)('Manage menus'))));
  21883. });
  21884. }
  21885. /* harmony default export */ var navigation_menu_selector = ((0,external_wp_element_namespaceObject.forwardRef)(NavigationMenuSelector));
  21886. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/placeholder/index.js
  21887. /**
  21888. * WordPress dependencies
  21889. */
  21890. /**
  21891. * Internal dependencies
  21892. */
  21893. function NavigationPlaceholder(_ref) {
  21894. let {
  21895. isSelected,
  21896. currentMenuId,
  21897. clientId,
  21898. canUserCreateNavigationMenu = false,
  21899. isResolvingCanUserCreateNavigationMenu,
  21900. onFinish,
  21901. onCreateEmpty
  21902. } = _ref;
  21903. const {
  21904. isResolvingMenus,
  21905. hasResolvedMenus
  21906. } = useNavigationEntities();
  21907. (0,external_wp_element_namespaceObject.useEffect)(() => {
  21908. if (!isSelected) {
  21909. return;
  21910. }
  21911. if (isResolvingMenus) {
  21912. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Loading Navigation block setup options.'));
  21913. }
  21914. if (hasResolvedMenus) {
  21915. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Navigation block setup options ready.'));
  21916. }
  21917. }, [isResolvingMenus, isSelected]);
  21918. const isResolvingActions = isResolvingMenus && isResolvingCanUserCreateNavigationMenu;
  21919. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  21920. className: "wp-block-navigation-placeholder"
  21921. }, (0,external_wp_element_namespaceObject.createElement)(placeholder_preview, {
  21922. isVisible: !isSelected
  21923. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  21924. "aria-hidden": !isSelected ? true : undefined,
  21925. className: "wp-block-navigation-placeholder__controls"
  21926. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  21927. className: "wp-block-navigation-placeholder__actions"
  21928. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  21929. className: "wp-block-navigation-placeholder__actions__indicator"
  21930. }, (0,external_wp_element_namespaceObject.createElement)(icon, {
  21931. icon: library_navigation
  21932. }), " ", (0,external_wp_i18n_namespaceObject.__)('Navigation')), (0,external_wp_element_namespaceObject.createElement)("hr", null), isResolvingActions && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_element_namespaceObject.createElement)(navigation_menu_selector, {
  21933. currentMenuId: currentMenuId,
  21934. clientId: clientId,
  21935. onSelect: onFinish,
  21936. toggleProps: {
  21937. variant: 'tertiary',
  21938. iconPosition: 'right',
  21939. className: 'wp-block-navigation-placeholder__actions__dropdown'
  21940. }
  21941. }), (0,external_wp_element_namespaceObject.createElement)("hr", null), canUserCreateNavigationMenu && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  21942. variant: "tertiary",
  21943. onClick: onCreateEmpty
  21944. }, (0,external_wp_i18n_namespaceObject.__)('Start empty'))))));
  21945. }
  21946. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
  21947. /**
  21948. * WordPress dependencies
  21949. */
  21950. const close_close = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  21951. xmlns: "http://www.w3.org/2000/svg",
  21952. viewBox: "0 0 24 24"
  21953. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  21954. d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"
  21955. }));
  21956. /* harmony default export */ var library_close = (close_close);
  21957. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/overlay-menu-icon.js
  21958. /**
  21959. * WordPress dependencies
  21960. */
  21961. function OverlayMenuIcon() {
  21962. return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  21963. xmlns: "http://www.w3.org/2000/svg",
  21964. viewBox: "0 0 24 24",
  21965. width: "24",
  21966. height: "24",
  21967. "aria-hidden": "true",
  21968. focusable: "false"
  21969. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
  21970. x: "4",
  21971. y: "7.5",
  21972. width: "16",
  21973. height: "1.5"
  21974. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
  21975. x: "4",
  21976. y: "15",
  21977. width: "16",
  21978. height: "1.5"
  21979. }));
  21980. }
  21981. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/responsive-wrapper.js
  21982. /**
  21983. * External dependencies
  21984. */
  21985. /**
  21986. * WordPress dependencies
  21987. */
  21988. /**
  21989. * Internal dependencies
  21990. */
  21991. function ResponsiveWrapper(_ref) {
  21992. let {
  21993. children,
  21994. id,
  21995. isOpen,
  21996. isResponsive,
  21997. onToggle,
  21998. isHiddenByDefault,
  21999. classNames,
  22000. styles,
  22001. hasIcon
  22002. } = _ref;
  22003. if (!isResponsive) {
  22004. return children;
  22005. }
  22006. const responsiveContainerClasses = classnames_default()('wp-block-navigation__responsive-container', classNames, {
  22007. 'is-menu-open': isOpen,
  22008. 'hidden-by-default': isHiddenByDefault
  22009. });
  22010. const openButtonClasses = classnames_default()('wp-block-navigation__responsive-container-open', {
  22011. 'always-shown': isHiddenByDefault
  22012. });
  22013. const modalId = `${id}-modal`;
  22014. const dialogProps = {
  22015. className: 'wp-block-navigation__responsive-dialog',
  22016. ...(isOpen && {
  22017. role: 'dialog',
  22018. 'aria-modal': true,
  22019. 'aria-label': (0,external_wp_i18n_namespaceObject.__)('Menu')
  22020. })
  22021. };
  22022. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !isOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  22023. "aria-haspopup": "true",
  22024. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Open menu'),
  22025. className: openButtonClasses,
  22026. onClick: () => onToggle(true)
  22027. }, hasIcon && (0,external_wp_element_namespaceObject.createElement)(OverlayMenuIcon, null), !hasIcon && (0,external_wp_element_namespaceObject.createElement)("span", {
  22028. className: "wp-block-navigation__toggle_button_label"
  22029. }, (0,external_wp_i18n_namespaceObject.__)('Menu'))), (0,external_wp_element_namespaceObject.createElement)("div", {
  22030. className: responsiveContainerClasses,
  22031. style: styles,
  22032. id: modalId
  22033. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  22034. className: "wp-block-navigation__responsive-close",
  22035. tabIndex: "-1"
  22036. }, (0,external_wp_element_namespaceObject.createElement)("div", dialogProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  22037. className: "wp-block-navigation__responsive-container-close",
  22038. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Close menu'),
  22039. onClick: () => onToggle(false)
  22040. }, (0,external_wp_element_namespaceObject.createElement)(icon, {
  22041. icon: library_close
  22042. })), (0,external_wp_element_namespaceObject.createElement)("div", {
  22043. className: "wp-block-navigation__responsive-container-content",
  22044. id: `${modalId}-content`
  22045. }, children)))));
  22046. }
  22047. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/inner-blocks.js
  22048. /**
  22049. * WordPress dependencies
  22050. */
  22051. /**
  22052. * Internal dependencies
  22053. */
  22054. const inner_blocks_ALLOWED_BLOCKS = ['core/navigation-link', 'core/search', 'core/social-links', 'core/page-list', 'core/spacer', 'core/home-link', 'core/site-title', 'core/site-logo', 'core/navigation-submenu'];
  22055. const inner_blocks_DEFAULT_BLOCK = {
  22056. name: 'core/navigation-link'
  22057. };
  22058. const LAYOUT = {
  22059. type: 'default',
  22060. alignments: []
  22061. };
  22062. function NavigationInnerBlocks(_ref) {
  22063. let {
  22064. clientId,
  22065. hasCustomPlaceholder,
  22066. orientation
  22067. } = _ref;
  22068. const {
  22069. isImmediateParentOfSelectedBlock,
  22070. selectedBlockHasChildren,
  22071. isSelected
  22072. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  22073. const {
  22074. getBlockCount,
  22075. hasSelectedInnerBlock,
  22076. getSelectedBlockClientId
  22077. } = select(external_wp_blockEditor_namespaceObject.store);
  22078. const selectedBlockId = getSelectedBlockClientId();
  22079. return {
  22080. isImmediateParentOfSelectedBlock: hasSelectedInnerBlock(clientId, false),
  22081. selectedBlockHasChildren: !!getBlockCount(selectedBlockId),
  22082. // This prop is already available but computing it here ensures it's
  22083. // fresh compared to isImmediateParentOfSelectedBlock.
  22084. isSelected: selectedBlockId === clientId
  22085. };
  22086. }, [clientId]);
  22087. const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_navigation');
  22088. const shouldDirectInsert = (0,external_wp_element_namespaceObject.useMemo)(() => blocks.every(_ref2 => {
  22089. let {
  22090. name
  22091. } = _ref2;
  22092. return name === 'core/navigation-link' || name === 'core/navigation-submenu' || name === 'core/page-list';
  22093. }), [blocks]); // When the block is selected itself or has a top level item selected that
  22094. // doesn't itself have children, show the standard appender. Else show no
  22095. // appender.
  22096. const parentOrChildHasSelection = isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren;
  22097. const placeholder = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_wp_element_namespaceObject.createElement)(placeholder_preview, null), []);
  22098. const hasMenuItems = !!(blocks !== null && blocks !== void 0 && blocks.length); // If there is a `ref` attribute pointing to a `wp_navigation` but
  22099. // that menu has no **items** (i.e. empty) then show a placeholder.
  22100. // The block must also be selected else the placeholder will display
  22101. // alongside the appender.
  22102. const showPlaceholder = !hasCustomPlaceholder && !hasMenuItems && !isSelected;
  22103. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
  22104. className: 'wp-block-navigation__container'
  22105. }, {
  22106. value: blocks,
  22107. onInput,
  22108. onChange,
  22109. allowedBlocks: inner_blocks_ALLOWED_BLOCKS,
  22110. __experimentalDefaultBlock: inner_blocks_DEFAULT_BLOCK,
  22111. __experimentalDirectInsert: shouldDirectInsert,
  22112. orientation,
  22113. // As an exception to other blocks which feature nesting, show
  22114. // the block appender even when a child block is selected.
  22115. // This should be a temporary fix, to be replaced by improvements to
  22116. // the sibling inserter.
  22117. // See https://github.com/WordPress/gutenberg/issues/37572.
  22118. renderAppender: isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren || // Show the appender while dragging to allow inserting element between item and the appender.
  22119. parentOrChildHasSelection ? external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender : false,
  22120. // Template lock set to false here so that the Nav
  22121. // Block on the experimental menus screen does not
  22122. // inherit templateLock={ 'all' }.
  22123. templateLock: false,
  22124. __experimentalLayout: LAYOUT,
  22125. placeholder: showPlaceholder ? placeholder : undefined
  22126. });
  22127. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockContentOverlay, {
  22128. clientId: clientId,
  22129. tagName: 'div',
  22130. wrapperProps: innerBlocksProps
  22131. });
  22132. }
  22133. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-name-control.js
  22134. /**
  22135. * WordPress dependencies
  22136. */
  22137. function NavigationMenuNameControl() {
  22138. const [title, updateTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title');
  22139. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  22140. label: (0,external_wp_i18n_namespaceObject.__)('Menu name'),
  22141. value: title,
  22142. onChange: updateTitle
  22143. });
  22144. }
  22145. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/create-template-part-id.js
  22146. /**
  22147. * Generates a template part Id based on slug and theme inputs.
  22148. *
  22149. * @param {string} theme the template part's theme.
  22150. * @param {string} slug the template part's slug
  22151. * @return {string|null} the template part's Id.
  22152. */
  22153. function createTemplatePartId(theme, slug) {
  22154. return theme && slug ? theme + '//' + slug : null;
  22155. }
  22156. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-template-part-area-label.js
  22157. /**
  22158. * WordPress dependencies
  22159. */
  22160. /**
  22161. * Internal dependencies
  22162. */
  22163. // TODO: this util should perhaps be refactored somewhere like core-data.
  22164. function useTemplatePartAreaLabel(clientId) {
  22165. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  22166. // Use the lack of a clientId as an opportunity to bypass the rest
  22167. // of this hook.
  22168. if (!clientId) {
  22169. return;
  22170. }
  22171. const {
  22172. getBlock,
  22173. getBlockParentsByBlockName
  22174. } = select(external_wp_blockEditor_namespaceObject.store);
  22175. const withAscendingResults = true;
  22176. const parentTemplatePartClientIds = getBlockParentsByBlockName(clientId, 'core/template-part', withAscendingResults);
  22177. if (!(parentTemplatePartClientIds !== null && parentTemplatePartClientIds !== void 0 && parentTemplatePartClientIds.length)) {
  22178. return;
  22179. } // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
  22180. // Blocks can be loaded into a *non-post* block editor.
  22181. // This code is lifted from this file:
  22182. // packages/block-library/src/template-part/edit/advanced-controls.js
  22183. // eslint-disable-next-line @wordpress/data-no-store-string-literals
  22184. const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas();
  22185. const {
  22186. getEditedEntityRecord
  22187. } = select(external_wp_coreData_namespaceObject.store);
  22188. for (const templatePartClientId of parentTemplatePartClientIds) {
  22189. const templatePartBlock = getBlock(templatePartClientId); // The 'area' usually isn't stored on the block, but instead
  22190. // on the entity.
  22191. const {
  22192. theme,
  22193. slug
  22194. } = templatePartBlock.attributes;
  22195. const templatePartEntityId = createTemplatePartId(theme, slug);
  22196. const templatePartEntity = getEditedEntityRecord('postType', 'wp_template_part', templatePartEntityId); // Look up the `label` for the area in the defined areas so
  22197. // that an internationalized label can be used.
  22198. if (templatePartEntity !== null && templatePartEntity !== void 0 && templatePartEntity.area) {
  22199. var _definedAreas$find;
  22200. return (_definedAreas$find = definedAreas.find(definedArea => definedArea.area !== 'uncategorized' && definedArea.area === templatePartEntity.area)) === null || _definedAreas$find === void 0 ? void 0 : _definedAreas$find.label;
  22201. }
  22202. }
  22203. }, [clientId]);
  22204. }
  22205. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-generate-default-navigation-title.js
  22206. /**
  22207. * WordPress dependencies
  22208. */
  22209. /**
  22210. * Internal dependencies
  22211. */
  22212. const DRAFT_MENU_PARAMS = ['postType', 'wp_navigation', {
  22213. status: 'draft',
  22214. per_page: -1
  22215. }];
  22216. const PUBLISHED_MENU_PARAMS = ['postType', 'wp_navigation', {
  22217. per_page: -1,
  22218. status: 'publish'
  22219. }];
  22220. function useGenerateDefaultNavigationTitle(clientId) {
  22221. // The block will be disabled in a block preview, use this as a way of
  22222. // avoiding the side-effects of this component for block previews.
  22223. const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context); // Because we can't conditionally call hooks, pass an undefined client id
  22224. // arg to bypass the expensive `useTemplateArea` code. The hook will return
  22225. // early.
  22226. const area = useTemplatePartAreaLabel(isDisabled ? undefined : clientId);
  22227. const registry = (0,external_wp_data_namespaceObject.useRegistry)();
  22228. return (0,external_wp_element_namespaceObject.useCallback)(async () => {
  22229. // Ensure other navigation menus have loaded so an
  22230. // accurate name can be created.
  22231. if (isDisabled) {
  22232. return '';
  22233. }
  22234. const {
  22235. getEntityRecords
  22236. } = registry.resolveSelect(external_wp_coreData_namespaceObject.store);
  22237. const [draftNavigationMenus, navigationMenus] = await Promise.all([getEntityRecords(...DRAFT_MENU_PARAMS), getEntityRecords(...PUBLISHED_MENU_PARAMS)]);
  22238. const title = area ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
  22239. (0,external_wp_i18n_namespaceObject.__)('%s navigation'), area) : // translators: 'navigation' as in website navigation.
  22240. (0,external_wp_i18n_namespaceObject.__)('Navigation'); // Determine how many menus start with the automatic title.
  22241. const matchingMenuTitleCount = [...draftNavigationMenus, ...navigationMenus].reduce((count, menu) => {
  22242. var _menu$title, _menu$title$raw;
  22243. return menu !== null && menu !== void 0 && (_menu$title = menu.title) !== null && _menu$title !== void 0 && (_menu$title$raw = _menu$title.raw) !== null && _menu$title$raw !== void 0 && _menu$title$raw.startsWith(title) ? count + 1 : count;
  22244. }, 0); // Append a number to the end of the title if a menu with
  22245. // the same name exists.
  22246. const titleWithCount = matchingMenuTitleCount > 0 ? `${title} ${matchingMenuTitleCount + 1}` : title;
  22247. return titleWithCount || '';
  22248. }, [isDisabled, area]);
  22249. }
  22250. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-create-navigation-menu.js
  22251. /**
  22252. * WordPress dependencies
  22253. */
  22254. /**
  22255. * Internal dependencies
  22256. */
  22257. const CREATE_NAVIGATION_MENU_SUCCESS = 'success';
  22258. const CREATE_NAVIGATION_MENU_ERROR = 'error';
  22259. const CREATE_NAVIGATION_MENU_PENDING = 'pending';
  22260. const CREATE_NAVIGATION_MENU_IDLE = 'idle';
  22261. function useCreateNavigationMenu(clientId) {
  22262. const [status, setStatus] = (0,external_wp_element_namespaceObject.useState)(CREATE_NAVIGATION_MENU_IDLE);
  22263. const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(null);
  22264. const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null);
  22265. const {
  22266. saveEntityRecord
  22267. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  22268. const generateDefaultTitle = useGenerateDefaultNavigationTitle(clientId); // This callback uses data from the two placeholder steps and only creates
  22269. // a new navigation menu when the user completes the final step.
  22270. const create = (0,external_wp_element_namespaceObject.useCallback)(async function () {
  22271. let title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  22272. let blocks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22273. // Guard against creating Navigations without a title.
  22274. // Note you can pass no title, but if one is passed it must be
  22275. // a string otherwise the title may end up being empty.
  22276. if (title && typeof title !== 'string') {
  22277. setError('Invalid title supplied when creating Navigation Menu.');
  22278. setStatus(CREATE_NAVIGATION_MENU_ERROR);
  22279. throw new Error(`Value of supplied title argument was not a string.`);
  22280. }
  22281. setStatus(CREATE_NAVIGATION_MENU_PENDING);
  22282. setValue(null);
  22283. setError(null);
  22284. if (!title) {
  22285. title = await generateDefaultTitle().catch(err => {
  22286. setError(err === null || err === void 0 ? void 0 : err.message);
  22287. setStatus(CREATE_NAVIGATION_MENU_ERROR);
  22288. throw new Error('Failed to create title when saving new Navigation Menu.', {
  22289. cause: err
  22290. });
  22291. });
  22292. }
  22293. const record = {
  22294. title,
  22295. content: (0,external_wp_blocks_namespaceObject.serialize)(blocks),
  22296. status: 'publish'
  22297. }; // Return affords ability to await on this function directly
  22298. return saveEntityRecord('postType', 'wp_navigation', record).then(response => {
  22299. setValue(response);
  22300. setStatus(CREATE_NAVIGATION_MENU_SUCCESS);
  22301. return response;
  22302. }).catch(err => {
  22303. setError(err === null || err === void 0 ? void 0 : err.message);
  22304. setStatus(CREATE_NAVIGATION_MENU_ERROR);
  22305. throw new Error('Unable to save new Navigation Menu', {
  22306. cause: err
  22307. });
  22308. });
  22309. }, [external_wp_blocks_namespaceObject.serialize, saveEntityRecord]);
  22310. return {
  22311. create,
  22312. status,
  22313. value,
  22314. error
  22315. };
  22316. }
  22317. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/unsaved-inner-blocks.js
  22318. /**
  22319. * External dependencies
  22320. */
  22321. /**
  22322. * WordPress dependencies
  22323. */
  22324. /**
  22325. * Internal dependencies
  22326. */
  22327. const EMPTY_OBJECT = {};
  22328. const unsaved_inner_blocks_DRAFT_MENU_PARAMS = ['postType', 'wp_navigation', {
  22329. status: 'draft',
  22330. per_page: -1
  22331. }];
  22332. const unsaved_inner_blocks_DEFAULT_BLOCK = {
  22333. name: 'core/navigation-link'
  22334. };
  22335. const unsaved_inner_blocks_ALLOWED_BLOCKS = ['core/navigation-link', 'core/search', 'core/social-links', 'core/page-list', 'core/spacer', 'core/home-link', 'core/site-title', 'core/site-logo', 'core/navigation-submenu'];
  22336. function UnsavedInnerBlocks(_ref) {
  22337. let {
  22338. blockProps,
  22339. blocks,
  22340. clientId,
  22341. hasSavedUnsavedInnerBlocks,
  22342. onSave,
  22343. hasSelection
  22344. } = _ref;
  22345. const originalBlocks = (0,external_wp_element_namespaceObject.useRef)();
  22346. (0,external_wp_element_namespaceObject.useEffect)(() => {
  22347. // Initially store the uncontrolled inner blocks for
  22348. // dirty state comparison.
  22349. if (!(originalBlocks !== null && originalBlocks !== void 0 && originalBlocks.current)) {
  22350. originalBlocks.current = blocks;
  22351. }
  22352. }, [blocks]); // If the current inner blocks object is different in any way
  22353. // from the original inner blocks from the post content then the
  22354. // user has made changes to the inner blocks. At this point the inner
  22355. // blocks can be considered "dirty".
  22356. const innerBlocksAreDirty = blocks !== originalBlocks.current;
  22357. const shouldDirectInsert = (0,external_wp_element_namespaceObject.useMemo)(() => blocks.every(_ref2 => {
  22358. let {
  22359. name
  22360. } = _ref2;
  22361. return name === 'core/navigation-link' || name === 'core/navigation-submenu' || name === 'core/page-list';
  22362. }), [blocks]); // The block will be disabled in a block preview, use this as a way of
  22363. // avoiding the side-effects of this component for block previews.
  22364. const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context);
  22365. const savingLock = (0,external_wp_element_namespaceObject.useRef)(false);
  22366. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  22367. renderAppender: hasSelection ? undefined : false,
  22368. allowedBlocks: unsaved_inner_blocks_ALLOWED_BLOCKS,
  22369. __experimentalDefaultBlock: unsaved_inner_blocks_DEFAULT_BLOCK,
  22370. __experimentalDirectInsert: shouldDirectInsert
  22371. });
  22372. const {
  22373. isSaving,
  22374. draftNavigationMenus,
  22375. hasResolvedDraftNavigationMenus
  22376. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  22377. if (isDisabled) {
  22378. return EMPTY_OBJECT;
  22379. }
  22380. const {
  22381. getEntityRecords,
  22382. hasFinishedResolution,
  22383. isSavingEntityRecord
  22384. } = select(external_wp_coreData_namespaceObject.store);
  22385. return {
  22386. isSaving: isSavingEntityRecord('postType', 'wp_navigation'),
  22387. draftNavigationMenus: getEntityRecords(...unsaved_inner_blocks_DRAFT_MENU_PARAMS),
  22388. hasResolvedDraftNavigationMenus: hasFinishedResolution('getEntityRecords', unsaved_inner_blocks_DRAFT_MENU_PARAMS)
  22389. };
  22390. }, [isDisabled]);
  22391. const {
  22392. hasResolvedNavigationMenus,
  22393. navigationMenus
  22394. } = useNavigationMenu();
  22395. const {
  22396. create: createNavigationMenu
  22397. } = useCreateNavigationMenu(clientId); // Automatically save the uncontrolled blocks.
  22398. (0,external_wp_element_namespaceObject.useEffect)(async () => {
  22399. // The block will be disabled when used in a BlockPreview.
  22400. // In this case avoid automatic creation of a wp_navigation post.
  22401. // Otherwise the user will be spammed with lots of menus!
  22402. //
  22403. // Also ensure other navigation menus have loaded so an
  22404. // accurate name can be created.
  22405. //
  22406. // Don't try saving when another save is already
  22407. // in progress.
  22408. //
  22409. // And finally only create the menu when the block is selected,
  22410. // which is an indication they want to start editing.
  22411. if (isDisabled || hasSavedUnsavedInnerBlocks || isSaving || savingLock.current || !hasResolvedDraftNavigationMenus || !hasResolvedNavigationMenus || !hasSelection || !innerBlocksAreDirty) {
  22412. return;
  22413. }
  22414. savingLock.current = true;
  22415. const menu = await createNavigationMenu(null, blocks);
  22416. onSave(menu);
  22417. savingLock.current = false;
  22418. }, [isDisabled, isSaving, hasResolvedDraftNavigationMenus, hasResolvedNavigationMenus, draftNavigationMenus, navigationMenus, hasSelection, createNavigationMenu, blocks]);
  22419. const Wrapper = isSaving ? external_wp_components_namespaceObject.Disabled : 'div';
  22420. return (0,external_wp_element_namespaceObject.createElement)(Wrapper, {
  22421. className: "wp-block-navigation__unsaved-changes"
  22422. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  22423. className: classnames_default()('wp-block-navigation__unsaved-changes-overlay', {
  22424. 'is-saving': isSaving
  22425. })
  22426. }, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)), isSaving && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
  22427. }
  22428. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-delete-control.js
  22429. /**
  22430. * WordPress dependencies
  22431. */
  22432. function NavigationMenuDeleteControl(_ref) {
  22433. let {
  22434. onDelete
  22435. } = _ref;
  22436. const [isConfirmModalVisible, setIsConfirmModalVisible] = (0,external_wp_element_namespaceObject.useState)(false);
  22437. const id = (0,external_wp_coreData_namespaceObject.useEntityId)('postType', 'wp_navigation');
  22438. const [title] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title');
  22439. const {
  22440. deleteEntityRecord
  22441. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  22442. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  22443. className: "wp-block-navigation-delete-menu-button",
  22444. variant: "secondary",
  22445. isDestructive: true,
  22446. onClick: () => {
  22447. setIsConfirmModalVisible(true);
  22448. }
  22449. }, (0,external_wp_i18n_namespaceObject.__)('Delete menu')), isConfirmModalVisible && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
  22450. title: (0,external_wp_i18n_namespaceObject.sprintf)(
  22451. /* translators: %s: the name of a menu to delete */
  22452. (0,external_wp_i18n_namespaceObject.__)('Delete %s'), title),
  22453. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
  22454. onRequestClose: () => setIsConfirmModalVisible(false)
  22455. }, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete this navigation menu?')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
  22456. justify: "flex-end"
  22457. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  22458. variant: "secondary",
  22459. onClick: () => {
  22460. setIsConfirmModalVisible(false);
  22461. }
  22462. }, (0,external_wp_i18n_namespaceObject.__)('Cancel'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  22463. variant: "primary",
  22464. onClick: () => {
  22465. deleteEntityRecord('postType', 'wp_navigation', id, {
  22466. force: true
  22467. });
  22468. onDelete(title);
  22469. }
  22470. }, (0,external_wp_i18n_namespaceObject.__)('Confirm'))))));
  22471. }
  22472. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-navigation-notice.js
  22473. /**
  22474. * WordPress dependencies
  22475. */
  22476. function useNavigationNotice() {
  22477. let {
  22478. name,
  22479. message = ''
  22480. } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  22481. const noticeRef = (0,external_wp_element_namespaceObject.useRef)();
  22482. const {
  22483. createWarningNotice,
  22484. removeNotice
  22485. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  22486. const showNotice = customMsg => {
  22487. if (noticeRef.current) {
  22488. return;
  22489. }
  22490. noticeRef.current = name;
  22491. createWarningNotice(customMsg || message, {
  22492. id: noticeRef.current,
  22493. type: 'snackbar'
  22494. });
  22495. };
  22496. const hideNotice = () => {
  22497. if (!noticeRef.current) {
  22498. return;
  22499. }
  22500. removeNotice(noticeRef.current);
  22501. noticeRef.current = null;
  22502. };
  22503. return [showNotice, hideNotice];
  22504. }
  22505. /* harmony default export */ var use_navigation_notice = (useNavigationNotice);
  22506. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/menu-items-to-blocks.js
  22507. /**
  22508. * External dependencies
  22509. */
  22510. /**
  22511. * WordPress dependencies
  22512. */
  22513. /**
  22514. * Convert a flat menu item structure to a nested blocks structure.
  22515. *
  22516. * @param {Object[]} menuItems An array of menu items.
  22517. *
  22518. * @return {WPBlock[]} An array of blocks.
  22519. */
  22520. function menuItemsToBlocks(menuItems) {
  22521. if (!menuItems) {
  22522. return null;
  22523. }
  22524. const menuTree = createDataTree(menuItems);
  22525. const blocks = mapMenuItemsToBlocks(menuTree);
  22526. return (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.navigation.__unstableMenuItemsToBlocks', blocks, menuItems);
  22527. }
  22528. /**
  22529. * A recursive function that maps menu item nodes to blocks.
  22530. *
  22531. * @param {WPNavMenuItem[]} menuItems An array of WPNavMenuItem items.
  22532. * @return {Object} Object containing innerBlocks and mapping.
  22533. */
  22534. function mapMenuItemsToBlocks(menuItems) {
  22535. let mapping = {}; // The menuItem should be in menu_order sort order.
  22536. const sortedItems = (0,external_lodash_namespaceObject.sortBy)(menuItems, 'menu_order');
  22537. const innerBlocks = sortedItems.map(menuItem => {
  22538. var _menuItem$children, _menuItem$children2;
  22539. if (menuItem.type === 'block') {
  22540. const [block] = (0,external_wp_blocks_namespaceObject.parse)(menuItem.content.raw);
  22541. if (!block) {
  22542. return (0,external_wp_blocks_namespaceObject.createBlock)('core/freeform', {
  22543. content: menuItem.content
  22544. });
  22545. }
  22546. return block;
  22547. }
  22548. const attributes = menuItemToBlockAttributes(menuItem); // If there are children recurse to build those nested blocks.
  22549. const {
  22550. innerBlocks: nestedBlocks = [],
  22551. // alias to avoid shadowing
  22552. mapping: nestedMapping = {} // alias to avoid shadowing
  22553. } = (_menuItem$children = menuItem.children) !== null && _menuItem$children !== void 0 && _menuItem$children.length ? mapMenuItemsToBlocks(menuItem.children) : {}; // Update parent mapping with nested mapping.
  22554. mapping = { ...mapping,
  22555. ...nestedMapping
  22556. };
  22557. const blockType = (_menuItem$children2 = menuItem.children) !== null && _menuItem$children2 !== void 0 && _menuItem$children2.length ? 'core/navigation-submenu' : 'core/navigation-link'; // Create block with nested "innerBlocks".
  22558. const block = (0,external_wp_blocks_namespaceObject.createBlock)(blockType, attributes, nestedBlocks); // Create mapping for menuItem -> block.
  22559. mapping[menuItem.id] = block.clientId;
  22560. return block;
  22561. });
  22562. return {
  22563. innerBlocks,
  22564. mapping
  22565. };
  22566. }
  22567. /**
  22568. * A WP nav_menu_item object.
  22569. * For more documentation on the individual fields present on a menu item please see:
  22570. * https://core.trac.wordpress.org/browser/tags/5.7.1/src/wp-includes/nav-menu.php#L789
  22571. *
  22572. * Changes made here should also be mirrored in packages/edit-navigation/src/store/utils.js.
  22573. *
  22574. * @typedef WPNavMenuItem
  22575. *
  22576. * @property {Object} title stores the raw and rendered versions of the title/label for this menu item.
  22577. * @property {Array} xfn the XFN relationships expressed in the link of this menu item.
  22578. * @property {Array} classes the HTML class attributes for this menu item.
  22579. * @property {string} attr_title the HTML title attribute for this menu item.
  22580. * @property {string} object The type of object originally represented, such as 'category', 'post', or 'attachment'.
  22581. * @property {string} object_id The DB ID of the original object this menu item represents, e.g. ID for posts and term_id for categories.
  22582. * @property {string} description The description of this menu item.
  22583. * @property {string} url The URL to which this menu item points.
  22584. * @property {string} type The family of objects originally represented, such as 'post_type' or 'taxonomy'.
  22585. * @property {string} target The target attribute of the link element for this menu item.
  22586. */
  22587. /**
  22588. * Convert block attributes to menu item.
  22589. *
  22590. * @param {WPNavMenuItem} menuItem the menu item to be converted to block attributes.
  22591. * @return {Object} the block attributes converted from the WPNavMenuItem item.
  22592. */
  22593. function menuItemToBlockAttributes(_ref) {
  22594. var _object;
  22595. let {
  22596. title: menuItemTitleField,
  22597. xfn,
  22598. classes,
  22599. // eslint-disable-next-line camelcase
  22600. attr_title,
  22601. object,
  22602. // eslint-disable-next-line camelcase
  22603. object_id,
  22604. description,
  22605. url,
  22606. type: menuItemTypeField,
  22607. target
  22608. } = _ref;
  22609. // For historical reasons, the `core/navigation-link` variation type is `tag`
  22610. // whereas WP Core expects `post_tag` as the `object` type.
  22611. // To avoid writing a block migration we perform a conversion here.
  22612. // See also inverse equivalent in `blockAttributesToMenuItem`.
  22613. if (object && object === 'post_tag') {
  22614. object = 'tag';
  22615. }
  22616. return {
  22617. label: (menuItemTitleField === null || menuItemTitleField === void 0 ? void 0 : menuItemTitleField.rendered) || '',
  22618. ...(((_object = object) === null || _object === void 0 ? void 0 : _object.length) && {
  22619. type: object
  22620. }),
  22621. kind: (menuItemTypeField === null || menuItemTypeField === void 0 ? void 0 : menuItemTypeField.replace('_', '-')) || 'custom',
  22622. url: url || '',
  22623. ...((xfn === null || xfn === void 0 ? void 0 : xfn.length) && xfn.join(' ').trim() && {
  22624. rel: xfn.join(' ').trim()
  22625. }),
  22626. ...((classes === null || classes === void 0 ? void 0 : classes.length) && classes.join(' ').trim() && {
  22627. className: classes.join(' ').trim()
  22628. }),
  22629. /* eslint-disable camelcase */
  22630. ...((attr_title === null || attr_title === void 0 ? void 0 : attr_title.length) && {
  22631. title: attr_title
  22632. }),
  22633. ...(object_id && 'custom' !== object && {
  22634. id: object_id
  22635. }),
  22636. /* eslint-enable camelcase */
  22637. ...((description === null || description === void 0 ? void 0 : description.length) && {
  22638. description
  22639. }),
  22640. ...(target === '_blank' && {
  22641. opensInNewTab: true
  22642. })
  22643. };
  22644. }
  22645. /**
  22646. * Creates a nested, hierarchical tree representation from unstructured data that
  22647. * has an inherent relationship defined between individual items.
  22648. *
  22649. * For example, by default, each element in the dataset should have an `id` and
  22650. * `parent` property where the `parent` property indicates a relationship between
  22651. * the current item and another item with a matching `id` properties.
  22652. *
  22653. * This is useful for building linked lists of data from flat data structures.
  22654. *
  22655. * @param {Array} dataset linked data to be rearranged into a hierarchical tree based on relational fields.
  22656. * @param {string} id the property which uniquely identifies each entry within the array.
  22657. * @param {*} relation the property which identifies how the current item is related to other items in the data (if at all).
  22658. * @return {Array} a nested array of parent/child relationships
  22659. */
  22660. function createDataTree(dataset) {
  22661. let id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';
  22662. let relation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'parent';
  22663. const hashTable = Object.create(null);
  22664. const dataTree = [];
  22665. for (const data of dataset) {
  22666. hashTable[data[id]] = { ...data,
  22667. children: []
  22668. };
  22669. if (data[relation]) {
  22670. hashTable[data[relation]] = hashTable[data[relation]] || {};
  22671. hashTable[data[relation]].children = hashTable[data[relation]].children || [];
  22672. hashTable[data[relation]].children.push(hashTable[data[id]]);
  22673. } else {
  22674. dataTree.push(hashTable[data[id]]);
  22675. }
  22676. }
  22677. return dataTree;
  22678. }
  22679. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js
  22680. /**
  22681. * WordPress dependencies
  22682. */
  22683. /**
  22684. * Internal dependencies
  22685. */
  22686. const CLASSIC_MENU_CONVERSION_SUCCESS = 'success';
  22687. const CLASSIC_MENU_CONVERSION_ERROR = 'error';
  22688. const CLASSIC_MENU_CONVERSION_PENDING = 'pending';
  22689. const CLASSIC_MENU_CONVERSION_IDLE = 'idle';
  22690. function useConvertClassicToBlockMenu(clientId) {
  22691. const {
  22692. create: createNavigationMenu
  22693. } = useCreateNavigationMenu(clientId);
  22694. const registry = (0,external_wp_data_namespaceObject.useRegistry)();
  22695. const [status, setStatus] = (0,external_wp_element_namespaceObject.useState)(CLASSIC_MENU_CONVERSION_IDLE);
  22696. const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(null);
  22697. const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null);
  22698. async function convertClassicMenuToBlockMenu(menuId, menuName) {
  22699. let navigationMenu;
  22700. let classicMenuItems; // 1. Fetch the classic Menu items.
  22701. try {
  22702. classicMenuItems = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getMenuItems({
  22703. menus: menuId,
  22704. per_page: -1,
  22705. context: 'view'
  22706. });
  22707. } catch (err) {
  22708. throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
  22709. (0,external_wp_i18n_namespaceObject.__)(`Unable to fetch classic menu "%s" from API.`), menuName), {
  22710. cause: err
  22711. });
  22712. } // Handle offline response which resolves to `null`.
  22713. if (classicMenuItems === null) {
  22714. throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
  22715. (0,external_wp_i18n_namespaceObject.__)(`Unable to fetch classic menu "%s" from API.`), menuName));
  22716. } // 2. Convert the classic items into blocks.
  22717. const {
  22718. innerBlocks
  22719. } = menuItemsToBlocks(classicMenuItems); // 3. Create the `wp_navigation` Post with the blocks.
  22720. try {
  22721. navigationMenu = await createNavigationMenu(menuName, innerBlocks);
  22722. } catch (err) {
  22723. throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
  22724. (0,external_wp_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), {
  22725. cause: err
  22726. });
  22727. }
  22728. return navigationMenu;
  22729. }
  22730. const convert = (0,external_wp_element_namespaceObject.useCallback)((menuId, menuName) => {
  22731. if (!menuId || !menuName) {
  22732. setError('Unable to convert menu. Missing menu details.');
  22733. setStatus(CLASSIC_MENU_CONVERSION_ERROR);
  22734. return;
  22735. }
  22736. setStatus(CLASSIC_MENU_CONVERSION_PENDING);
  22737. setValue(null);
  22738. setError(null);
  22739. convertClassicMenuToBlockMenu(menuId, menuName).then(navMenu => {
  22740. setValue(navMenu);
  22741. setStatus(CLASSIC_MENU_CONVERSION_SUCCESS);
  22742. }).catch(err => {
  22743. setError(err === null || err === void 0 ? void 0 : err.message);
  22744. setStatus(CLASSIC_MENU_CONVERSION_ERROR); // Rethrow error for debugging.
  22745. throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
  22746. (0,external_wp_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), {
  22747. cause: err
  22748. });
  22749. });
  22750. }, [clientId]);
  22751. return {
  22752. convert,
  22753. status,
  22754. value,
  22755. error
  22756. };
  22757. }
  22758. /* harmony default export */ var use_convert_classic_menu_to_block_menu = (useConvertClassicToBlockMenu);
  22759. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/index.js
  22760. /**
  22761. * External dependencies
  22762. */
  22763. /**
  22764. * WordPress dependencies
  22765. */
  22766. /**
  22767. * Internal dependencies
  22768. */
  22769. const EMPTY_ARRAY = [];
  22770. function getComputedStyle(node) {
  22771. return node.ownerDocument.defaultView.getComputedStyle(node);
  22772. }
  22773. function detectColors(colorsDetectionElement, setColor, setBackground) {
  22774. if (!colorsDetectionElement) {
  22775. return;
  22776. }
  22777. setColor(getComputedStyle(colorsDetectionElement).color);
  22778. let backgroundColorNode = colorsDetectionElement;
  22779. let backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor;
  22780. while (backgroundColor === 'rgba(0, 0, 0, 0)' && backgroundColorNode.parentNode && backgroundColorNode.parentNode.nodeType === backgroundColorNode.parentNode.ELEMENT_NODE) {
  22781. backgroundColorNode = backgroundColorNode.parentNode;
  22782. backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor;
  22783. }
  22784. setBackground(backgroundColor);
  22785. }
  22786. function Navigation(_ref) {
  22787. var _attributes$style, _attributes$style$typ;
  22788. let {
  22789. attributes,
  22790. setAttributes,
  22791. clientId,
  22792. isSelected,
  22793. className,
  22794. backgroundColor,
  22795. setBackgroundColor,
  22796. textColor,
  22797. setTextColor,
  22798. overlayBackgroundColor,
  22799. setOverlayBackgroundColor,
  22800. overlayTextColor,
  22801. setOverlayTextColor,
  22802. // These props are used by the navigation editor to override specific
  22803. // navigation block settings.
  22804. hasSubmenuIndicatorSetting = true,
  22805. hasColorSettings = true,
  22806. customPlaceholder: CustomPlaceholder = null
  22807. } = _ref;
  22808. const {
  22809. openSubmenusOnClick,
  22810. overlayMenu,
  22811. showSubmenuIcon,
  22812. layout: {
  22813. justifyContent,
  22814. orientation = 'horizontal',
  22815. flexWrap = 'wrap'
  22816. } = {},
  22817. hasIcon
  22818. } = attributes;
  22819. const ref = attributes.ref;
  22820. const registry = (0,external_wp_data_namespaceObject.useRegistry)();
  22821. const setRef = postId => {
  22822. setAttributes({
  22823. ref: postId
  22824. });
  22825. };
  22826. const [hasAlreadyRendered, RecursionProvider] = (0,external_wp_blockEditor_namespaceObject.__experimentalUseNoRecursiveRenders)(`navigationMenu/${ref}`); // Preload classic menus, so that they don't suddenly pop-in when viewing
  22827. // the Select Menu dropdown.
  22828. useNavigationEntities();
  22829. const [showNavigationMenuDeleteNotice] = use_navigation_notice({
  22830. name: 'block-library/core/navigation/delete'
  22831. });
  22832. const [showNavigationMenuCreateNotice, hideNavigationMenuCreateNotice] = use_navigation_notice({
  22833. name: 'block-library/core/navigation/create'
  22834. });
  22835. const {
  22836. create: createNavigationMenu,
  22837. status: createNavigationMenuStatus,
  22838. error: createNavigationMenuError,
  22839. value: createNavigationMenuPost
  22840. } = useCreateNavigationMenu(clientId);
  22841. const isCreatingNavigationMenu = createNavigationMenuStatus === CREATE_NAVIGATION_MENU_PENDING;
  22842. (0,external_wp_element_namespaceObject.useEffect)(() => {
  22843. hideNavigationMenuCreateNotice();
  22844. if (createNavigationMenuStatus === CREATE_NAVIGATION_MENU_PENDING) {
  22845. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)(`Creating Navigation Menu.`));
  22846. }
  22847. if (createNavigationMenuStatus === CREATE_NAVIGATION_MENU_SUCCESS) {
  22848. setRef(createNavigationMenuPost.id);
  22849. selectBlock(clientId);
  22850. showNavigationMenuCreateNotice((0,external_wp_i18n_namespaceObject.__)(`Navigation Menu successfully created.`));
  22851. }
  22852. if (createNavigationMenuStatus === CREATE_NAVIGATION_MENU_ERROR) {
  22853. showNavigationMenuCreateNotice((0,external_wp_i18n_namespaceObject.__)('Failed to create Navigation Menu.'));
  22854. }
  22855. }, [createNavigationMenu, createNavigationMenuStatus, createNavigationMenuError, createNavigationMenuPost]);
  22856. const {
  22857. hasUncontrolledInnerBlocks,
  22858. uncontrolledInnerBlocks,
  22859. isInnerBlockSelected,
  22860. hasSubmenus
  22861. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  22862. const {
  22863. getBlock,
  22864. getBlocks,
  22865. hasSelectedInnerBlock
  22866. } = select(external_wp_blockEditor_namespaceObject.store); // This relies on the fact that `getBlock` won't return controlled
  22867. // inner blocks, while `getBlocks` does. It might be more stable to
  22868. // introduce a selector like `getUncontrolledInnerBlocks`, just in
  22869. // case `getBlock` is fixed.
  22870. const _uncontrolledInnerBlocks = getBlock(clientId).innerBlocks;
  22871. const _hasUncontrolledInnerBlocks = !!(_uncontrolledInnerBlocks !== null && _uncontrolledInnerBlocks !== void 0 && _uncontrolledInnerBlocks.length);
  22872. const _controlledInnerBlocks = _hasUncontrolledInnerBlocks ? EMPTY_ARRAY : getBlocks(clientId);
  22873. const innerBlocks = _hasUncontrolledInnerBlocks ? _uncontrolledInnerBlocks : _controlledInnerBlocks;
  22874. return {
  22875. hasSubmenus: !!innerBlocks.find(block => block.name === 'core/navigation-submenu'),
  22876. hasUncontrolledInnerBlocks: _hasUncontrolledInnerBlocks,
  22877. uncontrolledInnerBlocks: _uncontrolledInnerBlocks,
  22878. isInnerBlockSelected: hasSelectedInnerBlock(clientId, true)
  22879. };
  22880. }, [clientId]);
  22881. const {
  22882. replaceInnerBlocks,
  22883. selectBlock,
  22884. __unstableMarkNextChangeAsNotPersistent
  22885. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  22886. const [hasSavedUnsavedInnerBlocks, setHasSavedUnsavedInnerBlocks] = (0,external_wp_element_namespaceObject.useState)(false);
  22887. const [isResponsiveMenuOpen, setResponsiveMenuVisibility] = (0,external_wp_element_namespaceObject.useState)(false);
  22888. const [overlayMenuPreview, setOverlayMenuPreview] = (0,external_wp_element_namespaceObject.useState)(false);
  22889. const {
  22890. hasResolvedNavigationMenus,
  22891. isNavigationMenuResolved,
  22892. isNavigationMenuMissing,
  22893. navigationMenus,
  22894. navigationMenu,
  22895. canUserUpdateNavigationMenu,
  22896. hasResolvedCanUserUpdateNavigationMenu,
  22897. canUserDeleteNavigationMenu,
  22898. hasResolvedCanUserDeleteNavigationMenu,
  22899. canUserCreateNavigationMenu,
  22900. isResolvingCanUserCreateNavigationMenu,
  22901. hasResolvedCanUserCreateNavigationMenu
  22902. } = useNavigationMenu(ref); // Attempt to retrieve and prioritize any existing navigation menu unless
  22903. // a specific ref is allocated or the user is explicitly creating a new menu. The aim is
  22904. // for the block to "just work" from a user perspective using existing data.
  22905. (0,external_wp_element_namespaceObject.useEffect)(() => {
  22906. if (isCreatingNavigationMenu || ref || !(navigationMenus !== null && navigationMenus !== void 0 && navigationMenus.length) || (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.length) > 1) {
  22907. return;
  22908. }
  22909. setRef(navigationMenus[0].id);
  22910. }, [navigationMenus]);
  22911. const navRef = (0,external_wp_element_namespaceObject.useRef)();
  22912. const isDraftNavigationMenu = (navigationMenu === null || navigationMenu === void 0 ? void 0 : navigationMenu.status) === 'draft';
  22913. const {
  22914. convert,
  22915. status: classicMenuConversionStatus,
  22916. error: classicMenuConversionError,
  22917. value: classicMenuConversionResult
  22918. } = use_convert_classic_menu_to_block_menu(clientId);
  22919. const isConvertingClassicMenu = classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_PENDING; // The standard HTML5 tag for the block wrapper.
  22920. const TagName = 'nav'; // "placeholder" shown if:
  22921. // - there is no ref attribute pointing to a Navigation Post.
  22922. // - there is no classic menu conversion process in progress.
  22923. // - there is no menu creation process in progress.
  22924. // - there are no uncontrolled blocks.
  22925. const isPlaceholder = !ref && !isCreatingNavigationMenu && !isConvertingClassicMenu && hasResolvedNavigationMenus && !hasUncontrolledInnerBlocks;
  22926. const isEntityAvailable = !isNavigationMenuMissing && isNavigationMenuResolved; // "loading" state:
  22927. // - there is a menu creation process in progress.
  22928. // - there is a classic menu conversion process in progress.
  22929. // OR
  22930. // - there is a ref attribute pointing to a Navigation Post
  22931. // - the Navigation Post isn't available (hasn't resolved) yet.
  22932. const isLoading = !hasResolvedNavigationMenus || isCreatingNavigationMenu || isConvertingClassicMenu || !!(ref && !isEntityAvailable && !isConvertingClassicMenu);
  22933. const textDecoration = (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : (_attributes$style$typ = _attributes$style.typography) === null || _attributes$style$typ === void 0 ? void 0 : _attributes$style$typ.textDecoration;
  22934. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  22935. ref: navRef,
  22936. className: classnames_default()(className, {
  22937. 'items-justified-right': justifyContent === 'right',
  22938. 'items-justified-space-between': justifyContent === 'space-between',
  22939. 'items-justified-left': justifyContent === 'left',
  22940. 'items-justified-center': justifyContent === 'center',
  22941. 'is-vertical': orientation === 'vertical',
  22942. 'no-wrap': flexWrap === 'nowrap',
  22943. 'is-responsive': 'never' !== overlayMenu,
  22944. 'has-text-color': !!textColor.color || !!(textColor !== null && textColor !== void 0 && textColor.class),
  22945. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor === null || textColor === void 0 ? void 0 : textColor.slug)]: !!(textColor !== null && textColor !== void 0 && textColor.slug),
  22946. 'has-background': !!backgroundColor.color || backgroundColor.class,
  22947. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor === null || backgroundColor === void 0 ? void 0 : backgroundColor.slug)]: !!(backgroundColor !== null && backgroundColor !== void 0 && backgroundColor.slug),
  22948. [`has-text-decoration-${textDecoration}`]: textDecoration
  22949. }),
  22950. style: {
  22951. color: !(textColor !== null && textColor !== void 0 && textColor.slug) && (textColor === null || textColor === void 0 ? void 0 : textColor.color),
  22952. backgroundColor: !(backgroundColor !== null && backgroundColor !== void 0 && backgroundColor.slug) && (backgroundColor === null || backgroundColor === void 0 ? void 0 : backgroundColor.color)
  22953. }
  22954. });
  22955. const overlayClassnames = classnames_default()({
  22956. 'has-text-color': !!overlayTextColor.color || !!(overlayTextColor !== null && overlayTextColor !== void 0 && overlayTextColor.class),
  22957. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', overlayTextColor === null || overlayTextColor === void 0 ? void 0 : overlayTextColor.slug)]: !!(overlayTextColor !== null && overlayTextColor !== void 0 && overlayTextColor.slug),
  22958. 'has-background': !!overlayBackgroundColor.color || (overlayBackgroundColor === null || overlayBackgroundColor === void 0 ? void 0 : overlayBackgroundColor.class),
  22959. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayBackgroundColor === null || overlayBackgroundColor === void 0 ? void 0 : overlayBackgroundColor.slug)]: !!(overlayBackgroundColor !== null && overlayBackgroundColor !== void 0 && overlayBackgroundColor.slug)
  22960. });
  22961. const overlayStyles = {
  22962. color: !(overlayTextColor !== null && overlayTextColor !== void 0 && overlayTextColor.slug) && (overlayTextColor === null || overlayTextColor === void 0 ? void 0 : overlayTextColor.color),
  22963. backgroundColor: !(overlayBackgroundColor !== null && overlayBackgroundColor !== void 0 && overlayBackgroundColor.slug) && (overlayBackgroundColor === null || overlayBackgroundColor === void 0 ? void 0 : overlayBackgroundColor.color) && overlayBackgroundColor.color
  22964. }; // Turn on contrast checker for web only since it's not supported on mobile yet.
  22965. const enableContrastChecking = external_wp_element_namespaceObject.Platform.OS === 'web';
  22966. const [detectedBackgroundColor, setDetectedBackgroundColor] = (0,external_wp_element_namespaceObject.useState)();
  22967. const [detectedColor, setDetectedColor] = (0,external_wp_element_namespaceObject.useState)();
  22968. const [detectedOverlayBackgroundColor, setDetectedOverlayBackgroundColor] = (0,external_wp_element_namespaceObject.useState)();
  22969. const [detectedOverlayColor, setDetectedOverlayColor] = (0,external_wp_element_namespaceObject.useState)();
  22970. const [showClassicMenuConversionErrorNotice, hideClassicMenuConversionErrorNotice] = use_navigation_notice({
  22971. name: 'block-library/core/navigation/classic-menu-conversion/error'
  22972. });
  22973. function handleUpdateMenu(menuId) {
  22974. setRef(menuId);
  22975. selectBlock(clientId);
  22976. }
  22977. (0,external_wp_element_namespaceObject.useEffect)(() => {
  22978. if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_PENDING) {
  22979. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Classic menu importing.'));
  22980. }
  22981. if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_SUCCESS && classicMenuConversionResult) {
  22982. handleUpdateMenu(classicMenuConversionResult === null || classicMenuConversionResult === void 0 ? void 0 : classicMenuConversionResult.id);
  22983. hideClassicMenuConversionErrorNotice();
  22984. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Classic menu imported successfully.'));
  22985. }
  22986. if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_ERROR) {
  22987. showClassicMenuConversionErrorNotice(classicMenuConversionError);
  22988. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Classic menu import failed.'));
  22989. }
  22990. }, [classicMenuConversionStatus, classicMenuConversionResult, classicMenuConversionError]); // Spacer block needs orientation from context. This is a patch until
  22991. // https://github.com/WordPress/gutenberg/issues/36197 is addressed.
  22992. (0,external_wp_element_namespaceObject.useEffect)(() => {
  22993. if (orientation) {
  22994. __unstableMarkNextChangeAsNotPersistent();
  22995. setAttributes({
  22996. orientation
  22997. });
  22998. }
  22999. }, [orientation]);
  23000. (0,external_wp_element_namespaceObject.useEffect)(() => {
  23001. var _navRef$current;
  23002. if (!enableContrastChecking) {
  23003. return;
  23004. }
  23005. detectColors(navRef.current, setDetectedColor, setDetectedBackgroundColor);
  23006. const subMenuElement = (_navRef$current = navRef.current) === null || _navRef$current === void 0 ? void 0 : _navRef$current.querySelector('[data-type="core/navigation-link"] [data-type="core/navigation-link"]');
  23007. if (subMenuElement) {
  23008. detectColors(subMenuElement, setDetectedOverlayColor, setDetectedOverlayBackgroundColor);
  23009. }
  23010. });
  23011. const [showCantEditNotice, hideCantEditNotice] = use_navigation_notice({
  23012. name: 'block-library/core/navigation/permissions/update',
  23013. message: (0,external_wp_i18n_namespaceObject.__)('You do not have permission to edit this Menu. Any changes made will not be saved.')
  23014. });
  23015. const [showCantCreateNotice, hideCantCreateNotice] = use_navigation_notice({
  23016. name: 'block-library/core/navigation/permissions/create',
  23017. message: (0,external_wp_i18n_namespaceObject.__)('You do not have permission to create Navigation Menus.')
  23018. });
  23019. (0,external_wp_element_namespaceObject.useEffect)(() => {
  23020. if (!isSelected && !isInnerBlockSelected) {
  23021. hideCantEditNotice();
  23022. hideCantCreateNotice();
  23023. }
  23024. if (isSelected || isInnerBlockSelected) {
  23025. if (hasResolvedCanUserUpdateNavigationMenu && !canUserUpdateNavigationMenu) {
  23026. showCantEditNotice();
  23027. }
  23028. if (!ref && hasResolvedCanUserCreateNavigationMenu && !canUserCreateNavigationMenu) {
  23029. showCantCreateNotice();
  23030. }
  23031. }
  23032. }, [isSelected, isInnerBlockSelected, canUserUpdateNavigationMenu, hasResolvedCanUserUpdateNavigationMenu, canUserCreateNavigationMenu, hasResolvedCanUserCreateNavigationMenu, ref]);
  23033. const navigationSelectorRef = (0,external_wp_element_namespaceObject.useRef)();
  23034. const [shouldFocusNavigationSelector, setShouldFocusNavigationSelector] = (0,external_wp_element_namespaceObject.useState)(false);
  23035. const handleSelectNavigation = (0,external_wp_element_namespaceObject.useCallback)(navPostOrClassicMenu => {
  23036. if (!navPostOrClassicMenu) {
  23037. return;
  23038. }
  23039. const isClassicMenu = navPostOrClassicMenu.hasOwnProperty('auto_add');
  23040. if (isClassicMenu) {
  23041. convert(navPostOrClassicMenu.id, navPostOrClassicMenu.name);
  23042. } else {
  23043. handleUpdateMenu(navPostOrClassicMenu.id);
  23044. }
  23045. setShouldFocusNavigationSelector(true);
  23046. }, [convert, handleUpdateMenu]); // Focus support after menu selection.
  23047. (0,external_wp_element_namespaceObject.useEffect)(() => {
  23048. var _navigationSelectorRe;
  23049. if (isDraftNavigationMenu || !isEntityAvailable || !shouldFocusNavigationSelector) {
  23050. return;
  23051. }
  23052. navigationSelectorRef === null || navigationSelectorRef === void 0 ? void 0 : (_navigationSelectorRe = navigationSelectorRef.current) === null || _navigationSelectorRe === void 0 ? void 0 : _navigationSelectorRe.focus();
  23053. setShouldFocusNavigationSelector(false);
  23054. }, [isDraftNavigationMenu, isEntityAvailable, shouldFocusNavigationSelector]);
  23055. const resetToEmptyBlock = (0,external_wp_element_namespaceObject.useCallback)(() => {
  23056. registry.batch(() => {
  23057. setAttributes({
  23058. ref: undefined
  23059. });
  23060. if (!ref) {
  23061. replaceInnerBlocks(clientId, []);
  23062. }
  23063. });
  23064. }, [clientId, ref]);
  23065. const isResponsive = 'never' !== overlayMenu;
  23066. const overlayMenuPreviewClasses = classnames_default()('wp-block-navigation__overlay-menu-preview', {
  23067. open: overlayMenuPreview
  23068. });
  23069. const stylingInspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, hasSubmenuIndicatorSetting && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  23070. title: (0,external_wp_i18n_namespaceObject.__)('Display')
  23071. }, isResponsive && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  23072. className: overlayMenuPreviewClasses,
  23073. onClick: () => {
  23074. setOverlayMenuPreview(!overlayMenuPreview);
  23075. }
  23076. }, hasIcon && (0,external_wp_element_namespaceObject.createElement)(OverlayMenuIcon, null), !hasIcon && (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Menu'))), overlayMenuPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  23077. label: (0,external_wp_i18n_namespaceObject.__)('Show icon button'),
  23078. help: (0,external_wp_i18n_namespaceObject.__)('Configure the visual appearance of the button opening the overlay menu.'),
  23079. onChange: value => setAttributes({
  23080. hasIcon: value
  23081. }),
  23082. checked: hasIcon
  23083. }), (0,external_wp_element_namespaceObject.createElement)("h3", null, (0,external_wp_i18n_namespaceObject.__)('Overlay Menu')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
  23084. label: (0,external_wp_i18n_namespaceObject.__)('Configure overlay menu'),
  23085. value: overlayMenu,
  23086. help: (0,external_wp_i18n_namespaceObject.__)('Collapses the navigation options in a menu icon opening an overlay.'),
  23087. onChange: value => setAttributes({
  23088. overlayMenu: value
  23089. }),
  23090. isBlock: true,
  23091. hideLabelFromVision: true
  23092. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  23093. value: "never",
  23094. label: (0,external_wp_i18n_namespaceObject.__)('Off')
  23095. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  23096. value: "mobile",
  23097. label: (0,external_wp_i18n_namespaceObject.__)('Mobile')
  23098. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  23099. value: "always",
  23100. label: (0,external_wp_i18n_namespaceObject.__)('Always')
  23101. })), hasSubmenus && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("h3", null, (0,external_wp_i18n_namespaceObject.__)('Submenus')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  23102. checked: openSubmenusOnClick,
  23103. onChange: value => {
  23104. setAttributes({
  23105. openSubmenusOnClick: value,
  23106. ...(value && {
  23107. showSubmenuIcon: true
  23108. }) // Make sure arrows are shown when we toggle this on.
  23109. });
  23110. },
  23111. label: (0,external_wp_i18n_namespaceObject.__)('Open on click')
  23112. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  23113. checked: showSubmenuIcon,
  23114. onChange: value => {
  23115. setAttributes({
  23116. showSubmenuIcon: value
  23117. });
  23118. },
  23119. disabled: attributes.openSubmenusOnClick,
  23120. label: (0,external_wp_i18n_namespaceObject.__)('Show arrow')
  23121. }))), hasColorSettings && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PanelColorSettings, {
  23122. __experimentalHasMultipleOrigins: true,
  23123. __experimentalIsRenderedInSidebar: true,
  23124. title: (0,external_wp_i18n_namespaceObject.__)('Color'),
  23125. initialOpen: false,
  23126. colorSettings: [{
  23127. value: textColor.color,
  23128. onChange: setTextColor,
  23129. label: (0,external_wp_i18n_namespaceObject.__)('Text')
  23130. }, {
  23131. value: backgroundColor.color,
  23132. onChange: setBackgroundColor,
  23133. label: (0,external_wp_i18n_namespaceObject.__)('Background')
  23134. }, {
  23135. value: overlayTextColor.color,
  23136. onChange: setOverlayTextColor,
  23137. label: (0,external_wp_i18n_namespaceObject.__)('Submenu & overlay text')
  23138. }, {
  23139. value: overlayBackgroundColor.color,
  23140. onChange: setOverlayBackgroundColor,
  23141. label: (0,external_wp_i18n_namespaceObject.__)('Submenu & overlay background')
  23142. }]
  23143. }, enableContrastChecking && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ContrastChecker, {
  23144. backgroundColor: detectedBackgroundColor,
  23145. textColor: detectedColor
  23146. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ContrastChecker, {
  23147. backgroundColor: detectedOverlayBackgroundColor,
  23148. textColor: detectedOverlayColor
  23149. })))); // If the block has inner blocks, but no menu id, then these blocks are either:
  23150. // - inserted via a pattern.
  23151. // - inserted directly via Code View (or otherwise).
  23152. // - from an older version of navigation block added before the block used a wp_navigation entity.
  23153. // Consider this state as 'unsaved' and offer an uncontrolled version of inner blocks,
  23154. // that automatically saves the menu as an entity when changes are made to the inner blocks.
  23155. const hasUnsavedBlocks = hasUncontrolledInnerBlocks && !isEntityAvailable;
  23156. if (hasUnsavedBlocks) {
  23157. return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, stylingInspectorControls, (0,external_wp_element_namespaceObject.createElement)(ResponsiveWrapper, {
  23158. id: clientId,
  23159. onToggle: setResponsiveMenuVisibility,
  23160. isOpen: isResponsiveMenuOpen,
  23161. isResponsive: 'never' !== overlayMenu,
  23162. isHiddenByDefault: 'always' === overlayMenu,
  23163. classNames: overlayClassnames,
  23164. styles: overlayStyles
  23165. }, (0,external_wp_element_namespaceObject.createElement)(UnsavedInnerBlocks, {
  23166. blockProps: blockProps,
  23167. blocks: uncontrolledInnerBlocks,
  23168. clientId: clientId,
  23169. navigationMenus: navigationMenus,
  23170. hasSelection: isSelected || isInnerBlockSelected,
  23171. hasSavedUnsavedInnerBlocks: hasSavedUnsavedInnerBlocks,
  23172. onSave: post => {
  23173. // Set some state used as a guard to prevent the creation of multiple posts.
  23174. setHasSavedUnsavedInnerBlocks(true); // Switch to using the wp_navigation entity.
  23175. setRef(post.id);
  23176. showNavigationMenuCreateNotice((0,external_wp_i18n_namespaceObject.__)(`New Navigation Menu created.`));
  23177. }
  23178. })));
  23179. } // Show a warning if the selected menu is no longer available.
  23180. // TODO - the user should be able to select a new one?
  23181. if (ref && isNavigationMenuMissing) {
  23182. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Navigation menu has been deleted or is unavailable. '), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  23183. onClick: resetToEmptyBlock,
  23184. variant: "link"
  23185. }, (0,external_wp_i18n_namespaceObject.__)('Create a new menu?'))));
  23186. }
  23187. if (isEntityAvailable && hasAlreadyRendered) {
  23188. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
  23189. }
  23190. const PlaceholderComponent = CustomPlaceholder ? CustomPlaceholder : NavigationPlaceholder;
  23191. if (isPlaceholder) {
  23192. return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(PlaceholderComponent, {
  23193. isSelected: isSelected,
  23194. currentMenuId: ref,
  23195. clientId: clientId,
  23196. canUserCreateNavigationMenu: canUserCreateNavigationMenu,
  23197. isResolvingCanUserCreateNavigationMenu: isResolvingCanUserCreateNavigationMenu,
  23198. onFinish: handleSelectNavigation,
  23199. onCreateEmpty: () => createNavigationMenu('', [])
  23200. }));
  23201. }
  23202. return (0,external_wp_element_namespaceObject.createElement)(external_wp_coreData_namespaceObject.EntityProvider, {
  23203. kind: "postType",
  23204. type: "wp_navigation",
  23205. id: ref
  23206. }, (0,external_wp_element_namespaceObject.createElement)(RecursionProvider, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, !isDraftNavigationMenu && isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
  23207. className: "wp-block-navigation__toolbar-menu-selector"
  23208. }, (0,external_wp_element_namespaceObject.createElement)(navigation_menu_selector, {
  23209. ref: navigationSelectorRef,
  23210. currentMenuId: ref,
  23211. clientId: clientId,
  23212. onSelect: handleSelectNavigation,
  23213. onCreateNew: resetToEmptyBlock
  23214. /* translators: %s: The name of a menu. */
  23215. ,
  23216. actionLabel: (0,external_wp_i18n_namespaceObject.__)("Switch to '%s'"),
  23217. showManageActions: true
  23218. }))), stylingInspectorControls, isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  23219. __experimentalGroup: "advanced"
  23220. }, hasResolvedCanUserUpdateNavigationMenu && canUserUpdateNavigationMenu && (0,external_wp_element_namespaceObject.createElement)(NavigationMenuNameControl, null), hasResolvedCanUserDeleteNavigationMenu && canUserDeleteNavigationMenu && (0,external_wp_element_namespaceObject.createElement)(NavigationMenuDeleteControl, {
  23221. onDelete: function () {
  23222. let deletedMenuTitle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  23223. resetToEmptyBlock();
  23224. showNavigationMenuDeleteNotice((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
  23225. (0,external_wp_i18n_namespaceObject.__)('Navigation menu %s successfully deleted.'), deletedMenuTitle));
  23226. }
  23227. })), isLoading && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, {
  23228. className: "wp-block-navigation__loading-indicator"
  23229. })), !isLoading && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(ResponsiveWrapper, {
  23230. id: clientId,
  23231. onToggle: setResponsiveMenuVisibility,
  23232. label: (0,external_wp_i18n_namespaceObject.__)('Menu'),
  23233. hasIcon: hasIcon,
  23234. isOpen: isResponsiveMenuOpen,
  23235. isResponsive: isResponsive,
  23236. isHiddenByDefault: 'always' === overlayMenu,
  23237. classNames: overlayClassnames,
  23238. styles: overlayStyles
  23239. }, isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(NavigationInnerBlocks, {
  23240. clientId: clientId,
  23241. hasCustomPlaceholder: !!CustomPlaceholder,
  23242. orientation: orientation
  23243. })))));
  23244. }
  23245. /* harmony default export */ var navigation_edit = ((0,external_wp_blockEditor_namespaceObject.withColors)({
  23246. textColor: 'color'
  23247. }, {
  23248. backgroundColor: 'color'
  23249. }, {
  23250. overlayBackgroundColor: 'color'
  23251. }, {
  23252. overlayTextColor: 'color'
  23253. })(Navigation));
  23254. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/save.js
  23255. /**
  23256. * WordPress dependencies
  23257. */
  23258. function navigation_save_save(_ref) {
  23259. let {
  23260. attributes
  23261. } = _ref;
  23262. if (attributes.ref) {
  23263. // Avoid rendering inner blocks when a ref is defined.
  23264. // When this id is defined the inner blocks are loaded from the
  23265. // `wp_navigation` entity rather than the hard-coded block html.
  23266. return;
  23267. }
  23268. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  23269. }
  23270. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/deprecated.js
  23271. /**
  23272. * External dependencies
  23273. */
  23274. /**
  23275. * WordPress dependencies
  23276. */
  23277. /**
  23278. * Internal dependencies
  23279. */
  23280. const TYPOGRAPHY_PRESET_DEPRECATION_MAP = {
  23281. fontStyle: 'var:preset|font-style|',
  23282. fontWeight: 'var:preset|font-weight|',
  23283. textDecoration: 'var:preset|text-decoration|',
  23284. textTransform: 'var:preset|text-transform|'
  23285. };
  23286. const migrateIdToRef = _ref => {
  23287. let {
  23288. navigationMenuId,
  23289. ...attributes
  23290. } = _ref;
  23291. return { ...attributes,
  23292. ref: navigationMenuId
  23293. };
  23294. };
  23295. const deprecated_migrateWithLayout = attributes => {
  23296. if (!!attributes.layout) {
  23297. return attributes;
  23298. }
  23299. const {
  23300. itemsJustification,
  23301. orientation,
  23302. ...updatedAttributes
  23303. } = attributes;
  23304. if (itemsJustification || orientation) {
  23305. Object.assign(updatedAttributes, {
  23306. layout: {
  23307. type: 'flex',
  23308. ...(itemsJustification && {
  23309. justifyContent: itemsJustification
  23310. }),
  23311. ...(orientation && {
  23312. orientation
  23313. })
  23314. }
  23315. });
  23316. }
  23317. return updatedAttributes;
  23318. };
  23319. const navigation_deprecated_v6 = {
  23320. attributes: {
  23321. navigationMenuId: {
  23322. type: 'number'
  23323. },
  23324. textColor: {
  23325. type: 'string'
  23326. },
  23327. customTextColor: {
  23328. type: 'string'
  23329. },
  23330. rgbTextColor: {
  23331. type: 'string'
  23332. },
  23333. backgroundColor: {
  23334. type: 'string'
  23335. },
  23336. customBackgroundColor: {
  23337. type: 'string'
  23338. },
  23339. rgbBackgroundColor: {
  23340. type: 'string'
  23341. },
  23342. showSubmenuIcon: {
  23343. type: 'boolean',
  23344. default: true
  23345. },
  23346. openSubmenusOnClick: {
  23347. type: 'boolean',
  23348. default: false
  23349. },
  23350. overlayMenu: {
  23351. type: 'string',
  23352. default: 'mobile'
  23353. },
  23354. __unstableLocation: {
  23355. type: 'string'
  23356. },
  23357. overlayBackgroundColor: {
  23358. type: 'string'
  23359. },
  23360. customOverlayBackgroundColor: {
  23361. type: 'string'
  23362. },
  23363. overlayTextColor: {
  23364. type: 'string'
  23365. },
  23366. customOverlayTextColor: {
  23367. type: 'string'
  23368. }
  23369. },
  23370. supports: {
  23371. align: ['wide', 'full'],
  23372. anchor: true,
  23373. html: false,
  23374. inserter: true,
  23375. typography: {
  23376. fontSize: true,
  23377. lineHeight: true,
  23378. __experimentalFontStyle: true,
  23379. __experimentalFontWeight: true,
  23380. __experimentalTextTransform: true,
  23381. __experimentalFontFamily: true,
  23382. __experimentalTextDecoration: true,
  23383. __experimentalDefaultControls: {
  23384. fontSize: true
  23385. }
  23386. },
  23387. spacing: {
  23388. blockGap: true,
  23389. units: ['px', 'em', 'rem', 'vh', 'vw'],
  23390. __experimentalDefaultControls: {
  23391. blockGap: true
  23392. }
  23393. },
  23394. __experimentalLayout: {
  23395. allowSwitching: false,
  23396. allowInheriting: false,
  23397. default: {
  23398. type: 'flex'
  23399. }
  23400. }
  23401. },
  23402. save() {
  23403. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  23404. },
  23405. isEligible: _ref2 => {
  23406. let {
  23407. navigationMenuId
  23408. } = _ref2;
  23409. return !!navigationMenuId;
  23410. },
  23411. migrate: migrateIdToRef
  23412. };
  23413. const navigation_deprecated_v5 = {
  23414. attributes: {
  23415. navigationMenuId: {
  23416. type: 'number'
  23417. },
  23418. orientation: {
  23419. type: 'string',
  23420. default: 'horizontal'
  23421. },
  23422. textColor: {
  23423. type: 'string'
  23424. },
  23425. customTextColor: {
  23426. type: 'string'
  23427. },
  23428. rgbTextColor: {
  23429. type: 'string'
  23430. },
  23431. backgroundColor: {
  23432. type: 'string'
  23433. },
  23434. customBackgroundColor: {
  23435. type: 'string'
  23436. },
  23437. rgbBackgroundColor: {
  23438. type: 'string'
  23439. },
  23440. itemsJustification: {
  23441. type: 'string'
  23442. },
  23443. showSubmenuIcon: {
  23444. type: 'boolean',
  23445. default: true
  23446. },
  23447. openSubmenusOnClick: {
  23448. type: 'boolean',
  23449. default: false
  23450. },
  23451. overlayMenu: {
  23452. type: 'string',
  23453. default: 'never'
  23454. },
  23455. __unstableLocation: {
  23456. type: 'string'
  23457. },
  23458. overlayBackgroundColor: {
  23459. type: 'string'
  23460. },
  23461. customOverlayBackgroundColor: {
  23462. type: 'string'
  23463. },
  23464. overlayTextColor: {
  23465. type: 'string'
  23466. },
  23467. customOverlayTextColor: {
  23468. type: 'string'
  23469. }
  23470. },
  23471. supports: {
  23472. align: ['wide', 'full'],
  23473. anchor: true,
  23474. html: false,
  23475. inserter: true,
  23476. typography: {
  23477. fontSize: true,
  23478. lineHeight: true,
  23479. __experimentalFontStyle: true,
  23480. __experimentalFontWeight: true,
  23481. __experimentalTextTransform: true,
  23482. __experimentalFontFamily: true,
  23483. __experimentalTextDecoration: true,
  23484. __experimentalDefaultControls: {
  23485. fontSize: true
  23486. }
  23487. },
  23488. spacing: {
  23489. blockGap: true,
  23490. units: ['px', 'em', 'rem', 'vh', 'vw'],
  23491. __experimentalDefaultControls: {
  23492. blockGap: true
  23493. }
  23494. }
  23495. },
  23496. save() {
  23497. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  23498. },
  23499. isEligible: _ref3 => {
  23500. let {
  23501. itemsJustification,
  23502. orientation
  23503. } = _ref3;
  23504. return !!itemsJustification || !!orientation;
  23505. },
  23506. migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout)
  23507. };
  23508. const navigation_deprecated_v4 = {
  23509. attributes: {
  23510. orientation: {
  23511. type: 'string',
  23512. default: 'horizontal'
  23513. },
  23514. textColor: {
  23515. type: 'string'
  23516. },
  23517. customTextColor: {
  23518. type: 'string'
  23519. },
  23520. rgbTextColor: {
  23521. type: 'string'
  23522. },
  23523. backgroundColor: {
  23524. type: 'string'
  23525. },
  23526. customBackgroundColor: {
  23527. type: 'string'
  23528. },
  23529. rgbBackgroundColor: {
  23530. type: 'string'
  23531. },
  23532. itemsJustification: {
  23533. type: 'string'
  23534. },
  23535. showSubmenuIcon: {
  23536. type: 'boolean',
  23537. default: true
  23538. },
  23539. openSubmenusOnClick: {
  23540. type: 'boolean',
  23541. default: false
  23542. },
  23543. overlayMenu: {
  23544. type: 'string',
  23545. default: 'never'
  23546. },
  23547. __unstableLocation: {
  23548. type: 'string'
  23549. },
  23550. overlayBackgroundColor: {
  23551. type: 'string'
  23552. },
  23553. customOverlayBackgroundColor: {
  23554. type: 'string'
  23555. },
  23556. overlayTextColor: {
  23557. type: 'string'
  23558. },
  23559. customOverlayTextColor: {
  23560. type: 'string'
  23561. }
  23562. },
  23563. supports: {
  23564. align: ['wide', 'full'],
  23565. anchor: true,
  23566. html: false,
  23567. inserter: true,
  23568. typography: {
  23569. fontSize: true,
  23570. lineHeight: true,
  23571. __experimentalFontStyle: true,
  23572. __experimentalFontWeight: true,
  23573. __experimentalTextTransform: true,
  23574. __experimentalFontFamily: true,
  23575. __experimentalTextDecoration: true
  23576. },
  23577. spacing: {
  23578. blockGap: true,
  23579. units: ['px', 'em', 'rem', 'vh', 'vw'],
  23580. __experimentalDefaultControls: {
  23581. blockGap: true
  23582. }
  23583. }
  23584. },
  23585. save() {
  23586. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  23587. },
  23588. migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family),
  23589. isEligible(_ref4) {
  23590. var _style$typography;
  23591. let {
  23592. style
  23593. } = _ref4;
  23594. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  23595. }
  23596. };
  23597. const migrateIsResponsive = function (attributes) {
  23598. delete attributes.isResponsive;
  23599. return { ...attributes,
  23600. overlayMenu: 'mobile'
  23601. };
  23602. };
  23603. const migrateTypographyPresets = function (attributes) {
  23604. return { ...attributes,
  23605. style: { ...attributes.style,
  23606. typography: (0,external_lodash_namespaceObject.mapValues)(attributes.style.typography, (value, key) => {
  23607. const prefix = TYPOGRAPHY_PRESET_DEPRECATION_MAP[key];
  23608. if (prefix && value.startsWith(prefix)) {
  23609. const newValue = value.slice(prefix.length);
  23610. if ('textDecoration' === key && 'strikethrough' === newValue) {
  23611. return 'line-through';
  23612. }
  23613. return newValue;
  23614. }
  23615. return value;
  23616. })
  23617. }
  23618. };
  23619. };
  23620. const navigation_deprecated_deprecated = [navigation_deprecated_v6, navigation_deprecated_v5, navigation_deprecated_v4, // Remove `isResponsive` attribute.
  23621. {
  23622. attributes: {
  23623. orientation: {
  23624. type: 'string',
  23625. default: 'horizontal'
  23626. },
  23627. textColor: {
  23628. type: 'string'
  23629. },
  23630. customTextColor: {
  23631. type: 'string'
  23632. },
  23633. rgbTextColor: {
  23634. type: 'string'
  23635. },
  23636. backgroundColor: {
  23637. type: 'string'
  23638. },
  23639. customBackgroundColor: {
  23640. type: 'string'
  23641. },
  23642. rgbBackgroundColor: {
  23643. type: 'string'
  23644. },
  23645. itemsJustification: {
  23646. type: 'string'
  23647. },
  23648. showSubmenuIcon: {
  23649. type: 'boolean',
  23650. default: true
  23651. },
  23652. openSubmenusOnClick: {
  23653. type: 'boolean',
  23654. default: false
  23655. },
  23656. isResponsive: {
  23657. type: 'boolean',
  23658. default: 'false'
  23659. },
  23660. __unstableLocation: {
  23661. type: 'string'
  23662. },
  23663. overlayBackgroundColor: {
  23664. type: 'string'
  23665. },
  23666. customOverlayBackgroundColor: {
  23667. type: 'string'
  23668. },
  23669. overlayTextColor: {
  23670. type: 'string'
  23671. },
  23672. customOverlayTextColor: {
  23673. type: 'string'
  23674. }
  23675. },
  23676. supports: {
  23677. align: ['wide', 'full'],
  23678. anchor: true,
  23679. html: false,
  23680. inserter: true,
  23681. typography: {
  23682. fontSize: true,
  23683. lineHeight: true,
  23684. __experimentalFontStyle: true,
  23685. __experimentalFontWeight: true,
  23686. __experimentalTextTransform: true,
  23687. __experimentalFontFamily: true,
  23688. __experimentalTextDecoration: true
  23689. }
  23690. },
  23691. isEligible(attributes) {
  23692. return attributes.isResponsive;
  23693. },
  23694. migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family, migrateIsResponsive),
  23695. save() {
  23696. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  23697. }
  23698. }, {
  23699. attributes: {
  23700. orientation: {
  23701. type: 'string'
  23702. },
  23703. textColor: {
  23704. type: 'string'
  23705. },
  23706. customTextColor: {
  23707. type: 'string'
  23708. },
  23709. rgbTextColor: {
  23710. type: 'string'
  23711. },
  23712. backgroundColor: {
  23713. type: 'string'
  23714. },
  23715. customBackgroundColor: {
  23716. type: 'string'
  23717. },
  23718. rgbBackgroundColor: {
  23719. type: 'string'
  23720. },
  23721. itemsJustification: {
  23722. type: 'string'
  23723. },
  23724. showSubmenuIcon: {
  23725. type: 'boolean',
  23726. default: true
  23727. }
  23728. },
  23729. supports: {
  23730. align: ['wide', 'full'],
  23731. anchor: true,
  23732. html: false,
  23733. inserter: true,
  23734. fontSize: true,
  23735. __experimentalFontStyle: true,
  23736. __experimentalFontWeight: true,
  23737. __experimentalTextTransform: true,
  23738. color: true,
  23739. __experimentalFontFamily: true,
  23740. __experimentalTextDecoration: true
  23741. },
  23742. save() {
  23743. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  23744. },
  23745. isEligible(attributes) {
  23746. if (!attributes.style || !attributes.style.typography) {
  23747. return false;
  23748. }
  23749. for (const styleAttribute in TYPOGRAPHY_PRESET_DEPRECATION_MAP) {
  23750. const attributeValue = attributes.style.typography[styleAttribute];
  23751. if (attributeValue && attributeValue.startsWith(TYPOGRAPHY_PRESET_DEPRECATION_MAP[styleAttribute])) {
  23752. return true;
  23753. }
  23754. }
  23755. return false;
  23756. },
  23757. migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family, migrateTypographyPresets)
  23758. }, {
  23759. attributes: {
  23760. className: {
  23761. type: 'string'
  23762. },
  23763. textColor: {
  23764. type: 'string'
  23765. },
  23766. rgbTextColor: {
  23767. type: 'string'
  23768. },
  23769. backgroundColor: {
  23770. type: 'string'
  23771. },
  23772. rgbBackgroundColor: {
  23773. type: 'string'
  23774. },
  23775. fontSize: {
  23776. type: 'string'
  23777. },
  23778. customFontSize: {
  23779. type: 'number'
  23780. },
  23781. itemsJustification: {
  23782. type: 'string'
  23783. },
  23784. showSubmenuIcon: {
  23785. type: 'boolean'
  23786. }
  23787. },
  23788. isEligible(attribute) {
  23789. return attribute.rgbTextColor || attribute.rgbBackgroundColor;
  23790. },
  23791. supports: {
  23792. align: ['wide', 'full'],
  23793. anchor: true,
  23794. html: false,
  23795. inserter: true
  23796. },
  23797. migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, attributes => {
  23798. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['rgbTextColor', 'rgbBackgroundColor']),
  23799. customTextColor: attributes.textColor ? undefined : attributes.rgbTextColor,
  23800. customBackgroundColor: attributes.backgroundColor ? undefined : attributes.rgbBackgroundColor
  23801. };
  23802. }),
  23803. save() {
  23804. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  23805. }
  23806. }];
  23807. /* harmony default export */ var navigation_deprecated = (navigation_deprecated_deprecated);
  23808. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/index.js
  23809. /**
  23810. * WordPress dependencies
  23811. */
  23812. /**
  23813. * Internal dependencies
  23814. */
  23815. const navigation_metadata = {
  23816. $schema: "https://schemas.wp.org/trunk/block.json",
  23817. apiVersion: 2,
  23818. name: "core/navigation",
  23819. title: "Navigation",
  23820. category: "theme",
  23821. description: "A collection of blocks that allow visitors to get around your site.",
  23822. keywords: ["menu", "navigation", "links"],
  23823. textdomain: "default",
  23824. attributes: {
  23825. ref: {
  23826. type: "number"
  23827. },
  23828. textColor: {
  23829. type: "string"
  23830. },
  23831. customTextColor: {
  23832. type: "string"
  23833. },
  23834. rgbTextColor: {
  23835. type: "string"
  23836. },
  23837. backgroundColor: {
  23838. type: "string"
  23839. },
  23840. customBackgroundColor: {
  23841. type: "string"
  23842. },
  23843. rgbBackgroundColor: {
  23844. type: "string"
  23845. },
  23846. showSubmenuIcon: {
  23847. type: "boolean",
  23848. "default": true
  23849. },
  23850. openSubmenusOnClick: {
  23851. type: "boolean",
  23852. "default": false
  23853. },
  23854. overlayMenu: {
  23855. type: "string",
  23856. "default": "mobile"
  23857. },
  23858. hasIcon: {
  23859. type: "boolean",
  23860. "default": true
  23861. },
  23862. __unstableLocation: {
  23863. type: "string"
  23864. },
  23865. overlayBackgroundColor: {
  23866. type: "string"
  23867. },
  23868. customOverlayBackgroundColor: {
  23869. type: "string"
  23870. },
  23871. overlayTextColor: {
  23872. type: "string"
  23873. },
  23874. customOverlayTextColor: {
  23875. type: "string"
  23876. },
  23877. maxNestingLevel: {
  23878. type: "number",
  23879. "default": 5
  23880. }
  23881. },
  23882. providesContext: {
  23883. textColor: "textColor",
  23884. customTextColor: "customTextColor",
  23885. backgroundColor: "backgroundColor",
  23886. customBackgroundColor: "customBackgroundColor",
  23887. overlayTextColor: "overlayTextColor",
  23888. customOverlayTextColor: "customOverlayTextColor",
  23889. overlayBackgroundColor: "overlayBackgroundColor",
  23890. customOverlayBackgroundColor: "customOverlayBackgroundColor",
  23891. fontSize: "fontSize",
  23892. customFontSize: "customFontSize",
  23893. showSubmenuIcon: "showSubmenuIcon",
  23894. openSubmenusOnClick: "openSubmenusOnClick",
  23895. style: "style",
  23896. orientation: "orientation",
  23897. maxNestingLevel: "maxNestingLevel"
  23898. },
  23899. supports: {
  23900. align: ["wide", "full"],
  23901. anchor: true,
  23902. html: false,
  23903. inserter: true,
  23904. typography: {
  23905. fontSize: true,
  23906. lineHeight: true,
  23907. __experimentalFontStyle: true,
  23908. __experimentalFontWeight: true,
  23909. __experimentalTextTransform: true,
  23910. __experimentalFontFamily: true,
  23911. __experimentalTextDecoration: true,
  23912. __experimentalSkipSerialization: ["textDecoration"],
  23913. __experimentalDefaultControls: {
  23914. fontSize: true
  23915. }
  23916. },
  23917. spacing: {
  23918. blockGap: true,
  23919. units: ["px", "em", "rem", "vh", "vw"],
  23920. __experimentalDefaultControls: {
  23921. blockGap: true
  23922. }
  23923. },
  23924. __experimentalLayout: {
  23925. allowSwitching: false,
  23926. allowInheriting: false,
  23927. allowVerticalAlignment: false,
  23928. "default": {
  23929. type: "flex"
  23930. }
  23931. }
  23932. },
  23933. viewScript: "file:./view.min.js",
  23934. editorStyle: "wp-block-navigation-editor",
  23935. style: "wp-block-navigation"
  23936. };
  23937. const {
  23938. name: navigation_name
  23939. } = navigation_metadata;
  23940. const navigation_settings = {
  23941. icon: library_navigation,
  23942. example: {
  23943. innerBlocks: [{
  23944. name: 'core/navigation-link',
  23945. attributes: {
  23946. // translators: 'Home' as in a website's home page.
  23947. label: (0,external_wp_i18n_namespaceObject.__)('Home'),
  23948. url: 'https://make.wordpress.org/'
  23949. }
  23950. }, {
  23951. name: 'core/navigation-link',
  23952. attributes: {
  23953. // translators: 'About' as in a website's about page.
  23954. label: (0,external_wp_i18n_namespaceObject.__)('About'),
  23955. url: 'https://make.wordpress.org/'
  23956. }
  23957. }, {
  23958. name: 'core/navigation-link',
  23959. attributes: {
  23960. // translators: 'Contact' as in a website's contact page.
  23961. label: (0,external_wp_i18n_namespaceObject.__)('Contact'),
  23962. url: 'https://make.wordpress.org/'
  23963. }
  23964. }]
  23965. },
  23966. edit: navigation_edit,
  23967. save: navigation_save_save,
  23968. deprecated: navigation_deprecated
  23969. };
  23970. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/custom-link.js
  23971. /**
  23972. * WordPress dependencies
  23973. */
  23974. const customLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  23975. xmlns: "https://www.w3.org/2000/svg",
  23976. viewBox: "0 0 24 24"
  23977. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  23978. d: "M12.5 14.5h-1V16h1c2.2 0 4-1.8 4-4s-1.8-4-4-4h-1v1.5h1c1.4 0 2.5 1.1 2.5 2.5s-1.1 2.5-2.5 2.5zm-4 1.5v-1.5h-1C6.1 14.5 5 13.4 5 12s1.1-2.5 2.5-2.5h1V8h-1c-2.2 0-4 1.8-4 4s1.8 4 4 4h1zm-1-3.2h5v-1.5h-5v1.5zM18 4H9c-1.1 0-2 .9-2 2v.5h1.5V6c0-.3.2-.5.5-.5h9c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5v-.5H7v.5c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2z"
  23979. }));
  23980. /* harmony default export */ var custom_link = (customLink);
  23981. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/add-submenu.js
  23982. /**
  23983. * WordPress dependencies
  23984. */
  23985. const addSubmenu = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  23986. xmlns: "http://www.w3.org/2000/svg",
  23987. viewBox: "0 0 24 24"
  23988. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  23989. d: "M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z"
  23990. }));
  23991. /* harmony default export */ var add_submenu = (addSubmenu);
  23992. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/edit.js
  23993. /**
  23994. * External dependencies
  23995. */
  23996. /**
  23997. * WordPress dependencies
  23998. */
  23999. /**
  24000. * Internal dependencies
  24001. */
  24002. const {
  24003. name: edit_name
  24004. } = {
  24005. $schema: "https://schemas.wp.org/trunk/block.json",
  24006. apiVersion: 2,
  24007. name: "core/navigation-link",
  24008. title: "Custom Link",
  24009. category: "design",
  24010. parent: ["core/navigation"],
  24011. description: "Add a page, link, or another item to your navigation.",
  24012. textdomain: "default",
  24013. attributes: {
  24014. label: {
  24015. type: "string"
  24016. },
  24017. type: {
  24018. type: "string"
  24019. },
  24020. description: {
  24021. type: "string"
  24022. },
  24023. rel: {
  24024. type: "string"
  24025. },
  24026. id: {
  24027. type: "number"
  24028. },
  24029. opensInNewTab: {
  24030. type: "boolean",
  24031. "default": false
  24032. },
  24033. url: {
  24034. type: "string"
  24035. },
  24036. title: {
  24037. type: "string"
  24038. },
  24039. kind: {
  24040. type: "string"
  24041. },
  24042. isTopLevelLink: {
  24043. type: "boolean"
  24044. }
  24045. },
  24046. usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "style"],
  24047. supports: {
  24048. reusable: false,
  24049. html: false,
  24050. __experimentalSlashInserter: true
  24051. },
  24052. editorStyle: "wp-block-navigation-link-editor",
  24053. style: "wp-block-navigation-link"
  24054. };
  24055. /**
  24056. * A React hook to determine if it's dragging within the target element.
  24057. *
  24058. * @typedef {import('@wordpress/element').RefObject} RefObject
  24059. *
  24060. * @param {RefObject<HTMLElement>} elementRef The target elementRef object.
  24061. *
  24062. * @return {boolean} Is dragging within the target element.
  24063. */
  24064. const useIsDraggingWithin = elementRef => {
  24065. const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false);
  24066. (0,external_wp_element_namespaceObject.useEffect)(() => {
  24067. const {
  24068. ownerDocument
  24069. } = elementRef.current;
  24070. function handleDragStart(event) {
  24071. // Check the first time when the dragging starts.
  24072. handleDragEnter(event);
  24073. } // Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.
  24074. function handleDragEnd() {
  24075. setIsDraggingWithin(false);
  24076. }
  24077. function handleDragEnter(event) {
  24078. // Check if the current target is inside the item element.
  24079. if (elementRef.current.contains(event.target)) {
  24080. setIsDraggingWithin(true);
  24081. } else {
  24082. setIsDraggingWithin(false);
  24083. }
  24084. } // Bind these events to the document to catch all drag events.
  24085. // Ideally, we can also use `event.relatedTarget`, but sadly that
  24086. // doesn't work in Safari.
  24087. ownerDocument.addEventListener('dragstart', handleDragStart);
  24088. ownerDocument.addEventListener('dragend', handleDragEnd);
  24089. ownerDocument.addEventListener('dragenter', handleDragEnter);
  24090. return () => {
  24091. ownerDocument.removeEventListener('dragstart', handleDragStart);
  24092. ownerDocument.removeEventListener('dragend', handleDragEnd);
  24093. ownerDocument.removeEventListener('dragenter', handleDragEnter);
  24094. };
  24095. }, []);
  24096. return isDraggingWithin;
  24097. };
  24098. /**
  24099. * Given the Link block's type attribute, return the query params to give to
  24100. * /wp/v2/search.
  24101. *
  24102. * @param {string} type Link block's type attribute.
  24103. * @param {string} kind Link block's entity of kind (post-type|taxonomy)
  24104. * @return {{ type?: string, subtype?: string }} Search query params.
  24105. */
  24106. function getSuggestionsQuery(type, kind) {
  24107. switch (type) {
  24108. case 'post':
  24109. case 'page':
  24110. return {
  24111. type: 'post',
  24112. subtype: type
  24113. };
  24114. case 'category':
  24115. return {
  24116. type: 'term',
  24117. subtype: 'category'
  24118. };
  24119. case 'tag':
  24120. return {
  24121. type: 'term',
  24122. subtype: 'post_tag'
  24123. };
  24124. case 'post_format':
  24125. return {
  24126. type: 'post-format'
  24127. };
  24128. default:
  24129. if (kind === 'taxonomy') {
  24130. return {
  24131. type: 'term',
  24132. subtype: type
  24133. };
  24134. }
  24135. if (kind === 'post-type') {
  24136. return {
  24137. type: 'post',
  24138. subtype: type
  24139. };
  24140. }
  24141. return {};
  24142. }
  24143. }
  24144. /**
  24145. * Determine the colors for a menu.
  24146. *
  24147. * Order of priority is:
  24148. * 1: Overlay custom colors (if submenu)
  24149. * 2: Overlay theme colors (if submenu)
  24150. * 3: Custom colors
  24151. * 4: Theme colors
  24152. * 5: Global styles
  24153. *
  24154. * @param {Object} context
  24155. * @param {boolean} isSubMenu
  24156. */
  24157. function getColors(context, isSubMenu) {
  24158. var _style$color, _style$color2;
  24159. const {
  24160. textColor,
  24161. customTextColor,
  24162. backgroundColor,
  24163. customBackgroundColor,
  24164. overlayTextColor,
  24165. customOverlayTextColor,
  24166. overlayBackgroundColor,
  24167. customOverlayBackgroundColor,
  24168. style
  24169. } = context;
  24170. const colors = {};
  24171. if (isSubMenu && !!customOverlayTextColor) {
  24172. colors.customTextColor = customOverlayTextColor;
  24173. } else if (isSubMenu && !!overlayTextColor) {
  24174. colors.textColor = overlayTextColor;
  24175. } else if (!!customTextColor) {
  24176. colors.customTextColor = customTextColor;
  24177. } else if (!!textColor) {
  24178. colors.textColor = textColor;
  24179. } else if (!!(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.text)) {
  24180. colors.customTextColor = style.color.text;
  24181. }
  24182. if (isSubMenu && !!customOverlayBackgroundColor) {
  24183. colors.customBackgroundColor = customOverlayBackgroundColor;
  24184. } else if (isSubMenu && !!overlayBackgroundColor) {
  24185. colors.backgroundColor = overlayBackgroundColor;
  24186. } else if (!!customBackgroundColor) {
  24187. colors.customBackgroundColor = customBackgroundColor;
  24188. } else if (!!backgroundColor) {
  24189. colors.backgroundColor = backgroundColor;
  24190. } else if (!!(style !== null && style !== void 0 && (_style$color2 = style.color) !== null && _style$color2 !== void 0 && _style$color2.background)) {
  24191. colors.customTextColor = style.color.background;
  24192. }
  24193. return colors;
  24194. }
  24195. /**
  24196. * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind
  24197. */
  24198. /**
  24199. * Navigation Link Block Attributes
  24200. *
  24201. * @typedef {Object} WPNavigationLinkBlockAttributes
  24202. *
  24203. * @property {string} [label] Link text.
  24204. * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status.
  24205. * @property {string} [type] The type such as post, page, tag, category and other custom types.
  24206. * @property {string} [rel] The relationship of the linked URL.
  24207. * @property {number} [id] A post or term id.
  24208. * @property {boolean} [opensInNewTab] Sets link target to _blank when true.
  24209. * @property {string} [url] Link href.
  24210. * @property {string} [title] Link title attribute.
  24211. */
  24212. /**
  24213. * Link Control onChange handler that updates block attributes when a setting is changed.
  24214. *
  24215. * @param {Object} updatedValue New block attributes to update.
  24216. * @param {Function} setAttributes Block attribute update function.
  24217. * @param {WPNavigationLinkBlockAttributes} blockAttributes Current block attributes.
  24218. *
  24219. */
  24220. const updateNavigationLinkBlockAttributes = function () {
  24221. let updatedValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  24222. let setAttributes = arguments.length > 1 ? arguments[1] : undefined;
  24223. let blockAttributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  24224. const {
  24225. label: originalLabel = '',
  24226. kind: originalKind = '',
  24227. type: originalType = ''
  24228. } = blockAttributes;
  24229. const {
  24230. title = '',
  24231. // the title of any provided Post.
  24232. url = '',
  24233. opensInNewTab,
  24234. id,
  24235. kind: newKind = originalKind,
  24236. type: newType = originalType
  24237. } = updatedValue;
  24238. const normalizedTitle = title.replace(/http(s?):\/\//gi, '');
  24239. const normalizedURL = url.replace(/http(s?):\/\//gi, '');
  24240. const escapeTitle = title !== '' && normalizedTitle !== normalizedURL && originalLabel !== title;
  24241. const label = escapeTitle ? (0,external_lodash_namespaceObject.escape)(title) : originalLabel || (0,external_lodash_namespaceObject.escape)(normalizedURL); // In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag"
  24242. const type = newType === 'post_tag' ? 'tag' : newType.replace('-', '_');
  24243. const isBuiltInType = ['post', 'page', 'tag', 'category'].indexOf(type) > -1;
  24244. const isCustomLink = !newKind && !isBuiltInType || newKind === 'custom';
  24245. const kind = isCustomLink ? 'custom' : newKind;
  24246. setAttributes({ // Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.
  24247. ...(url && {
  24248. url: encodeURI((0,external_wp_url_namespaceObject.safeDecodeURI)(url))
  24249. }),
  24250. ...(label && {
  24251. label
  24252. }),
  24253. ...(undefined !== opensInNewTab && {
  24254. opensInNewTab
  24255. }),
  24256. ...(id && Number.isInteger(id) && {
  24257. id
  24258. }),
  24259. ...(kind && {
  24260. kind
  24261. }),
  24262. ...(type && type !== 'URL' && {
  24263. type
  24264. })
  24265. });
  24266. };
  24267. const useIsInvalidLink = (kind, type, id) => {
  24268. const isPostType = kind === 'post-type' || type === 'post' || type === 'page';
  24269. const hasId = Number.isInteger(id);
  24270. const postStatus = (0,external_wp_data_namespaceObject.useSelect)(select => {
  24271. var _getEntityRecord;
  24272. if (!isPostType) {
  24273. return null;
  24274. }
  24275. const {
  24276. getEntityRecord
  24277. } = select(external_wp_coreData_namespaceObject.store);
  24278. return (_getEntityRecord = getEntityRecord('postType', type, id)) === null || _getEntityRecord === void 0 ? void 0 : _getEntityRecord.status;
  24279. }, [isPostType, type, id]); // Check Navigation Link validity if:
  24280. // 1. Link is 'post-type'.
  24281. // 2. It has an id.
  24282. // 3. It's neither null, nor undefined, as valid items might be either of those while loading.
  24283. // If those conditions are met, check if
  24284. // 1. The post status is published.
  24285. // 2. The Navigation Link item has no label.
  24286. // If either of those is true, invalidate.
  24287. const isInvalid = isPostType && hasId && postStatus && 'trash' === postStatus;
  24288. const isDraft = 'draft' === postStatus;
  24289. return [isInvalid, isDraft];
  24290. };
  24291. const useMissingText = type => {
  24292. let missingText = '';
  24293. switch (type) {
  24294. case 'post':
  24295. /* translators: label for missing post in navigation link block */
  24296. missingText = (0,external_wp_i18n_namespaceObject.__)('Select post');
  24297. break;
  24298. case 'page':
  24299. /* translators: label for missing page in navigation link block */
  24300. missingText = (0,external_wp_i18n_namespaceObject.__)('Select page');
  24301. break;
  24302. case 'category':
  24303. /* translators: label for missing category in navigation link block */
  24304. missingText = (0,external_wp_i18n_namespaceObject.__)('Select category');
  24305. break;
  24306. case 'tag':
  24307. /* translators: label for missing tag in navigation link block */
  24308. missingText = (0,external_wp_i18n_namespaceObject.__)('Select tag');
  24309. break;
  24310. default:
  24311. /* translators: label for missing values in navigation link block */
  24312. missingText = (0,external_wp_i18n_namespaceObject.__)('Add link');
  24313. }
  24314. return missingText;
  24315. };
  24316. /**
  24317. * Removes HTML from a given string.
  24318. * Note the does not provide XSS protection or otherwise attempt
  24319. * to filter strings with malicious intent.
  24320. *
  24321. * See also: https://github.com/WordPress/gutenberg/pull/35539
  24322. *
  24323. * @param {string} html the string from which HTML should be removed.
  24324. * @return {string} the "cleaned" string.
  24325. */
  24326. function navStripHTML(html) {
  24327. const doc = document.implementation.createHTMLDocument('');
  24328. doc.body.innerHTML = html;
  24329. return doc.body.textContent || '';
  24330. }
  24331. /**
  24332. * Add transforms to Link Control
  24333. */
  24334. function LinkControlTransforms(_ref) {
  24335. let {
  24336. clientId,
  24337. replace
  24338. } = _ref;
  24339. const {
  24340. getBlock,
  24341. blockTransforms
  24342. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  24343. const {
  24344. getBlock: _getBlock,
  24345. getBlockRootClientId,
  24346. getBlockTransformItems
  24347. } = select(external_wp_blockEditor_namespaceObject.store);
  24348. return {
  24349. getBlock: _getBlock,
  24350. blockTransforms: getBlockTransformItems([_getBlock(clientId)], getBlockRootClientId(clientId))
  24351. };
  24352. }, [clientId]);
  24353. const featuredBlocks = ['core/site-logo', 'core/social-links', 'core/search'];
  24354. const transforms = blockTransforms.filter(item => {
  24355. return featuredBlocks.includes(item.name);
  24356. });
  24357. if (!(transforms !== null && transforms !== void 0 && transforms.length)) {
  24358. return null;
  24359. }
  24360. return (0,external_wp_element_namespaceObject.createElement)("div", {
  24361. className: "link-control-transform"
  24362. }, (0,external_wp_element_namespaceObject.createElement)("h3", {
  24363. className: "link-control-transform__subheading"
  24364. }, (0,external_wp_i18n_namespaceObject.__)('Transform')), (0,external_wp_element_namespaceObject.createElement)("div", {
  24365. className: "link-control-transform__items"
  24366. }, transforms.map((item, index) => {
  24367. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  24368. key: `transform-${index}`,
  24369. onClick: () => replace(clientId, (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(clientId), item.name)),
  24370. className: "link-control-transform__item"
  24371. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  24372. icon: item.icon
  24373. }), item.title);
  24374. })));
  24375. }
  24376. function NavigationLinkEdit(_ref2) {
  24377. let {
  24378. attributes,
  24379. isSelected,
  24380. setAttributes,
  24381. insertBlocksAfter,
  24382. mergeBlocks,
  24383. onReplace,
  24384. context,
  24385. clientId
  24386. } = _ref2;
  24387. const {
  24388. id,
  24389. label,
  24390. type,
  24391. opensInNewTab,
  24392. url,
  24393. description,
  24394. rel,
  24395. title,
  24396. kind
  24397. } = attributes;
  24398. const [isInvalid, isDraft] = useIsInvalidLink(kind, type, id);
  24399. const {
  24400. maxNestingLevel
  24401. } = context;
  24402. const link = {
  24403. url,
  24404. opensInNewTab,
  24405. title: label && navStripHTML(label) // don't allow HTML to display inside the <LinkControl>
  24406. };
  24407. const {
  24408. saveEntityRecord
  24409. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  24410. const {
  24411. replaceBlock,
  24412. __unstableMarkNextChangeAsNotPersistent
  24413. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  24414. const [isLinkOpen, setIsLinkOpen] = (0,external_wp_element_namespaceObject.useState)(false);
  24415. const listItemRef = (0,external_wp_element_namespaceObject.useRef)(null);
  24416. const isDraggingWithin = useIsDraggingWithin(listItemRef);
  24417. const itemLabelPlaceholder = (0,external_wp_i18n_namespaceObject.__)('Add link…');
  24418. const ref = (0,external_wp_element_namespaceObject.useRef)();
  24419. const {
  24420. innerBlocks,
  24421. isAtMaxNesting,
  24422. isTopLevelLink,
  24423. isParentOfSelectedBlock,
  24424. hasChildren,
  24425. userCanCreatePages,
  24426. userCanCreatePosts
  24427. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  24428. const {
  24429. getBlocks,
  24430. getBlockCount,
  24431. getBlockName,
  24432. getBlockRootClientId,
  24433. hasSelectedInnerBlock,
  24434. getBlockParentsByBlockName
  24435. } = select(external_wp_blockEditor_namespaceObject.store);
  24436. return {
  24437. innerBlocks: getBlocks(clientId),
  24438. isAtMaxNesting: getBlockParentsByBlockName(clientId, [edit_name, 'core/navigation-submenu']).length >= maxNestingLevel,
  24439. isTopLevelLink: getBlockName(getBlockRootClientId(clientId)) === 'core/navigation',
  24440. isParentOfSelectedBlock: hasSelectedInnerBlock(clientId, true),
  24441. hasChildren: !!getBlockCount(clientId),
  24442. userCanCreatePages: select(external_wp_coreData_namespaceObject.store).canUser('create', 'pages'),
  24443. userCanCreatePosts: select(external_wp_coreData_namespaceObject.store).canUser('create', 'posts')
  24444. };
  24445. }, [clientId]);
  24446. (0,external_wp_element_namespaceObject.useEffect)(() => {
  24447. // This side-effect should not create an undo level as those should
  24448. // only be created via user interactions. Mark this change as
  24449. // not persistent to avoid undo level creation.
  24450. // See https://github.com/WordPress/gutenberg/issues/34564.
  24451. __unstableMarkNextChangeAsNotPersistent();
  24452. setAttributes({
  24453. isTopLevelLink
  24454. });
  24455. }, [isTopLevelLink]);
  24456. /**
  24457. * Transform to submenu block.
  24458. */
  24459. function transformToSubmenu() {
  24460. const newSubmenu = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks);
  24461. replaceBlock(clientId, newSubmenu);
  24462. }
  24463. (0,external_wp_element_namespaceObject.useEffect)(() => {
  24464. // Show the LinkControl on mount if the URL is empty
  24465. // ( When adding a new menu item)
  24466. // This can't be done in the useState call because it conflicts
  24467. // with the autofocus behavior of the BlockListBlock component.
  24468. if (!url) {
  24469. setIsLinkOpen(true);
  24470. } // If block has inner blocks, transform to Submenu.
  24471. if (hasChildren) {
  24472. transformToSubmenu();
  24473. }
  24474. }, []);
  24475. /**
  24476. * The hook shouldn't be necessary but due to a focus loss happening
  24477. * when selecting a suggestion in the link popover, we force close on block unselection.
  24478. */
  24479. (0,external_wp_element_namespaceObject.useEffect)(() => {
  24480. if (!isSelected) {
  24481. setIsLinkOpen(false);
  24482. }
  24483. }, [isSelected]); // If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.
  24484. (0,external_wp_element_namespaceObject.useEffect)(() => {
  24485. if (isLinkOpen && url) {
  24486. // Does this look like a URL and have something TLD-ish?
  24487. if ((0,external_wp_url_namespaceObject.isURL)((0,external_wp_url_namespaceObject.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) {
  24488. // Focus and select the label text.
  24489. selectLabelText();
  24490. } else {
  24491. // Focus it (but do not select).
  24492. (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(ref.current, true);
  24493. }
  24494. }
  24495. }, [url]);
  24496. /**
  24497. * Focus the Link label text and select it.
  24498. */
  24499. function selectLabelText() {
  24500. ref.current.focus();
  24501. const {
  24502. ownerDocument
  24503. } = ref.current;
  24504. const {
  24505. defaultView
  24506. } = ownerDocument;
  24507. const selection = defaultView.getSelection();
  24508. const range = ownerDocument.createRange(); // Get the range of the current ref contents so we can add this range to the selection.
  24509. range.selectNodeContents(ref.current);
  24510. selection.removeAllRanges();
  24511. selection.addRange(range);
  24512. }
  24513. /**
  24514. * Removes the current link if set.
  24515. */
  24516. function removeLink() {
  24517. // Reset all attributes that comprise the link.
  24518. setAttributes({
  24519. url: '',
  24520. label: '',
  24521. id: '',
  24522. kind: '',
  24523. type: ''
  24524. }); // Close the link editing UI.
  24525. setIsLinkOpen(false);
  24526. }
  24527. let userCanCreate = false;
  24528. if (!type || type === 'page') {
  24529. userCanCreate = userCanCreatePages;
  24530. } else if (type === 'post') {
  24531. userCanCreate = userCanCreatePosts;
  24532. }
  24533. async function handleCreate(pageTitle) {
  24534. const postType = type || 'page';
  24535. const page = await saveEntityRecord('postType', postType, {
  24536. title: pageTitle,
  24537. status: 'draft'
  24538. });
  24539. return {
  24540. id: page.id,
  24541. type: postType,
  24542. title: page.title.rendered,
  24543. url: page.link,
  24544. kind: 'post-type'
  24545. };
  24546. }
  24547. const {
  24548. textColor,
  24549. customTextColor,
  24550. backgroundColor,
  24551. customBackgroundColor
  24552. } = getColors(context, !isTopLevelLink);
  24553. function onKeyDown(event) {
  24554. if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k') || !url && event.keyCode === external_wp_keycodes_namespaceObject.ENTER) {
  24555. setIsLinkOpen(true);
  24556. }
  24557. }
  24558. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  24559. ref: listItemRef,
  24560. className: classnames_default()('wp-block-navigation-item', {
  24561. 'is-editing': isSelected || isParentOfSelectedBlock,
  24562. 'is-dragging-within': isDraggingWithin,
  24563. 'has-link': !!url,
  24564. 'has-child': hasChildren,
  24565. 'has-text-color': !!textColor || !!customTextColor,
  24566. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor)]: !!textColor,
  24567. 'has-background': !!backgroundColor || customBackgroundColor,
  24568. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor)]: !!backgroundColor
  24569. }),
  24570. style: {
  24571. color: !textColor && customTextColor,
  24572. backgroundColor: !backgroundColor && customBackgroundColor
  24573. },
  24574. onKeyDown
  24575. });
  24576. if (!url || isInvalid || isDraft) {
  24577. blockProps.onClick = () => setIsLinkOpen(true);
  24578. }
  24579. const classes = classnames_default()('wp-block-navigation-item__content', {
  24580. 'wp-block-navigation-link__placeholder': !url || isInvalid || isDraft
  24581. });
  24582. const missingText = useMissingText(type, isInvalid, isDraft);
  24583. /* translators: Whether the navigation link is Invalid or a Draft. */
  24584. const placeholderText = `(${isInvalid ? (0,external_wp_i18n_namespaceObject.__)('Invalid') : (0,external_wp_i18n_namespaceObject.__)('Draft')})`;
  24585. const tooltipText = isInvalid || isDraft ? (0,external_wp_i18n_namespaceObject.__)('This item has been deleted, or is a draft') : (0,external_wp_i18n_namespaceObject.__)('This item is missing a link');
  24586. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  24587. name: "link",
  24588. icon: library_link,
  24589. title: (0,external_wp_i18n_namespaceObject.__)('Link'),
  24590. shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'),
  24591. onClick: () => setIsLinkOpen(true)
  24592. }), !isAtMaxNesting && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  24593. name: "submenu",
  24594. icon: add_submenu,
  24595. title: (0,external_wp_i18n_namespaceObject.__)('Add submenu'),
  24596. onClick: transformToSubmenu
  24597. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  24598. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  24599. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
  24600. value: description || '',
  24601. onChange: descriptionValue => {
  24602. setAttributes({
  24603. description: descriptionValue
  24604. });
  24605. },
  24606. label: (0,external_wp_i18n_namespaceObject.__)('Description'),
  24607. help: (0,external_wp_i18n_namespaceObject.__)('The description will be displayed in the menu if the current theme supports it.')
  24608. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  24609. value: title || '',
  24610. onChange: titleValue => {
  24611. setAttributes({
  24612. title: titleValue
  24613. });
  24614. },
  24615. label: (0,external_wp_i18n_namespaceObject.__)('Link title'),
  24616. autoComplete: "off"
  24617. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  24618. value: rel || '',
  24619. onChange: relValue => {
  24620. setAttributes({
  24621. rel: relValue
  24622. });
  24623. },
  24624. label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
  24625. autoComplete: "off"
  24626. }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
  24627. className: classes
  24628. }, !url ? (0,external_wp_element_namespaceObject.createElement)("div", {
  24629. className: "wp-block-navigation-link__placeholder-text"
  24630. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
  24631. position: "top center",
  24632. text: tooltipText
  24633. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("span", null, missingText), (0,external_wp_element_namespaceObject.createElement)("span", {
  24634. className: "wp-block-navigation-link__missing_text-tooltip"
  24635. }, tooltipText)))) : (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !isInvalid && !isDraft && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  24636. ref: ref,
  24637. identifier: "label",
  24638. className: "wp-block-navigation-item__label",
  24639. value: label,
  24640. onChange: labelValue => setAttributes({
  24641. label: labelValue
  24642. }),
  24643. onMerge: mergeBlocks,
  24644. onReplace: onReplace,
  24645. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link')),
  24646. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigation link text'),
  24647. placeholder: itemLabelPlaceholder,
  24648. withoutInteractiveFormatting: true,
  24649. allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough'],
  24650. onClick: () => {
  24651. if (!url) {
  24652. setIsLinkOpen(true);
  24653. }
  24654. }
  24655. }), description && (0,external_wp_element_namespaceObject.createElement)("span", {
  24656. className: "wp-block-navigation-item__description"
  24657. }, description)), (isInvalid || isDraft) && (0,external_wp_element_namespaceObject.createElement)("div", {
  24658. className: "wp-block-navigation-link__placeholder-text wp-block-navigation-link__label"
  24659. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.KeyboardShortcuts, {
  24660. shortcuts: {
  24661. enter: () => isSelected && setIsLinkOpen(true)
  24662. }
  24663. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
  24664. position: "top center",
  24665. text: tooltipText
  24666. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("span", null,
  24667. /* Trim to avoid trailing white space when the placeholder text is not present */
  24668. `${label} ${placeholderText}`.trim()), (0,external_wp_element_namespaceObject.createElement)("span", {
  24669. className: "wp-block-navigation-link__missing_text-tooltip"
  24670. }, tooltipText))))), isLinkOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
  24671. position: "bottom center",
  24672. onClose: () => setIsLinkOpen(false),
  24673. anchorRef: listItemRef.current
  24674. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, {
  24675. hasTextControl: true,
  24676. hasRichPreviews: true,
  24677. className: "wp-block-navigation-link__inline-link-input",
  24678. value: link,
  24679. showInitialSuggestions: true,
  24680. withCreateSuggestion: userCanCreate,
  24681. createSuggestion: handleCreate,
  24682. createSuggestionButtonText: searchTerm => {
  24683. let format;
  24684. if (type === 'post') {
  24685. /* translators: %s: search term. */
  24686. format = (0,external_wp_i18n_namespaceObject.__)('Create draft post: <mark>%s</mark>');
  24687. } else {
  24688. /* translators: %s: search term. */
  24689. format = (0,external_wp_i18n_namespaceObject.__)('Create draft page: <mark>%s</mark>');
  24690. }
  24691. return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(format, searchTerm), {
  24692. mark: (0,external_wp_element_namespaceObject.createElement)("mark", null)
  24693. });
  24694. },
  24695. noDirectEntry: !!type,
  24696. noURLSuggestion: !!type,
  24697. suggestionsQuery: getSuggestionsQuery(type, kind),
  24698. onChange: updatedValue => updateNavigationLinkBlockAttributes(updatedValue, setAttributes, attributes),
  24699. onRemove: removeLink,
  24700. renderControlBottom: !url ? () => (0,external_wp_element_namespaceObject.createElement)(LinkControlTransforms, {
  24701. clientId: clientId,
  24702. replace: replaceBlock
  24703. }) : null
  24704. })))));
  24705. }
  24706. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/save.js
  24707. /**
  24708. * WordPress dependencies
  24709. */
  24710. function navigation_link_save_save() {
  24711. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  24712. }
  24713. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-title.js
  24714. /**
  24715. * WordPress dependencies
  24716. */
  24717. const postTitle = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  24718. viewBox: "0 0 24 24",
  24719. xmlns: "http://www.w3.org/2000/svg"
  24720. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  24721. d: "M4 14.5h16V16H4zM4 18.5h9V20H4zM4 4h3c2 0 3 .86 3 2.583 0 .891-.253 1.554-.76 1.988-.505.435-1.24.652-2.204.652H5.542V12H4V4zm2.855 4c.53 0 .924-.114 1.18-.343.266-.228.398-.579.398-1.051 0-.473-.132-.82-.397-1.04-.265-.229-.67-.343-1.217-.343H5.542V8h1.313z"
  24722. }));
  24723. /* harmony default export */ var post_title = (postTitle);
  24724. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page.js
  24725. /**
  24726. * WordPress dependencies
  24727. */
  24728. const page = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  24729. xmlns: "http://www.w3.org/2000/svg",
  24730. viewBox: "0 0 24 24"
  24731. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  24732. d: "M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"
  24733. }));
  24734. /* harmony default export */ var library_page = (page);
  24735. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/tag.js
  24736. /**
  24737. * WordPress dependencies
  24738. */
  24739. const tag = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  24740. xmlns: "http://www.w3.org/2000/svg",
  24741. viewBox: "0 0 24 24"
  24742. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  24743. d: "M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"
  24744. }));
  24745. /* harmony default export */ var library_tag = (tag);
  24746. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/custom-post-type.js
  24747. /**
  24748. * WordPress dependencies
  24749. */
  24750. const customPostType = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  24751. xmlns: "http://www.w3.org/2000/svg",
  24752. viewBox: "0 0 24 24"
  24753. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  24754. d: "M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z"
  24755. }));
  24756. /* harmony default export */ var custom_post_type = (customPostType);
  24757. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/fallback-variations.js
  24758. /**
  24759. * WordPress dependencies
  24760. */
  24761. // FALLBACK: this is only used when the server does not understand the variations property in the
  24762. // register_block_type call. see navigation-link/index.php.
  24763. // Delete this file when supported WP ranges understand the `variations` property when passed to
  24764. // register_block_type in index.php.
  24765. const fallbackVariations = [{
  24766. name: 'link',
  24767. isDefault: true,
  24768. title: (0,external_wp_i18n_namespaceObject.__)('Custom Link'),
  24769. description: (0,external_wp_i18n_namespaceObject.__)('A link to a custom URL.'),
  24770. attributes: {}
  24771. }, {
  24772. name: 'post',
  24773. icon: post_title,
  24774. title: (0,external_wp_i18n_namespaceObject.__)('Post Link'),
  24775. description: (0,external_wp_i18n_namespaceObject.__)('A link to a post.'),
  24776. attributes: {
  24777. type: 'post',
  24778. kind: 'post-type'
  24779. }
  24780. }, {
  24781. name: 'page',
  24782. icon: library_page,
  24783. title: (0,external_wp_i18n_namespaceObject.__)('Page Link'),
  24784. description: (0,external_wp_i18n_namespaceObject.__)('A link to a page.'),
  24785. attributes: {
  24786. type: 'page',
  24787. kind: 'post-type'
  24788. }
  24789. }, {
  24790. name: 'category',
  24791. icon: library_category,
  24792. title: (0,external_wp_i18n_namespaceObject.__)('Category Link'),
  24793. description: (0,external_wp_i18n_namespaceObject.__)('A link to a category.'),
  24794. attributes: {
  24795. type: 'category',
  24796. kind: 'taxonomy'
  24797. }
  24798. }, {
  24799. name: 'tag',
  24800. icon: library_tag,
  24801. title: (0,external_wp_i18n_namespaceObject.__)('Tag Link'),
  24802. description: (0,external_wp_i18n_namespaceObject.__)('A link to a tag.'),
  24803. attributes: {
  24804. type: 'tag',
  24805. kind: 'taxonomy'
  24806. }
  24807. }];
  24808. /**
  24809. * Add `isActive` function to all `navigation link` variations, if not defined.
  24810. * `isActive` function is used to find a variation match from a created
  24811. * Block by providing its attributes.
  24812. */
  24813. fallbackVariations.forEach(variation => {
  24814. if (variation.isActive) return;
  24815. variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type;
  24816. });
  24817. /* harmony default export */ var fallback_variations = (fallbackVariations);
  24818. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/hooks.js
  24819. /**
  24820. * WordPress dependencies
  24821. */
  24822. /**
  24823. * Internal dependencies
  24824. */
  24825. function getIcon(variationName) {
  24826. switch (variationName) {
  24827. case 'post':
  24828. return post_title;
  24829. case 'page':
  24830. return library_page;
  24831. case 'tag':
  24832. return library_tag;
  24833. case 'category':
  24834. return library_category;
  24835. default:
  24836. return custom_post_type;
  24837. }
  24838. }
  24839. function enhanceNavigationLinkVariations(settings, name) {
  24840. if (name !== 'core/navigation-link') {
  24841. return settings;
  24842. } // Fallback handling may be deleted after supported WP ranges understand the `variations`
  24843. // property when passed to register_block_type in index.php.
  24844. if (!settings.variations) {
  24845. return { ...settings,
  24846. variations: fallback_variations
  24847. };
  24848. } // Otherwise decorate server passed variations with an icon and isActive function.
  24849. if (settings.variations) {
  24850. const isActive = (blockAttributes, variationAttributes) => {
  24851. return blockAttributes.type === variationAttributes.type;
  24852. };
  24853. const variations = settings.variations.map(variation => {
  24854. return { ...variation,
  24855. ...(!variation.icon && {
  24856. icon: getIcon(variation.name)
  24857. }),
  24858. ...(!variation.isActive && {
  24859. isActive
  24860. })
  24861. };
  24862. });
  24863. return { ...settings,
  24864. variations
  24865. };
  24866. }
  24867. return settings;
  24868. }
  24869. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/transforms.js
  24870. /**
  24871. * WordPress dependencies
  24872. */
  24873. const navigation_link_transforms_transforms = {
  24874. from: [{
  24875. type: 'block',
  24876. blocks: ['core/site-logo'],
  24877. transform: () => {
  24878. return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
  24879. }
  24880. }, {
  24881. type: 'block',
  24882. blocks: ['core/spacer'],
  24883. transform: () => {
  24884. return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
  24885. }
  24886. }, {
  24887. type: 'block',
  24888. blocks: ['core/home-link'],
  24889. transform: () => {
  24890. return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
  24891. }
  24892. }, {
  24893. type: 'block',
  24894. blocks: ['core/social-links'],
  24895. transform: () => {
  24896. return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
  24897. }
  24898. }, {
  24899. type: 'block',
  24900. blocks: ['core/search'],
  24901. transform: () => {
  24902. return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
  24903. }
  24904. }],
  24905. to: [{
  24906. type: 'block',
  24907. blocks: ['core/navigation-submenu'],
  24908. transform: (attributes, innerBlocks) => (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks)
  24909. }, {
  24910. type: 'block',
  24911. blocks: ['core/spacer'],
  24912. transform: () => {
  24913. return (0,external_wp_blocks_namespaceObject.createBlock)('core/spacer');
  24914. }
  24915. }, {
  24916. type: 'block',
  24917. blocks: ['core/site-logo'],
  24918. transform: () => {
  24919. return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo');
  24920. }
  24921. }, {
  24922. type: 'block',
  24923. blocks: ['core/home-link'],
  24924. transform: () => {
  24925. return (0,external_wp_blocks_namespaceObject.createBlock)('core/home-link');
  24926. }
  24927. }, {
  24928. type: 'block',
  24929. blocks: ['core/social-links'],
  24930. transform: () => {
  24931. return (0,external_wp_blocks_namespaceObject.createBlock)('core/social-links');
  24932. }
  24933. }, {
  24934. type: 'block',
  24935. blocks: ['core/search'],
  24936. transform: () => {
  24937. return (0,external_wp_blocks_namespaceObject.createBlock)('core/search', {
  24938. showLabel: false,
  24939. buttonUseIcon: true,
  24940. buttonPosition: 'button-inside'
  24941. });
  24942. }
  24943. }]
  24944. };
  24945. /* harmony default export */ var navigation_link_transforms = (navigation_link_transforms_transforms);
  24946. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/index.js
  24947. /**
  24948. * WordPress dependencies
  24949. */
  24950. /**
  24951. * Internal dependencies
  24952. */
  24953. const navigation_link_metadata = {
  24954. $schema: "https://schemas.wp.org/trunk/block.json",
  24955. apiVersion: 2,
  24956. name: "core/navigation-link",
  24957. title: "Custom Link",
  24958. category: "design",
  24959. parent: ["core/navigation"],
  24960. description: "Add a page, link, or another item to your navigation.",
  24961. textdomain: "default",
  24962. attributes: {
  24963. label: {
  24964. type: "string"
  24965. },
  24966. type: {
  24967. type: "string"
  24968. },
  24969. description: {
  24970. type: "string"
  24971. },
  24972. rel: {
  24973. type: "string"
  24974. },
  24975. id: {
  24976. type: "number"
  24977. },
  24978. opensInNewTab: {
  24979. type: "boolean",
  24980. "default": false
  24981. },
  24982. url: {
  24983. type: "string"
  24984. },
  24985. title: {
  24986. type: "string"
  24987. },
  24988. kind: {
  24989. type: "string"
  24990. },
  24991. isTopLevelLink: {
  24992. type: "boolean"
  24993. }
  24994. },
  24995. usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "style"],
  24996. supports: {
  24997. reusable: false,
  24998. html: false,
  24999. __experimentalSlashInserter: true
  25000. },
  25001. editorStyle: "wp-block-navigation-link-editor",
  25002. style: "wp-block-navigation-link"
  25003. };
  25004. const {
  25005. name: navigation_link_name
  25006. } = navigation_link_metadata;
  25007. const navigation_link_settings = {
  25008. icon: custom_link,
  25009. __experimentalLabel: _ref => {
  25010. let {
  25011. label
  25012. } = _ref;
  25013. return label;
  25014. },
  25015. merge(leftAttributes, _ref2) {
  25016. let {
  25017. label: rightLabel = ''
  25018. } = _ref2;
  25019. return { ...leftAttributes,
  25020. label: leftAttributes.label + rightLabel
  25021. };
  25022. },
  25023. edit: NavigationLinkEdit,
  25024. save: navigation_link_save_save,
  25025. example: {
  25026. attributes: {
  25027. label: (0,external_wp_i18n_namespaceObject._x)('Example Link', 'navigation link preview example'),
  25028. url: 'https://example.com'
  25029. }
  25030. },
  25031. deprecated: [{
  25032. isEligible(attributes) {
  25033. return attributes.nofollow;
  25034. },
  25035. attributes: {
  25036. label: {
  25037. type: 'string'
  25038. },
  25039. type: {
  25040. type: 'string'
  25041. },
  25042. nofollow: {
  25043. type: 'boolean'
  25044. },
  25045. description: {
  25046. type: 'string'
  25047. },
  25048. id: {
  25049. type: 'number'
  25050. },
  25051. opensInNewTab: {
  25052. type: 'boolean',
  25053. default: false
  25054. },
  25055. url: {
  25056. type: 'string'
  25057. }
  25058. },
  25059. migrate(_ref3) {
  25060. let {
  25061. nofollow,
  25062. ...rest
  25063. } = _ref3;
  25064. return {
  25065. rel: nofollow ? 'nofollow' : '',
  25066. ...rest
  25067. };
  25068. },
  25069. save() {
  25070. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  25071. }
  25072. }],
  25073. transforms: navigation_link_transforms
  25074. }; // importing this file includes side effects. This is whitelisted in block-library/package.json under sideEffects
  25075. (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/navigation-link', enhanceNavigationLinkVariations);
  25076. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/remove-submenu.js
  25077. /**
  25078. * WordPress dependencies
  25079. */
  25080. const removeSubmenu = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  25081. xmlns: "http://www.w3.org/2000/svg",
  25082. viewBox: "0 0 24 24"
  25083. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  25084. fillRule: "evenodd",
  25085. clipRule: "evenodd",
  25086. d: "m13.955 20.748 8-17.5-.91-.416L19.597 6H13.5v1.5h5.411l-1.6 3.5H13.5v1.5h3.126l-1.6 3.5H13.5l.028 1.5h.812l-1.295 2.832.91.416ZM17.675 16l-.686 1.5h4.539L21.5 16h-3.825Zm2.286-5-.686 1.5H21.5V11h-1.54ZM2 12c0 3.58 2.42 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.48 0-4.5-1.52-4.5-4S5.52 7.5 8 7.5h3.5V6H8c-3.58 0-6 2.42-6 6Z"
  25087. }));
  25088. /* harmony default export */ var remove_submenu = (removeSubmenu);
  25089. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/icons.js
  25090. /**
  25091. * WordPress dependencies
  25092. */
  25093. const ItemSubmenuIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  25094. xmlns: "http://www.w3.org/2000/svg",
  25095. width: "12",
  25096. height: "12",
  25097. viewBox: "0 0 12 12",
  25098. fill: "none"
  25099. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  25100. d: "M1.50002 4L6.00002 8L10.5 4",
  25101. strokeWidth: "1.5"
  25102. }));
  25103. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/edit.js
  25104. /**
  25105. * External dependencies
  25106. */
  25107. /**
  25108. * WordPress dependencies
  25109. */
  25110. /**
  25111. * Internal dependencies
  25112. */
  25113. const {
  25114. name: navigation_submenu_edit_name
  25115. } = {
  25116. $schema: "https://schemas.wp.org/trunk/block.json",
  25117. apiVersion: 2,
  25118. name: "core/navigation-submenu",
  25119. title: "Submenu",
  25120. category: "design",
  25121. parent: ["core/navigation"],
  25122. description: "Add a submenu to your navigation.",
  25123. textdomain: "default",
  25124. attributes: {
  25125. label: {
  25126. type: "string"
  25127. },
  25128. type: {
  25129. type: "string"
  25130. },
  25131. description: {
  25132. type: "string"
  25133. },
  25134. rel: {
  25135. type: "string"
  25136. },
  25137. id: {
  25138. type: "number"
  25139. },
  25140. opensInNewTab: {
  25141. type: "boolean",
  25142. "default": false
  25143. },
  25144. url: {
  25145. type: "string"
  25146. },
  25147. title: {
  25148. type: "string"
  25149. },
  25150. kind: {
  25151. type: "string"
  25152. },
  25153. isTopLevelItem: {
  25154. type: "boolean"
  25155. }
  25156. },
  25157. usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "openSubmenusOnClick", "style"],
  25158. supports: {
  25159. reusable: false,
  25160. html: false
  25161. },
  25162. editorStyle: "wp-block-navigation-submenu-editor",
  25163. style: "wp-block-navigation-submenu"
  25164. };
  25165. const navigation_submenu_edit_ALLOWED_BLOCKS = ['core/navigation-link', 'core/navigation-submenu'];
  25166. const edit_DEFAULT_BLOCK = {
  25167. name: 'core/navigation-link'
  25168. };
  25169. /**
  25170. * A React hook to determine if it's dragging within the target element.
  25171. *
  25172. * @typedef {import('@wordpress/element').RefObject} RefObject
  25173. *
  25174. * @param {RefObject<HTMLElement>} elementRef The target elementRef object.
  25175. *
  25176. * @return {boolean} Is dragging within the target element.
  25177. */
  25178. const edit_useIsDraggingWithin = elementRef => {
  25179. const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false);
  25180. (0,external_wp_element_namespaceObject.useEffect)(() => {
  25181. const {
  25182. ownerDocument
  25183. } = elementRef.current;
  25184. function handleDragStart(event) {
  25185. // Check the first time when the dragging starts.
  25186. handleDragEnter(event);
  25187. } // Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.
  25188. function handleDragEnd() {
  25189. setIsDraggingWithin(false);
  25190. }
  25191. function handleDragEnter(event) {
  25192. // Check if the current target is inside the item element.
  25193. if (elementRef.current.contains(event.target)) {
  25194. setIsDraggingWithin(true);
  25195. } else {
  25196. setIsDraggingWithin(false);
  25197. }
  25198. } // Bind these events to the document to catch all drag events.
  25199. // Ideally, we can also use `event.relatedTarget`, but sadly that
  25200. // doesn't work in Safari.
  25201. ownerDocument.addEventListener('dragstart', handleDragStart);
  25202. ownerDocument.addEventListener('dragend', handleDragEnd);
  25203. ownerDocument.addEventListener('dragenter', handleDragEnter);
  25204. return () => {
  25205. ownerDocument.removeEventListener('dragstart', handleDragStart);
  25206. ownerDocument.removeEventListener('dragend', handleDragEnd);
  25207. ownerDocument.removeEventListener('dragenter', handleDragEnter);
  25208. };
  25209. }, []);
  25210. return isDraggingWithin;
  25211. };
  25212. /**
  25213. * Given the Link block's type attribute, return the query params to give to
  25214. * /wp/v2/search.
  25215. *
  25216. * @param {string} type Link block's type attribute.
  25217. * @param {string} kind Link block's entity of kind (post-type|taxonomy)
  25218. * @return {{ type?: string, subtype?: string }} Search query params.
  25219. */
  25220. function edit_getSuggestionsQuery(type, kind) {
  25221. switch (type) {
  25222. case 'post':
  25223. case 'page':
  25224. return {
  25225. type: 'post',
  25226. subtype: type
  25227. };
  25228. case 'category':
  25229. return {
  25230. type: 'term',
  25231. subtype: 'category'
  25232. };
  25233. case 'tag':
  25234. return {
  25235. type: 'term',
  25236. subtype: 'post_tag'
  25237. };
  25238. case 'post_format':
  25239. return {
  25240. type: 'post-format'
  25241. };
  25242. default:
  25243. if (kind === 'taxonomy') {
  25244. return {
  25245. type: 'term',
  25246. subtype: type
  25247. };
  25248. }
  25249. if (kind === 'post-type') {
  25250. return {
  25251. type: 'post',
  25252. subtype: type
  25253. };
  25254. }
  25255. return {};
  25256. }
  25257. }
  25258. /**
  25259. * Determine the colors for a menu.
  25260. *
  25261. * Order of priority is:
  25262. * 1: Overlay custom colors (if submenu)
  25263. * 2: Overlay theme colors (if submenu)
  25264. * 3: Custom colors
  25265. * 4: Theme colors
  25266. * 5: Global styles
  25267. *
  25268. * @param {Object} context
  25269. * @param {boolean} isSubMenu
  25270. */
  25271. function edit_getColors(context, isSubMenu) {
  25272. var _style$color, _style$color2;
  25273. const {
  25274. textColor,
  25275. customTextColor,
  25276. backgroundColor,
  25277. customBackgroundColor,
  25278. overlayTextColor,
  25279. customOverlayTextColor,
  25280. overlayBackgroundColor,
  25281. customOverlayBackgroundColor,
  25282. style
  25283. } = context;
  25284. const colors = {};
  25285. if (isSubMenu && !!customOverlayTextColor) {
  25286. colors.customTextColor = customOverlayTextColor;
  25287. } else if (isSubMenu && !!overlayTextColor) {
  25288. colors.textColor = overlayTextColor;
  25289. } else if (!!customTextColor) {
  25290. colors.customTextColor = customTextColor;
  25291. } else if (!!textColor) {
  25292. colors.textColor = textColor;
  25293. } else if (!!(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.text)) {
  25294. colors.customTextColor = style.color.text;
  25295. }
  25296. if (isSubMenu && !!customOverlayBackgroundColor) {
  25297. colors.customBackgroundColor = customOverlayBackgroundColor;
  25298. } else if (isSubMenu && !!overlayBackgroundColor) {
  25299. colors.backgroundColor = overlayBackgroundColor;
  25300. } else if (!!customBackgroundColor) {
  25301. colors.customBackgroundColor = customBackgroundColor;
  25302. } else if (!!backgroundColor) {
  25303. colors.backgroundColor = backgroundColor;
  25304. } else if (!!(style !== null && style !== void 0 && (_style$color2 = style.color) !== null && _style$color2 !== void 0 && _style$color2.background)) {
  25305. colors.customTextColor = style.color.background;
  25306. }
  25307. return colors;
  25308. }
  25309. /**
  25310. * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind
  25311. */
  25312. /**
  25313. * Navigation Link Block Attributes
  25314. *
  25315. * @typedef {Object} WPNavigationLinkBlockAttributes
  25316. *
  25317. * @property {string} [label] Link text.
  25318. * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status.
  25319. * @property {string} [type] The type such as post, page, tag, category and other custom types.
  25320. * @property {string} [rel] The relationship of the linked URL.
  25321. * @property {number} [id] A post or term id.
  25322. * @property {boolean} [opensInNewTab] Sets link target to _blank when true.
  25323. * @property {string} [url] Link href.
  25324. * @property {string} [title] Link title attribute.
  25325. */
  25326. /**
  25327. * Link Control onChange handler that updates block attributes when a setting is changed.
  25328. *
  25329. * @param {Object} updatedValue New block attributes to update.
  25330. * @param {Function} setAttributes Block attribute update function.
  25331. * @param {WPNavigationLinkBlockAttributes} blockAttributes Current block attributes.
  25332. *
  25333. */
  25334. const edit_updateNavigationLinkBlockAttributes = function () {
  25335. let updatedValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  25336. let setAttributes = arguments.length > 1 ? arguments[1] : undefined;
  25337. let blockAttributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  25338. const {
  25339. label: originalLabel = '',
  25340. kind: originalKind = '',
  25341. type: originalType = ''
  25342. } = blockAttributes;
  25343. const {
  25344. title = '',
  25345. url = '',
  25346. opensInNewTab,
  25347. id,
  25348. kind: newKind = originalKind,
  25349. type: newType = originalType
  25350. } = updatedValue;
  25351. const normalizedTitle = title.replace(/http(s?):\/\//gi, '');
  25352. const normalizedURL = url.replace(/http(s?):\/\//gi, '');
  25353. const escapeTitle = title !== '' && normalizedTitle !== normalizedURL && originalLabel !== title;
  25354. const label = escapeTitle ? (0,external_lodash_namespaceObject.escape)(title) : originalLabel || (0,external_lodash_namespaceObject.escape)(normalizedURL); // In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag"
  25355. const type = newType === 'post_tag' ? 'tag' : newType.replace('-', '_');
  25356. const isBuiltInType = ['post', 'page', 'tag', 'category'].indexOf(type) > -1;
  25357. const isCustomLink = !newKind && !isBuiltInType || newKind === 'custom';
  25358. const kind = isCustomLink ? 'custom' : newKind;
  25359. setAttributes({ // Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.
  25360. ...(url && {
  25361. url: encodeURI((0,external_wp_url_namespaceObject.safeDecodeURI)(url))
  25362. }),
  25363. ...(label && {
  25364. label
  25365. }),
  25366. ...(undefined !== opensInNewTab && {
  25367. opensInNewTab
  25368. }),
  25369. ...(id && Number.isInteger(id) && {
  25370. id
  25371. }),
  25372. ...(kind && {
  25373. kind
  25374. }),
  25375. ...(type && type !== 'URL' && {
  25376. type
  25377. })
  25378. });
  25379. };
  25380. function NavigationSubmenuEdit(_ref) {
  25381. let {
  25382. attributes,
  25383. isSelected,
  25384. setAttributes,
  25385. mergeBlocks,
  25386. onReplace,
  25387. context,
  25388. clientId
  25389. } = _ref;
  25390. const {
  25391. label,
  25392. type,
  25393. opensInNewTab,
  25394. url,
  25395. description,
  25396. rel,
  25397. title,
  25398. kind
  25399. } = attributes;
  25400. const link = {
  25401. url,
  25402. opensInNewTab
  25403. };
  25404. const {
  25405. showSubmenuIcon,
  25406. maxNestingLevel,
  25407. openSubmenusOnClick
  25408. } = context;
  25409. const {
  25410. saveEntityRecord
  25411. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  25412. const {
  25413. __unstableMarkNextChangeAsNotPersistent,
  25414. replaceBlock
  25415. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  25416. const [isLinkOpen, setIsLinkOpen] = (0,external_wp_element_namespaceObject.useState)(false);
  25417. const listItemRef = (0,external_wp_element_namespaceObject.useRef)(null);
  25418. const isDraggingWithin = edit_useIsDraggingWithin(listItemRef);
  25419. const itemLabelPlaceholder = (0,external_wp_i18n_namespaceObject.__)('Add text…');
  25420. const ref = (0,external_wp_element_namespaceObject.useRef)();
  25421. const {
  25422. isAtMaxNesting,
  25423. isTopLevelItem,
  25424. isParentOfSelectedBlock,
  25425. isImmediateParentOfSelectedBlock,
  25426. hasChildren,
  25427. selectedBlockHasChildren,
  25428. userCanCreatePages,
  25429. userCanCreatePosts,
  25430. onlyDescendantIsEmptyLink
  25431. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  25432. const {
  25433. hasSelectedInnerBlock,
  25434. getSelectedBlockClientId,
  25435. getBlockParentsByBlockName,
  25436. getBlock,
  25437. getBlockCount,
  25438. getBlockOrder
  25439. } = select(external_wp_blockEditor_namespaceObject.store);
  25440. let _onlyDescendantIsEmptyLink;
  25441. const selectedBlockId = getSelectedBlockClientId();
  25442. const selectedBlockChildren = getBlockOrder(selectedBlockId); // Check for a single descendant in the submenu. If that block
  25443. // is a link block in a "placeholder" state with no label then
  25444. // we can consider as an "empty" link.
  25445. if ((selectedBlockChildren === null || selectedBlockChildren === void 0 ? void 0 : selectedBlockChildren.length) === 1) {
  25446. var _singleBlock$attribut;
  25447. const singleBlock = getBlock(selectedBlockChildren[0]);
  25448. _onlyDescendantIsEmptyLink = (singleBlock === null || singleBlock === void 0 ? void 0 : singleBlock.name) === 'core/navigation-link' && !(singleBlock !== null && singleBlock !== void 0 && (_singleBlock$attribut = singleBlock.attributes) !== null && _singleBlock$attribut !== void 0 && _singleBlock$attribut.label);
  25449. }
  25450. return {
  25451. isAtMaxNesting: getBlockParentsByBlockName(clientId, navigation_submenu_edit_name).length >= maxNestingLevel,
  25452. isTopLevelItem: getBlockParentsByBlockName(clientId, navigation_submenu_edit_name).length === 0,
  25453. isParentOfSelectedBlock: hasSelectedInnerBlock(clientId, true),
  25454. isImmediateParentOfSelectedBlock: hasSelectedInnerBlock(clientId, false),
  25455. hasChildren: !!getBlockCount(clientId),
  25456. selectedBlockHasChildren: !!(selectedBlockChildren !== null && selectedBlockChildren !== void 0 && selectedBlockChildren.length),
  25457. userCanCreatePages: select(external_wp_coreData_namespaceObject.store).canUser('create', 'pages'),
  25458. userCanCreatePosts: select(external_wp_coreData_namespaceObject.store).canUser('create', 'posts'),
  25459. onlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink
  25460. };
  25461. }, [clientId]); // Show the LinkControl on mount if the URL is empty
  25462. // ( When adding a new menu item)
  25463. // This can't be done in the useState call because it conflicts
  25464. // with the autofocus behavior of the BlockListBlock component.
  25465. (0,external_wp_element_namespaceObject.useEffect)(() => {
  25466. if (!openSubmenusOnClick && !url) {
  25467. setIsLinkOpen(true);
  25468. }
  25469. }, []); // Store the colors from context as attributes for rendering.
  25470. (0,external_wp_element_namespaceObject.useEffect)(() => {
  25471. // This side-effect should not create an undo level as those should
  25472. // only be created via user interactions. Mark this change as
  25473. // not persistent to avoid undo level creation.
  25474. // See https://github.com/WordPress/gutenberg/issues/34564.
  25475. __unstableMarkNextChangeAsNotPersistent();
  25476. setAttributes({
  25477. isTopLevelItem
  25478. });
  25479. }, [isTopLevelItem]);
  25480. /**
  25481. * The hook shouldn't be necessary but due to a focus loss happening
  25482. * when selecting a suggestion in the link popover, we force close on block unselection.
  25483. */
  25484. (0,external_wp_element_namespaceObject.useEffect)(() => {
  25485. if (!isSelected) {
  25486. setIsLinkOpen(false);
  25487. }
  25488. }, [isSelected]); // If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.
  25489. (0,external_wp_element_namespaceObject.useEffect)(() => {
  25490. if (isLinkOpen && url) {
  25491. // Does this look like a URL and have something TLD-ish?
  25492. if ((0,external_wp_url_namespaceObject.isURL)((0,external_wp_url_namespaceObject.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) {
  25493. // Focus and select the label text.
  25494. selectLabelText();
  25495. } else {
  25496. // Focus it (but do not select).
  25497. (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(ref.current, true);
  25498. }
  25499. }
  25500. }, [url]);
  25501. /**
  25502. * Focus the Link label text and select it.
  25503. */
  25504. function selectLabelText() {
  25505. ref.current.focus();
  25506. const {
  25507. ownerDocument
  25508. } = ref.current;
  25509. const {
  25510. defaultView
  25511. } = ownerDocument;
  25512. const selection = defaultView.getSelection();
  25513. const range = ownerDocument.createRange(); // Get the range of the current ref contents so we can add this range to the selection.
  25514. range.selectNodeContents(ref.current);
  25515. selection.removeAllRanges();
  25516. selection.addRange(range);
  25517. }
  25518. let userCanCreate = false;
  25519. if (!type || type === 'page') {
  25520. userCanCreate = userCanCreatePages;
  25521. } else if (type === 'post') {
  25522. userCanCreate = userCanCreatePosts;
  25523. }
  25524. async function handleCreate(pageTitle) {
  25525. const postType = type || 'page';
  25526. const page = await saveEntityRecord('postType', postType, {
  25527. title: pageTitle,
  25528. status: 'draft'
  25529. });
  25530. return {
  25531. id: page.id,
  25532. type: postType,
  25533. title: page.title.rendered,
  25534. url: page.link,
  25535. kind: 'post-type'
  25536. };
  25537. }
  25538. const {
  25539. textColor,
  25540. customTextColor,
  25541. backgroundColor,
  25542. customBackgroundColor
  25543. } = edit_getColors(context, !isTopLevelItem);
  25544. function onKeyDown(event) {
  25545. if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) {
  25546. setIsLinkOpen(true);
  25547. }
  25548. }
  25549. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  25550. ref: listItemRef,
  25551. className: classnames_default()('wp-block-navigation-item', {
  25552. 'is-editing': isSelected || isParentOfSelectedBlock,
  25553. 'is-dragging-within': isDraggingWithin,
  25554. 'has-link': !!url,
  25555. 'has-child': hasChildren,
  25556. 'has-text-color': !!textColor || !!customTextColor,
  25557. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor)]: !!textColor,
  25558. 'has-background': !!backgroundColor || customBackgroundColor,
  25559. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor)]: !!backgroundColor,
  25560. 'open-on-click': openSubmenusOnClick
  25561. }),
  25562. style: {
  25563. color: !textColor && customTextColor,
  25564. backgroundColor: !backgroundColor && customBackgroundColor
  25565. },
  25566. onKeyDown
  25567. }); // Always use overlay colors for submenus.
  25568. const innerBlocksColors = edit_getColors(context, true);
  25569. const allowedBlocks = isAtMaxNesting ? (0,external_lodash_namespaceObject.without)(navigation_submenu_edit_ALLOWED_BLOCKS, 'core/navigation-submenu') : navigation_submenu_edit_ALLOWED_BLOCKS;
  25570. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
  25571. className: classnames_default()('wp-block-navigation__submenu-container', {
  25572. 'is-parent-of-selected-block': isParentOfSelectedBlock,
  25573. 'has-text-color': !!(innerBlocksColors.textColor || innerBlocksColors.customTextColor),
  25574. [`has-${innerBlocksColors.textColor}-color`]: !!innerBlocksColors.textColor,
  25575. 'has-background': !!(innerBlocksColors.backgroundColor || innerBlocksColors.customBackgroundColor),
  25576. [`has-${innerBlocksColors.backgroundColor}-background-color`]: !!innerBlocksColors.backgroundColor
  25577. }),
  25578. style: {
  25579. color: innerBlocksColors.customTextColor,
  25580. backgroundColor: innerBlocksColors.customBackgroundColor
  25581. }
  25582. }, {
  25583. allowedBlocks,
  25584. __experimentalDefaultBlock: edit_DEFAULT_BLOCK,
  25585. __experimentalDirectInsert: true,
  25586. // Ensure block toolbar is not too far removed from item
  25587. // being edited.
  25588. // see: https://github.com/WordPress/gutenberg/pull/34615.
  25589. __experimentalCaptureToolbars: true,
  25590. renderAppender: isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren || // Show the appender while dragging to allow inserting element between item and the appender.
  25591. hasChildren ? external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender : false
  25592. });
  25593. const ParentElement = openSubmenusOnClick ? 'button' : 'a';
  25594. function transformToLink() {
  25595. const newLinkBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', attributes);
  25596. replaceBlock(clientId, newLinkBlock);
  25597. }
  25598. const canConvertToLink = !selectedBlockHasChildren || onlyDescendantIsEmptyLink;
  25599. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, !openSubmenusOnClick && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  25600. name: "link",
  25601. icon: library_link,
  25602. title: (0,external_wp_i18n_namespaceObject.__)('Link'),
  25603. shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'),
  25604. onClick: () => setIsLinkOpen(true)
  25605. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  25606. name: "revert",
  25607. icon: remove_submenu,
  25608. title: (0,external_wp_i18n_namespaceObject.__)('Convert to Link'),
  25609. onClick: transformToLink,
  25610. className: "wp-block-navigation__submenu__revert",
  25611. isDisabled: !canConvertToLink
  25612. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  25613. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  25614. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
  25615. value: description || '',
  25616. onChange: descriptionValue => {
  25617. setAttributes({
  25618. description: descriptionValue
  25619. });
  25620. },
  25621. label: (0,external_wp_i18n_namespaceObject.__)('Description'),
  25622. help: (0,external_wp_i18n_namespaceObject.__)('The description will be displayed in the menu if the current theme supports it.')
  25623. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  25624. value: title || '',
  25625. onChange: titleValue => {
  25626. setAttributes({
  25627. title: titleValue
  25628. });
  25629. },
  25630. label: (0,external_wp_i18n_namespaceObject.__)('Link title'),
  25631. autoComplete: "off"
  25632. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  25633. value: rel || '',
  25634. onChange: relValue => {
  25635. setAttributes({
  25636. rel: relValue
  25637. });
  25638. },
  25639. label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
  25640. autoComplete: "off"
  25641. }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(ParentElement, {
  25642. className: "wp-block-navigation-item__content"
  25643. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  25644. ref: ref,
  25645. identifier: "label",
  25646. className: "wp-block-navigation-item__label",
  25647. value: label,
  25648. onChange: labelValue => setAttributes({
  25649. label: labelValue
  25650. }),
  25651. onMerge: mergeBlocks,
  25652. onReplace: onReplace,
  25653. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigation link text'),
  25654. placeholder: itemLabelPlaceholder,
  25655. withoutInteractiveFormatting: true,
  25656. allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough'],
  25657. onClick: () => {
  25658. if (!openSubmenusOnClick && !url) {
  25659. setIsLinkOpen(true);
  25660. }
  25661. }
  25662. }), !openSubmenusOnClick && isLinkOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
  25663. position: "bottom center",
  25664. onClose: () => setIsLinkOpen(false),
  25665. anchorRef: listItemRef.current
  25666. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, {
  25667. className: "wp-block-navigation-link__inline-link-input",
  25668. value: link,
  25669. showInitialSuggestions: true,
  25670. withCreateSuggestion: userCanCreate,
  25671. createSuggestion: handleCreate,
  25672. createSuggestionButtonText: searchTerm => {
  25673. let format;
  25674. if (type === 'post') {
  25675. /* translators: %s: search term. */
  25676. format = (0,external_wp_i18n_namespaceObject.__)('Create draft post: <mark>%s</mark>');
  25677. } else {
  25678. /* translators: %s: search term. */
  25679. format = (0,external_wp_i18n_namespaceObject.__)('Create draft page: <mark>%s</mark>');
  25680. }
  25681. return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(format, searchTerm), {
  25682. mark: (0,external_wp_element_namespaceObject.createElement)("mark", null)
  25683. });
  25684. },
  25685. noDirectEntry: !!type,
  25686. noURLSuggestion: !!type,
  25687. suggestionsQuery: edit_getSuggestionsQuery(type, kind),
  25688. onChange: updatedValue => edit_updateNavigationLinkBlockAttributes(updatedValue, setAttributes, attributes),
  25689. onRemove: () => {
  25690. setAttributes({
  25691. url: ''
  25692. });
  25693. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Link removed.'), 'assertive');
  25694. }
  25695. }))), (showSubmenuIcon || openSubmenusOnClick) && (0,external_wp_element_namespaceObject.createElement)("span", {
  25696. className: "wp-block-navigation__submenu-icon"
  25697. }, (0,external_wp_element_namespaceObject.createElement)(ItemSubmenuIcon, null)), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
  25698. }
  25699. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/save.js
  25700. /**
  25701. * WordPress dependencies
  25702. */
  25703. function navigation_submenu_save_save() {
  25704. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  25705. }
  25706. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/transforms.js
  25707. /**
  25708. * WordPress dependencies
  25709. */
  25710. const navigation_submenu_transforms_transforms = {
  25711. to: [{
  25712. type: 'block',
  25713. blocks: ['core/navigation-link'],
  25714. isMatch: (attributes, block) => {
  25715. var _block$innerBlocks;
  25716. return (block === null || block === void 0 ? void 0 : (_block$innerBlocks = block.innerBlocks) === null || _block$innerBlocks === void 0 ? void 0 : _block$innerBlocks.length) === 0;
  25717. },
  25718. transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', attributes)
  25719. }, {
  25720. type: 'block',
  25721. blocks: ['core/spacer'],
  25722. isMatch: (attributes, block) => {
  25723. var _block$innerBlocks2;
  25724. return (block === null || block === void 0 ? void 0 : (_block$innerBlocks2 = block.innerBlocks) === null || _block$innerBlocks2 === void 0 ? void 0 : _block$innerBlocks2.length) === 0;
  25725. },
  25726. transform: () => {
  25727. return (0,external_wp_blocks_namespaceObject.createBlock)('core/spacer');
  25728. }
  25729. }, {
  25730. type: 'block',
  25731. blocks: ['core/site-logo'],
  25732. isMatch: (attributes, block) => {
  25733. var _block$innerBlocks3;
  25734. return (block === null || block === void 0 ? void 0 : (_block$innerBlocks3 = block.innerBlocks) === null || _block$innerBlocks3 === void 0 ? void 0 : _block$innerBlocks3.length) === 0;
  25735. },
  25736. transform: () => {
  25737. return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo');
  25738. }
  25739. }, {
  25740. type: 'block',
  25741. blocks: ['core/home-link'],
  25742. isMatch: (attributes, block) => {
  25743. var _block$innerBlocks4;
  25744. return (block === null || block === void 0 ? void 0 : (_block$innerBlocks4 = block.innerBlocks) === null || _block$innerBlocks4 === void 0 ? void 0 : _block$innerBlocks4.length) === 0;
  25745. },
  25746. transform: () => {
  25747. return (0,external_wp_blocks_namespaceObject.createBlock)('core/home-link');
  25748. }
  25749. }, {
  25750. type: 'block',
  25751. blocks: ['core/social-links'],
  25752. isMatch: (attributes, block) => {
  25753. var _block$innerBlocks5;
  25754. return (block === null || block === void 0 ? void 0 : (_block$innerBlocks5 = block.innerBlocks) === null || _block$innerBlocks5 === void 0 ? void 0 : _block$innerBlocks5.length) === 0;
  25755. },
  25756. transform: () => {
  25757. return (0,external_wp_blocks_namespaceObject.createBlock)('core/social-links');
  25758. }
  25759. }, {
  25760. type: 'block',
  25761. blocks: ['core/search'],
  25762. isMatch: (attributes, block) => {
  25763. var _block$innerBlocks6;
  25764. return (block === null || block === void 0 ? void 0 : (_block$innerBlocks6 = block.innerBlocks) === null || _block$innerBlocks6 === void 0 ? void 0 : _block$innerBlocks6.length) === 0;
  25765. },
  25766. transform: () => {
  25767. return (0,external_wp_blocks_namespaceObject.createBlock)('core/search');
  25768. }
  25769. }]
  25770. };
  25771. /* harmony default export */ var navigation_submenu_transforms = (navigation_submenu_transforms_transforms);
  25772. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/index.js
  25773. /**
  25774. * WordPress dependencies
  25775. */
  25776. /**
  25777. * Internal dependencies
  25778. */
  25779. const navigation_submenu_metadata = {
  25780. $schema: "https://schemas.wp.org/trunk/block.json",
  25781. apiVersion: 2,
  25782. name: "core/navigation-submenu",
  25783. title: "Submenu",
  25784. category: "design",
  25785. parent: ["core/navigation"],
  25786. description: "Add a submenu to your navigation.",
  25787. textdomain: "default",
  25788. attributes: {
  25789. label: {
  25790. type: "string"
  25791. },
  25792. type: {
  25793. type: "string"
  25794. },
  25795. description: {
  25796. type: "string"
  25797. },
  25798. rel: {
  25799. type: "string"
  25800. },
  25801. id: {
  25802. type: "number"
  25803. },
  25804. opensInNewTab: {
  25805. type: "boolean",
  25806. "default": false
  25807. },
  25808. url: {
  25809. type: "string"
  25810. },
  25811. title: {
  25812. type: "string"
  25813. },
  25814. kind: {
  25815. type: "string"
  25816. },
  25817. isTopLevelItem: {
  25818. type: "boolean"
  25819. }
  25820. },
  25821. usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "openSubmenusOnClick", "style"],
  25822. supports: {
  25823. reusable: false,
  25824. html: false
  25825. },
  25826. editorStyle: "wp-block-navigation-submenu-editor",
  25827. style: "wp-block-navigation-submenu"
  25828. };
  25829. const {
  25830. name: navigation_submenu_name
  25831. } = navigation_submenu_metadata;
  25832. const navigation_submenu_settings = {
  25833. icon: add_submenu,
  25834. __experimentalLabel: _ref => {
  25835. let {
  25836. label
  25837. } = _ref;
  25838. return label;
  25839. },
  25840. edit: NavigationSubmenuEdit,
  25841. save: navigation_submenu_save_save,
  25842. transforms: navigation_submenu_transforms
  25843. };
  25844. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page-break.js
  25845. /**
  25846. * WordPress dependencies
  25847. */
  25848. const pageBreak = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  25849. xmlns: "http://www.w3.org/2000/svg",
  25850. viewBox: "0 0 24 24"
  25851. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  25852. d: "M7.8 6c0-.7.6-1.2 1.2-1.2h6c.7 0 1.2.6 1.2 1.2v3h1.5V6c0-1.5-1.2-2.8-2.8-2.8H9C7.5 3.2 6.2 4.5 6.2 6v3h1.5V6zm8.4 11c0 .7-.6 1.2-1.2 1.2H9c-.7 0-1.2-.6-1.2-1.2v-3H6.2v3c0 1.5 1.2 2.8 2.8 2.8h6c1.5 0 2.8-1.2 2.8-2.8v-3h-1.5v3zM4 11v1h16v-1H4z"
  25853. }));
  25854. /* harmony default export */ var page_break = (pageBreak);
  25855. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/edit.js
  25856. /**
  25857. * WordPress dependencies
  25858. */
  25859. function NextPageEdit() {
  25860. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)("div", {
  25861. className: "wp-block-nextpage"
  25862. }, (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Page break'))));
  25863. }
  25864. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/save.js
  25865. /**
  25866. * WordPress dependencies
  25867. */
  25868. function nextpage_save_save() {
  25869. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, '<!--nextpage-->');
  25870. }
  25871. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/transforms.js
  25872. /**
  25873. * WordPress dependencies
  25874. */
  25875. const nextpage_transforms_transforms = {
  25876. from: [{
  25877. type: 'raw',
  25878. schema: {
  25879. 'wp-block': {
  25880. attributes: ['data-block']
  25881. }
  25882. },
  25883. isMatch: node => node.dataset && node.dataset.block === 'core/nextpage',
  25884. transform() {
  25885. return (0,external_wp_blocks_namespaceObject.createBlock)('core/nextpage', {});
  25886. }
  25887. }]
  25888. };
  25889. /* harmony default export */ var nextpage_transforms = (nextpage_transforms_transforms);
  25890. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/index.js
  25891. /**
  25892. * WordPress dependencies
  25893. */
  25894. /**
  25895. * Internal dependencies
  25896. */
  25897. const nextpage_metadata = {
  25898. $schema: "https://schemas.wp.org/trunk/block.json",
  25899. apiVersion: 2,
  25900. name: "core/nextpage",
  25901. title: "Page Break",
  25902. category: "design",
  25903. description: "Separate your content into a multi-page experience.",
  25904. keywords: ["next page", "pagination"],
  25905. parent: ["core/post-content"],
  25906. textdomain: "default",
  25907. supports: {
  25908. customClassName: false,
  25909. className: false,
  25910. html: false
  25911. },
  25912. editorStyle: "wp-block-nextpage-editor"
  25913. };
  25914. const {
  25915. name: nextpage_name
  25916. } = nextpage_metadata;
  25917. const nextpage_settings = {
  25918. icon: page_break,
  25919. example: {},
  25920. transforms: nextpage_transforms,
  25921. edit: NextPageEdit,
  25922. save: nextpage_save_save
  25923. };
  25924. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pattern/edit.js
  25925. /**
  25926. * WordPress dependencies
  25927. */
  25928. const PatternEdit = _ref => {
  25929. let {
  25930. attributes,
  25931. clientId
  25932. } = _ref;
  25933. const selectedPattern = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).__experimentalGetParsedPattern(attributes.slug), [attributes.slug]);
  25934. const {
  25935. replaceBlocks,
  25936. __unstableMarkNextChangeAsNotPersistent
  25937. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); // Run this effect when the component loads.
  25938. // This adds the Pattern's contents to the post.
  25939. // This change won't be saved.
  25940. // It will continue to pull from the pattern file unless changes are made to its respective template part.
  25941. (0,external_wp_element_namespaceObject.useEffect)(() => {
  25942. if (selectedPattern !== null && selectedPattern !== void 0 && selectedPattern.blocks) {
  25943. __unstableMarkNextChangeAsNotPersistent();
  25944. replaceBlocks(clientId, selectedPattern.blocks);
  25945. }
  25946. }, [selectedPattern === null || selectedPattern === void 0 ? void 0 : selectedPattern.blocks]);
  25947. const props = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  25948. return (0,external_wp_element_namespaceObject.createElement)("div", props);
  25949. };
  25950. /* harmony default export */ var pattern_edit = (PatternEdit);
  25951. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pattern/index.js
  25952. /**
  25953. * Internal dependencies
  25954. */
  25955. const pattern_metadata = {
  25956. $schema: "https://schemas.wp.org/trunk/block.json",
  25957. apiVersion: 2,
  25958. name: "core/pattern",
  25959. title: "Pattern",
  25960. category: "theme",
  25961. description: "Show a block pattern.",
  25962. supports: {
  25963. html: false,
  25964. inserter: false
  25965. },
  25966. textdomain: "default",
  25967. attributes: {
  25968. slug: {
  25969. type: "string"
  25970. }
  25971. }
  25972. };
  25973. const {
  25974. name: pattern_name
  25975. } = pattern_metadata;
  25976. const pattern_settings = {
  25977. edit: pattern_edit
  25978. };
  25979. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pages.js
  25980. /**
  25981. * WordPress dependencies
  25982. */
  25983. const pages = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  25984. xmlns: "http://www.w3.org/2000/svg",
  25985. viewBox: "0 0 24 24"
  25986. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  25987. d: "M7 13.8h6v-1.5H7v1.5zM18 16V4c0-1.1-.9-2-2-2H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2zM5.5 16V4c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5zM7 10.5h8V9H7v1.5zm0-3.3h8V5.8H7v1.4zM20.2 6v13c0 .7-.6 1.2-1.2 1.2H8v1.5h11c1.5 0 2.7-1.2 2.7-2.8V6h-1.5z"
  25988. }));
  25989. /* harmony default export */ var library_pages = (pages);
  25990. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/convert-to-links-modal.js
  25991. /**
  25992. * WordPress dependencies
  25993. */
  25994. const PAGE_FIELDS = ['id', 'title', 'link', 'type', 'parent'];
  25995. const MAX_PAGE_COUNT = 100;
  25996. const convertSelectedBlockToNavigationLinks = _ref => {
  25997. let {
  25998. pages,
  25999. clientId,
  26000. replaceBlock,
  26001. createBlock
  26002. } = _ref;
  26003. return () => {
  26004. if (!pages) {
  26005. return;
  26006. }
  26007. const linkMap = {};
  26008. const navigationLinks = [];
  26009. pages.forEach(_ref2 => {
  26010. var _linkMap$id$innerBloc, _linkMap$id;
  26011. let {
  26012. id,
  26013. title,
  26014. link: url,
  26015. type,
  26016. parent
  26017. } = _ref2;
  26018. // See if a placeholder exists. This is created if children appear before parents in list.
  26019. const innerBlocks = (_linkMap$id$innerBloc = (_linkMap$id = linkMap[id]) === null || _linkMap$id === void 0 ? void 0 : _linkMap$id.innerBlocks) !== null && _linkMap$id$innerBloc !== void 0 ? _linkMap$id$innerBloc : [];
  26020. linkMap[id] = createBlock('core/navigation-link', {
  26021. id,
  26022. label: title.rendered,
  26023. url,
  26024. type,
  26025. kind: 'post-type'
  26026. }, innerBlocks);
  26027. if (!parent) {
  26028. navigationLinks.push(linkMap[id]);
  26029. } else {
  26030. if (!linkMap[parent]) {
  26031. // Use a placeholder if the child appears before parent in list.
  26032. linkMap[parent] = {
  26033. innerBlocks: []
  26034. };
  26035. }
  26036. const parentLinkInnerBlocks = linkMap[parent].innerBlocks;
  26037. parentLinkInnerBlocks.push(linkMap[id]);
  26038. }
  26039. }); // Transform all links with innerBlocks into Submenus. This can't be done
  26040. // sooner because page objects have no information on their children.
  26041. const transformSubmenus = listOfLinks => {
  26042. listOfLinks.forEach((block, index, listOfLinksArray) => {
  26043. const {
  26044. attributes,
  26045. innerBlocks
  26046. } = block;
  26047. if (innerBlocks.length !== 0) {
  26048. transformSubmenus(innerBlocks);
  26049. const transformedBlock = createBlock('core/navigation-submenu', attributes, innerBlocks);
  26050. listOfLinksArray[index] = transformedBlock;
  26051. }
  26052. });
  26053. };
  26054. transformSubmenus(navigationLinks);
  26055. replaceBlock(clientId, navigationLinks);
  26056. };
  26057. };
  26058. function ConvertToLinksModal(_ref3) {
  26059. let {
  26060. onClose,
  26061. clientId
  26062. } = _ref3;
  26063. const {
  26064. records: pages,
  26065. hasResolved: pagesFinished
  26066. } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('postType', 'page', {
  26067. per_page: MAX_PAGE_COUNT,
  26068. _fields: PAGE_FIELDS,
  26069. // TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby
  26070. // values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent
  26071. // sort.
  26072. orderby: 'menu_order',
  26073. order: 'asc'
  26074. });
  26075. const {
  26076. replaceBlock
  26077. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  26078. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
  26079. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close'),
  26080. onRequestClose: onClose,
  26081. title: (0,external_wp_i18n_namespaceObject.__)('Convert to links'),
  26082. className: 'wp-block-page-list-modal',
  26083. aria: {
  26084. describedby: 'wp-block-page-list-modal__description'
  26085. }
  26086. }, (0,external_wp_element_namespaceObject.createElement)("p", {
  26087. id: 'wp-block-page-list-modal__description'
  26088. }, (0,external_wp_i18n_namespaceObject.__)('To edit this navigation menu, convert it to single page links. This allows you to add, re-order, remove items, or edit their labels.')), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)("Note: if you add new pages to your site, you'll need to add them to your navigation menu.")), (0,external_wp_element_namespaceObject.createElement)("div", {
  26089. className: "wp-block-page-list-modal-buttons"
  26090. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  26091. variant: "tertiary",
  26092. onClick: onClose
  26093. }, (0,external_wp_i18n_namespaceObject.__)('Cancel')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  26094. variant: "primary",
  26095. disabled: !pagesFinished,
  26096. onClick: convertSelectedBlockToNavigationLinks({
  26097. pages,
  26098. replaceBlock,
  26099. clientId,
  26100. createBlock: external_wp_blocks_namespaceObject.createBlock
  26101. })
  26102. }, (0,external_wp_i18n_namespaceObject.__)('Convert'))));
  26103. }
  26104. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/icons.js
  26105. /**
  26106. * WordPress dependencies
  26107. */
  26108. const icons_ItemSubmenuIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  26109. xmlns: "http://www.w3.org/2000/svg",
  26110. width: "12",
  26111. height: "12",
  26112. viewBox: "0 0 12 12",
  26113. fill: "none"
  26114. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  26115. d: "M1.50002 4L6.00002 8L10.5 4",
  26116. strokeWidth: "1.5"
  26117. }));
  26118. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/edit.js
  26119. /**
  26120. * External dependencies
  26121. */
  26122. /**
  26123. * WordPress dependencies
  26124. */
  26125. /**
  26126. * Internal dependencies
  26127. */
  26128. // We only show the edit option when page count is <= MAX_PAGE_COUNT
  26129. // Performance of Navigation Links is not good past this value.
  26130. const edit_MAX_PAGE_COUNT = 100;
  26131. function PageListEdit(_ref) {
  26132. var _context$style;
  26133. let {
  26134. context,
  26135. clientId
  26136. } = _ref;
  26137. const {
  26138. pagesByParentId,
  26139. totalPages,
  26140. hasResolvedPages
  26141. } = usePageData();
  26142. const isNavigationChild = ('showSubmenuIcon' in context);
  26143. const allowConvertToLinks = isNavigationChild && totalPages <= edit_MAX_PAGE_COUNT;
  26144. const [isOpen, setOpen] = (0,external_wp_element_namespaceObject.useState)(false);
  26145. const openModal = () => setOpen(true);
  26146. const closeModal = () => setOpen(false);
  26147. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  26148. className: classnames_default()('wp-block-page-list', {
  26149. 'has-text-color': !!context.textColor,
  26150. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', context.textColor)]: !!context.textColor,
  26151. 'has-background': !!context.backgroundColor,
  26152. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', context.backgroundColor)]: !!context.backgroundColor
  26153. }),
  26154. style: { ...((_context$style = context.style) === null || _context$style === void 0 ? void 0 : _context$style.color)
  26155. }
  26156. });
  26157. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, allowConvertToLinks && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  26158. group: "other"
  26159. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  26160. title: (0,external_wp_i18n_namespaceObject.__)('Edit'),
  26161. onClick: openModal
  26162. }, (0,external_wp_i18n_namespaceObject.__)('Edit'))), allowConvertToLinks && isOpen && (0,external_wp_element_namespaceObject.createElement)(ConvertToLinksModal, {
  26163. onClose: closeModal,
  26164. clientId: clientId
  26165. }), !hasResolvedPages && (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)), hasResolvedPages && totalPages === null && (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
  26166. status: 'warning',
  26167. isDismissible: false
  26168. }, (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.')))), totalPages === 0 && (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
  26169. status: 'info',
  26170. isDismissible: false
  26171. }, (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.'))), totalPages > 0 && (0,external_wp_element_namespaceObject.createElement)("ul", blockProps, (0,external_wp_element_namespaceObject.createElement)(PageItems, {
  26172. context: context,
  26173. pagesByParentId: pagesByParentId
  26174. })));
  26175. }
  26176. function useFrontPageId() {
  26177. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  26178. const site = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', 'site');
  26179. return (site === null || site === void 0 ? void 0 : site.show_on_front) === 'page' && (site === null || site === void 0 ? void 0 : site.page_on_front);
  26180. }, []);
  26181. }
  26182. function usePageData() {
  26183. const {
  26184. records: pages,
  26185. hasResolved: hasResolvedPages
  26186. } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('postType', 'page', {
  26187. orderby: 'menu_order',
  26188. order: 'asc',
  26189. _fields: ['id', 'link', 'parent', 'title', 'menu_order'],
  26190. per_page: -1
  26191. });
  26192. return (0,external_wp_element_namespaceObject.useMemo)(() => {
  26193. var _pages$length;
  26194. // TODO: Once the REST API supports passing multiple values to
  26195. // 'orderby', this can be removed.
  26196. // https://core.trac.wordpress.org/ticket/39037
  26197. const sortedPages = (0,external_lodash_namespaceObject.sortBy)(pages, ['menu_order', 'title.rendered']);
  26198. const pagesByParentId = sortedPages.reduce((accumulator, page) => {
  26199. const {
  26200. parent
  26201. } = page;
  26202. if (accumulator.has(parent)) {
  26203. accumulator.get(parent).push(page);
  26204. } else {
  26205. accumulator.set(parent, [page]);
  26206. }
  26207. return accumulator;
  26208. }, new Map());
  26209. return {
  26210. pagesByParentId,
  26211. hasResolvedPages,
  26212. totalPages: (_pages$length = pages === null || pages === void 0 ? void 0 : pages.length) !== null && _pages$length !== void 0 ? _pages$length : null
  26213. };
  26214. }, [pages, hasResolvedPages]);
  26215. }
  26216. const PageItems = (0,external_wp_element_namespaceObject.memo)(function PageItems(_ref2) {
  26217. let {
  26218. context,
  26219. pagesByParentId,
  26220. parentId = 0,
  26221. depth = 0
  26222. } = _ref2;
  26223. const pages = pagesByParentId.get(parentId);
  26224. const frontPageId = useFrontPageId();
  26225. if (!(pages !== null && pages !== void 0 && pages.length)) {
  26226. return [];
  26227. }
  26228. return pages.map(page => {
  26229. var _page$title, _page$title2;
  26230. const hasChildren = pagesByParentId.has(page.id);
  26231. const isNavigationChild = ('showSubmenuIcon' in context);
  26232. return (0,external_wp_element_namespaceObject.createElement)("li", {
  26233. key: page.id,
  26234. className: classnames_default()('wp-block-pages-list__item', {
  26235. 'has-child': hasChildren,
  26236. 'wp-block-navigation-item': isNavigationChild,
  26237. 'open-on-click': context.openSubmenusOnClick,
  26238. 'open-on-hover-click': !context.openSubmenusOnClick && context.showSubmenuIcon,
  26239. 'menu-item-home': page.id === frontPageId
  26240. })
  26241. }, hasChildren && context.openSubmenusOnClick ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("button", {
  26242. className: "wp-block-navigation-item__content wp-block-navigation-submenu__toggle",
  26243. "aria-expanded": "false"
  26244. }, (_page$title = page.title) === null || _page$title === void 0 ? void 0 : _page$title.rendered), (0,external_wp_element_namespaceObject.createElement)("span", {
  26245. className: "wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"
  26246. }, (0,external_wp_element_namespaceObject.createElement)(icons_ItemSubmenuIcon, null))) : (0,external_wp_element_namespaceObject.createElement)("a", {
  26247. className: classnames_default()('wp-block-pages-list__item__link', {
  26248. 'wp-block-navigation-item__content': isNavigationChild
  26249. }),
  26250. href: page.link
  26251. }, (_page$title2 = page.title) === null || _page$title2 === void 0 ? void 0 : _page$title2.rendered), hasChildren && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !context.openSubmenusOnClick && context.showSubmenuIcon && (0,external_wp_element_namespaceObject.createElement)("button", {
  26252. className: "wp-block-navigation-item__content wp-block-navigation-submenu__toggle wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon",
  26253. "aria-expanded": "false"
  26254. }, (0,external_wp_element_namespaceObject.createElement)(icons_ItemSubmenuIcon, null)), (0,external_wp_element_namespaceObject.createElement)("ul", {
  26255. className: classnames_default()('submenu-container', {
  26256. 'wp-block-navigation__submenu-container': isNavigationChild
  26257. })
  26258. }, (0,external_wp_element_namespaceObject.createElement)(PageItems, {
  26259. context: context,
  26260. pagesByParentId: pagesByParentId,
  26261. parentId: page.id,
  26262. depth: depth + 1
  26263. }))));
  26264. });
  26265. });
  26266. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/index.js
  26267. /**
  26268. * WordPress dependencies
  26269. */
  26270. /**
  26271. * Internal dependencies
  26272. */
  26273. const page_list_metadata = {
  26274. $schema: "https://schemas.wp.org/trunk/block.json",
  26275. apiVersion: 2,
  26276. name: "core/page-list",
  26277. title: "Page List",
  26278. category: "widgets",
  26279. description: "Display a list of all pages.",
  26280. keywords: ["menu", "navigation"],
  26281. textdomain: "default",
  26282. attributes: {
  26283. __unstableMaxPages: {
  26284. type: "number"
  26285. }
  26286. },
  26287. usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "style", "openSubmenusOnClick"],
  26288. supports: {
  26289. reusable: false,
  26290. html: false
  26291. },
  26292. editorStyle: "wp-block-page-list-editor",
  26293. style: "wp-block-page-list"
  26294. };
  26295. const {
  26296. name: page_list_name
  26297. } = page_list_metadata;
  26298. const page_list_settings = {
  26299. icon: library_pages,
  26300. example: {},
  26301. edit: PageListEdit
  26302. };
  26303. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/paragraph.js
  26304. /**
  26305. * WordPress dependencies
  26306. */
  26307. const paragraph = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  26308. xmlns: "http://www.w3.org/2000/svg",
  26309. viewBox: "0 0 24 24"
  26310. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  26311. d: "M18.3 4H9.9v-.1l-.9.2c-2.3.4-4 2.4-4 4.8s1.7 4.4 4 4.8l.7.1V20h1.5V5.5h2.9V20h1.5V5.5h2.7V4z"
  26312. }));
  26313. /* harmony default export */ var library_paragraph = (paragraph);
  26314. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/deprecated.js
  26315. /**
  26316. * External dependencies
  26317. */
  26318. /**
  26319. * WordPress dependencies
  26320. */
  26321. const deprecated_supports = {
  26322. className: false
  26323. };
  26324. const paragraph_deprecated_blockAttributes = {
  26325. align: {
  26326. type: 'string'
  26327. },
  26328. content: {
  26329. type: 'string',
  26330. source: 'html',
  26331. selector: 'p',
  26332. default: ''
  26333. },
  26334. dropCap: {
  26335. type: 'boolean',
  26336. default: false
  26337. },
  26338. placeholder: {
  26339. type: 'string'
  26340. },
  26341. textColor: {
  26342. type: 'string'
  26343. },
  26344. backgroundColor: {
  26345. type: 'string'
  26346. },
  26347. fontSize: {
  26348. type: 'string'
  26349. },
  26350. direction: {
  26351. type: 'string',
  26352. enum: ['ltr', 'rtl']
  26353. },
  26354. style: {
  26355. type: 'object'
  26356. }
  26357. };
  26358. const migrateCustomColorsAndFontSizes = attributes => {
  26359. if (!attributes.customTextColor && !attributes.customBackgroundColor && !attributes.customFontSize) {
  26360. return attributes;
  26361. }
  26362. const style = {};
  26363. if (attributes.customTextColor || attributes.customBackgroundColor) {
  26364. style.color = {};
  26365. }
  26366. if (attributes.customTextColor) {
  26367. style.color.text = attributes.customTextColor;
  26368. }
  26369. if (attributes.customBackgroundColor) {
  26370. style.color.background = attributes.customBackgroundColor;
  26371. }
  26372. if (attributes.customFontSize) {
  26373. style.typography = {
  26374. fontSize: attributes.customFontSize
  26375. };
  26376. }
  26377. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor', 'customBackgroundColor', 'customFontSize']),
  26378. style
  26379. };
  26380. };
  26381. const paragraph_deprecated_deprecated = [{
  26382. supports: deprecated_supports,
  26383. attributes: { ...(0,external_lodash_namespaceObject.omit)(paragraph_deprecated_blockAttributes, ['style']),
  26384. customTextColor: {
  26385. type: 'string'
  26386. },
  26387. customBackgroundColor: {
  26388. type: 'string'
  26389. },
  26390. customFontSize: {
  26391. type: 'number'
  26392. }
  26393. },
  26394. migrate: migrateCustomColorsAndFontSizes,
  26395. save(_ref) {
  26396. let {
  26397. attributes
  26398. } = _ref;
  26399. const {
  26400. align,
  26401. content,
  26402. dropCap,
  26403. backgroundColor,
  26404. textColor,
  26405. customBackgroundColor,
  26406. customTextColor,
  26407. fontSize,
  26408. customFontSize,
  26409. direction
  26410. } = attributes;
  26411. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  26412. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  26413. const fontSizeClass = (0,external_wp_blockEditor_namespaceObject.getFontSizeClass)(fontSize);
  26414. const className = classnames_default()({
  26415. 'has-text-color': textColor || customTextColor,
  26416. 'has-background': backgroundColor || customBackgroundColor,
  26417. 'has-drop-cap': dropCap,
  26418. [`has-text-align-${align}`]: align,
  26419. [fontSizeClass]: fontSizeClass,
  26420. [textClass]: textClass,
  26421. [backgroundClass]: backgroundClass
  26422. });
  26423. const styles = {
  26424. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  26425. color: textClass ? undefined : customTextColor,
  26426. fontSize: fontSizeClass ? undefined : customFontSize
  26427. };
  26428. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  26429. tagName: "p",
  26430. style: styles,
  26431. className: className ? className : undefined,
  26432. value: content,
  26433. dir: direction
  26434. });
  26435. }
  26436. }, {
  26437. supports: deprecated_supports,
  26438. attributes: { ...(0,external_lodash_namespaceObject.omit)(paragraph_deprecated_blockAttributes, ['style']),
  26439. customTextColor: {
  26440. type: 'string'
  26441. },
  26442. customBackgroundColor: {
  26443. type: 'string'
  26444. },
  26445. customFontSize: {
  26446. type: 'number'
  26447. }
  26448. },
  26449. migrate: migrateCustomColorsAndFontSizes,
  26450. save(_ref2) {
  26451. let {
  26452. attributes
  26453. } = _ref2;
  26454. const {
  26455. align,
  26456. content,
  26457. dropCap,
  26458. backgroundColor,
  26459. textColor,
  26460. customBackgroundColor,
  26461. customTextColor,
  26462. fontSize,
  26463. customFontSize,
  26464. direction
  26465. } = attributes;
  26466. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  26467. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  26468. const fontSizeClass = (0,external_wp_blockEditor_namespaceObject.getFontSizeClass)(fontSize);
  26469. const className = classnames_default()({
  26470. 'has-text-color': textColor || customTextColor,
  26471. 'has-background': backgroundColor || customBackgroundColor,
  26472. 'has-drop-cap': dropCap,
  26473. [fontSizeClass]: fontSizeClass,
  26474. [textClass]: textClass,
  26475. [backgroundClass]: backgroundClass
  26476. });
  26477. const styles = {
  26478. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  26479. color: textClass ? undefined : customTextColor,
  26480. fontSize: fontSizeClass ? undefined : customFontSize,
  26481. textAlign: align
  26482. };
  26483. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  26484. tagName: "p",
  26485. style: styles,
  26486. className: className ? className : undefined,
  26487. value: content,
  26488. dir: direction
  26489. });
  26490. }
  26491. }, {
  26492. supports: deprecated_supports,
  26493. attributes: { ...(0,external_lodash_namespaceObject.omit)(paragraph_deprecated_blockAttributes, ['style']),
  26494. customTextColor: {
  26495. type: 'string'
  26496. },
  26497. customBackgroundColor: {
  26498. type: 'string'
  26499. },
  26500. customFontSize: {
  26501. type: 'number'
  26502. },
  26503. width: {
  26504. type: 'string'
  26505. }
  26506. },
  26507. migrate: migrateCustomColorsAndFontSizes,
  26508. save(_ref3) {
  26509. let {
  26510. attributes
  26511. } = _ref3;
  26512. const {
  26513. width,
  26514. align,
  26515. content,
  26516. dropCap,
  26517. backgroundColor,
  26518. textColor,
  26519. customBackgroundColor,
  26520. customTextColor,
  26521. fontSize,
  26522. customFontSize
  26523. } = attributes;
  26524. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  26525. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  26526. const fontSizeClass = fontSize && `is-${fontSize}-text`;
  26527. const className = classnames_default()({
  26528. [`align${width}`]: width,
  26529. 'has-background': backgroundColor || customBackgroundColor,
  26530. 'has-drop-cap': dropCap,
  26531. [fontSizeClass]: fontSizeClass,
  26532. [textClass]: textClass,
  26533. [backgroundClass]: backgroundClass
  26534. });
  26535. const styles = {
  26536. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  26537. color: textClass ? undefined : customTextColor,
  26538. fontSize: fontSizeClass ? undefined : customFontSize,
  26539. textAlign: align
  26540. };
  26541. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  26542. tagName: "p",
  26543. style: styles,
  26544. className: className ? className : undefined,
  26545. value: content
  26546. });
  26547. }
  26548. }, {
  26549. supports: deprecated_supports,
  26550. attributes: (0,external_lodash_namespaceObject.omit)({ ...paragraph_deprecated_blockAttributes,
  26551. fontSize: {
  26552. type: 'number'
  26553. }
  26554. }, ['style']),
  26555. save(_ref4) {
  26556. let {
  26557. attributes
  26558. } = _ref4;
  26559. const {
  26560. width,
  26561. align,
  26562. content,
  26563. dropCap,
  26564. backgroundColor,
  26565. textColor,
  26566. fontSize
  26567. } = attributes;
  26568. const className = classnames_default()({
  26569. [`align${width}`]: width,
  26570. 'has-background': backgroundColor,
  26571. 'has-drop-cap': dropCap
  26572. });
  26573. const styles = {
  26574. backgroundColor,
  26575. color: textColor,
  26576. fontSize,
  26577. textAlign: align
  26578. };
  26579. return (0,external_wp_element_namespaceObject.createElement)("p", {
  26580. style: styles,
  26581. className: className ? className : undefined
  26582. }, content);
  26583. },
  26584. migrate(attributes) {
  26585. return migrateCustomColorsAndFontSizes((0,external_lodash_namespaceObject.omit)({ ...attributes,
  26586. customFontSize: (0,external_lodash_namespaceObject.isFinite)(attributes.fontSize) ? attributes.fontSize : undefined,
  26587. customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined,
  26588. customBackgroundColor: attributes.backgroundColor && '#' === attributes.backgroundColor[0] ? attributes.backgroundColor : undefined
  26589. }), ['fontSize', 'textColor', 'backgroundColor', 'style']);
  26590. }
  26591. }, {
  26592. supports: deprecated_supports,
  26593. attributes: { ...paragraph_deprecated_blockAttributes,
  26594. content: {
  26595. type: 'string',
  26596. source: 'html',
  26597. default: ''
  26598. }
  26599. },
  26600. save(_ref5) {
  26601. let {
  26602. attributes
  26603. } = _ref5;
  26604. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.content);
  26605. },
  26606. migrate(attributes) {
  26607. return attributes;
  26608. }
  26609. }];
  26610. /* harmony default export */ var paragraph_deprecated = (paragraph_deprecated_deprecated);
  26611. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-ltr.js
  26612. /**
  26613. * WordPress dependencies
  26614. */
  26615. const formatLtr = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  26616. xmlns: "http://www.w3.org/2000/svg",
  26617. viewBox: "-2 -2 24 24"
  26618. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  26619. d: "M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z"
  26620. }));
  26621. /* harmony default export */ var format_ltr = (formatLtr);
  26622. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/edit.js
  26623. /**
  26624. * External dependencies
  26625. */
  26626. /**
  26627. * WordPress dependencies
  26628. */
  26629. const paragraph_edit_name = 'core/paragraph';
  26630. function ParagraphRTLControl(_ref) {
  26631. let {
  26632. direction,
  26633. setDirection
  26634. } = _ref;
  26635. return (0,external_wp_i18n_namespaceObject.isRTL)() && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
  26636. controls: [{
  26637. icon: format_ltr,
  26638. title: (0,external_wp_i18n_namespaceObject._x)('Left to right', 'editor button'),
  26639. isActive: direction === 'ltr',
  26640. onClick() {
  26641. setDirection(direction === 'ltr' ? undefined : 'ltr');
  26642. }
  26643. }]
  26644. });
  26645. }
  26646. function ParagraphBlock(_ref2) {
  26647. let {
  26648. attributes,
  26649. mergeBlocks,
  26650. onReplace,
  26651. onRemove,
  26652. setAttributes,
  26653. clientId
  26654. } = _ref2;
  26655. const {
  26656. align,
  26657. content,
  26658. direction,
  26659. dropCap,
  26660. placeholder
  26661. } = attributes;
  26662. const isDropCapFeatureEnabled = (0,external_wp_blockEditor_namespaceObject.useSetting)('typography.dropCap');
  26663. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  26664. className: classnames_default()({
  26665. 'has-drop-cap': dropCap,
  26666. [`has-text-align-${align}`]: align
  26667. }),
  26668. style: {
  26669. direction
  26670. }
  26671. });
  26672. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  26673. group: "block"
  26674. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  26675. value: align,
  26676. onChange: newAlign => setAttributes({
  26677. align: newAlign
  26678. })
  26679. }), (0,external_wp_element_namespaceObject.createElement)(ParagraphRTLControl, {
  26680. direction: direction,
  26681. setDirection: newDirection => setAttributes({
  26682. direction: newDirection
  26683. })
  26684. })), isDropCapFeatureEnabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  26685. __experimentalGroup: "typography"
  26686. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  26687. hasValue: () => !!dropCap,
  26688. label: (0,external_wp_i18n_namespaceObject.__)('Drop cap'),
  26689. onDeselect: () => setAttributes({
  26690. dropCap: undefined
  26691. }),
  26692. resetAllFilter: () => ({
  26693. dropCap: undefined
  26694. }),
  26695. panelId: clientId
  26696. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  26697. label: (0,external_wp_i18n_namespaceObject.__)('Drop cap'),
  26698. checked: !!dropCap,
  26699. onChange: () => setAttributes({
  26700. dropCap: !dropCap
  26701. }),
  26702. help: dropCap ? (0,external_wp_i18n_namespaceObject.__)('Showing large initial letter.') : (0,external_wp_i18n_namespaceObject.__)('Toggle to show a large initial letter.')
  26703. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  26704. identifier: "content",
  26705. tagName: "p"
  26706. }, blockProps, {
  26707. value: content,
  26708. onChange: newContent => setAttributes({
  26709. content: newContent
  26710. }),
  26711. onSplit: (value, isOriginal) => {
  26712. let newAttributes;
  26713. if (isOriginal || value) {
  26714. newAttributes = { ...attributes,
  26715. content: value
  26716. };
  26717. }
  26718. const block = (0,external_wp_blocks_namespaceObject.createBlock)(paragraph_edit_name, newAttributes);
  26719. if (isOriginal) {
  26720. block.clientId = clientId;
  26721. }
  26722. return block;
  26723. },
  26724. onMerge: mergeBlocks,
  26725. onReplace: onReplace,
  26726. onRemove: onRemove,
  26727. "aria-label": content ? (0,external_wp_i18n_namespaceObject.__)('Paragraph block') : (0,external_wp_i18n_namespaceObject.__)('Empty block; start writing or type forward slash to choose a block'),
  26728. "data-empty": content ? false : true,
  26729. placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Type / to choose a block'),
  26730. __unstableEmbedURLOnPaste: true,
  26731. __unstableAllowPrefixTransformations: true
  26732. })));
  26733. }
  26734. /* harmony default export */ var paragraph_edit = (ParagraphBlock);
  26735. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/save.js
  26736. /**
  26737. * External dependencies
  26738. */
  26739. /**
  26740. * WordPress dependencies
  26741. */
  26742. function paragraph_save_save(_ref) {
  26743. let {
  26744. attributes
  26745. } = _ref;
  26746. const {
  26747. align,
  26748. content,
  26749. dropCap,
  26750. direction
  26751. } = attributes;
  26752. const className = classnames_default()({
  26753. 'has-drop-cap': dropCap,
  26754. [`has-text-align-${align}`]: align
  26755. });
  26756. return (0,external_wp_element_namespaceObject.createElement)("p", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  26757. className,
  26758. dir: direction
  26759. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  26760. value: content
  26761. }));
  26762. }
  26763. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/transforms.js
  26764. /**
  26765. * WordPress dependencies
  26766. */
  26767. /**
  26768. * Internal dependencies
  26769. */
  26770. const {
  26771. name: paragraph_transforms_name
  26772. } = {
  26773. $schema: "https://schemas.wp.org/trunk/block.json",
  26774. apiVersion: 2,
  26775. name: "core/paragraph",
  26776. title: "Paragraph",
  26777. category: "text",
  26778. description: "Start with the basic building block of all narrative.",
  26779. keywords: ["text"],
  26780. textdomain: "default",
  26781. attributes: {
  26782. align: {
  26783. type: "string"
  26784. },
  26785. content: {
  26786. type: "string",
  26787. source: "html",
  26788. selector: "p",
  26789. "default": "",
  26790. __experimentalRole: "content"
  26791. },
  26792. dropCap: {
  26793. type: "boolean",
  26794. "default": false
  26795. },
  26796. placeholder: {
  26797. type: "string"
  26798. },
  26799. direction: {
  26800. type: "string",
  26801. "enum": ["ltr", "rtl"]
  26802. }
  26803. },
  26804. supports: {
  26805. anchor: true,
  26806. className: false,
  26807. color: {
  26808. link: true,
  26809. __experimentalDefaultControls: {
  26810. background: true,
  26811. text: true
  26812. }
  26813. },
  26814. typography: {
  26815. fontSize: true,
  26816. lineHeight: true,
  26817. __experimentalFontStyle: true,
  26818. __experimentalFontWeight: true,
  26819. __experimentalLetterSpacing: true,
  26820. __experimentalTextTransform: true,
  26821. __experimentalDefaultControls: {
  26822. fontSize: true
  26823. }
  26824. },
  26825. __experimentalSelector: "p",
  26826. __unstablePasteTextInline: true
  26827. },
  26828. editorStyle: "wp-block-paragraph-editor",
  26829. style: "wp-block-paragraph"
  26830. };
  26831. const paragraph_transforms_transforms = {
  26832. from: [{
  26833. type: 'raw',
  26834. // Paragraph is a fallback and should be matched last.
  26835. priority: 20,
  26836. selector: 'p',
  26837. schema: _ref => {
  26838. let {
  26839. phrasingContentSchema,
  26840. isPaste
  26841. } = _ref;
  26842. return {
  26843. p: {
  26844. children: phrasingContentSchema,
  26845. attributes: isPaste ? [] : ['style', 'id']
  26846. }
  26847. };
  26848. },
  26849. transform(node) {
  26850. const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)(paragraph_transforms_name, node.outerHTML);
  26851. const {
  26852. textAlign
  26853. } = node.style || {};
  26854. if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') {
  26855. attributes.align = textAlign;
  26856. }
  26857. return (0,external_wp_blocks_namespaceObject.createBlock)(paragraph_transforms_name, attributes);
  26858. }
  26859. }]
  26860. };
  26861. /* harmony default export */ var paragraph_transforms = (paragraph_transforms_transforms);
  26862. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js
  26863. /**
  26864. * External dependencies
  26865. */
  26866. /**
  26867. * WordPress dependencies
  26868. */
  26869. /**
  26870. * Internal dependencies
  26871. */
  26872. const paragraph_metadata = {
  26873. $schema: "https://schemas.wp.org/trunk/block.json",
  26874. apiVersion: 2,
  26875. name: "core/paragraph",
  26876. title: "Paragraph",
  26877. category: "text",
  26878. description: "Start with the basic building block of all narrative.",
  26879. keywords: ["text"],
  26880. textdomain: "default",
  26881. attributes: {
  26882. align: {
  26883. type: "string"
  26884. },
  26885. content: {
  26886. type: "string",
  26887. source: "html",
  26888. selector: "p",
  26889. "default": "",
  26890. __experimentalRole: "content"
  26891. },
  26892. dropCap: {
  26893. type: "boolean",
  26894. "default": false
  26895. },
  26896. placeholder: {
  26897. type: "string"
  26898. },
  26899. direction: {
  26900. type: "string",
  26901. "enum": ["ltr", "rtl"]
  26902. }
  26903. },
  26904. supports: {
  26905. anchor: true,
  26906. className: false,
  26907. color: {
  26908. link: true,
  26909. __experimentalDefaultControls: {
  26910. background: true,
  26911. text: true
  26912. }
  26913. },
  26914. typography: {
  26915. fontSize: true,
  26916. lineHeight: true,
  26917. __experimentalFontStyle: true,
  26918. __experimentalFontWeight: true,
  26919. __experimentalLetterSpacing: true,
  26920. __experimentalTextTransform: true,
  26921. __experimentalDefaultControls: {
  26922. fontSize: true
  26923. }
  26924. },
  26925. __experimentalSelector: "p",
  26926. __unstablePasteTextInline: true
  26927. },
  26928. editorStyle: "wp-block-paragraph-editor",
  26929. style: "wp-block-paragraph"
  26930. };
  26931. const {
  26932. name: paragraph_name
  26933. } = paragraph_metadata;
  26934. const paragraph_settings = {
  26935. icon: library_paragraph,
  26936. example: {
  26937. attributes: {
  26938. content: (0,external_wp_i18n_namespaceObject.__)('In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'),
  26939. style: {
  26940. typography: {
  26941. fontSize: 28
  26942. }
  26943. },
  26944. dropCap: true
  26945. }
  26946. },
  26947. __experimentalLabel(attributes, _ref) {
  26948. let {
  26949. context
  26950. } = _ref;
  26951. if (context === 'accessibility') {
  26952. const {
  26953. content
  26954. } = attributes;
  26955. return (0,external_lodash_namespaceObject.isEmpty)(content) ? (0,external_wp_i18n_namespaceObject.__)('Empty') : content;
  26956. }
  26957. },
  26958. transforms: paragraph_transforms,
  26959. deprecated: paragraph_deprecated,
  26960. merge(attributes, attributesToMerge) {
  26961. return {
  26962. content: (attributes.content || '') + (attributesToMerge.content || '')
  26963. };
  26964. },
  26965. edit: paragraph_edit,
  26966. save: paragraph_save_save
  26967. };
  26968. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author/edit.js
  26969. /**
  26970. * External dependencies
  26971. */
  26972. /**
  26973. * WordPress dependencies
  26974. */
  26975. function PostAuthorEdit(_ref) {
  26976. let {
  26977. isSelected,
  26978. context: {
  26979. postType,
  26980. postId,
  26981. queryId
  26982. },
  26983. attributes,
  26984. setAttributes
  26985. } = _ref;
  26986. const isDescendentOfQueryLoop = Number.isFinite(queryId);
  26987. const {
  26988. authorId,
  26989. authorDetails,
  26990. authors
  26991. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  26992. var _getEditedEntityRecor;
  26993. const {
  26994. getEditedEntityRecord,
  26995. getUser,
  26996. getUsers
  26997. } = select(external_wp_coreData_namespaceObject.store);
  26998. const _authorId = (_getEditedEntityRecor = getEditedEntityRecord('postType', postType, postId)) === null || _getEditedEntityRecor === void 0 ? void 0 : _getEditedEntityRecor.author;
  26999. return {
  27000. authorId: _authorId,
  27001. authorDetails: _authorId ? getUser(_authorId) : null,
  27002. authors: getUsers({
  27003. who: 'authors'
  27004. })
  27005. };
  27006. }, [postType, postId]);
  27007. const {
  27008. editEntityRecord
  27009. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  27010. const {
  27011. textAlign,
  27012. showAvatar,
  27013. showBio,
  27014. byline
  27015. } = attributes;
  27016. const avatarSizes = [];
  27017. if (authorDetails) {
  27018. (0,external_lodash_namespaceObject.forEach)(authorDetails.avatar_urls, (url, size) => {
  27019. avatarSizes.push({
  27020. value: size,
  27021. label: `${size} x ${size}`
  27022. });
  27023. });
  27024. }
  27025. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  27026. className: classnames_default()({
  27027. [`has-text-align-${textAlign}`]: textAlign
  27028. })
  27029. });
  27030. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  27031. title: (0,external_wp_i18n_namespaceObject.__)('Author Settings')
  27032. }, !isDescendentOfQueryLoop && !!(authors !== null && authors !== void 0 && authors.length) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  27033. label: (0,external_wp_i18n_namespaceObject.__)('Author'),
  27034. value: authorId,
  27035. options: authors.map(_ref2 => {
  27036. let {
  27037. id,
  27038. name
  27039. } = _ref2;
  27040. return {
  27041. value: id,
  27042. label: name
  27043. };
  27044. }),
  27045. onChange: nextAuthorId => {
  27046. editEntityRecord('postType', postType, postId, {
  27047. author: nextAuthorId
  27048. });
  27049. }
  27050. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  27051. label: (0,external_wp_i18n_namespaceObject.__)('Show avatar'),
  27052. checked: showAvatar,
  27053. onChange: () => setAttributes({
  27054. showAvatar: !showAvatar
  27055. })
  27056. }), showAvatar && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  27057. label: (0,external_wp_i18n_namespaceObject.__)('Avatar size'),
  27058. value: attributes.avatarSize,
  27059. options: avatarSizes,
  27060. onChange: size => {
  27061. setAttributes({
  27062. avatarSize: Number(size)
  27063. });
  27064. }
  27065. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  27066. label: (0,external_wp_i18n_namespaceObject.__)('Show bio'),
  27067. checked: showBio,
  27068. onChange: () => setAttributes({
  27069. showBio: !showBio
  27070. })
  27071. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  27072. group: "block"
  27073. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  27074. value: textAlign,
  27075. onChange: nextAlign => {
  27076. setAttributes({
  27077. textAlign: nextAlign
  27078. });
  27079. }
  27080. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, showAvatar && authorDetails && (0,external_wp_element_namespaceObject.createElement)("div", {
  27081. className: "wp-block-post-author__avatar"
  27082. }, (0,external_wp_element_namespaceObject.createElement)("img", {
  27083. width: attributes.avatarSize,
  27084. src: authorDetails.avatar_urls[attributes.avatarSize],
  27085. alt: authorDetails.name
  27086. })), (0,external_wp_element_namespaceObject.createElement)("div", {
  27087. className: "wp-block-post-author__content"
  27088. }, (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(byline) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  27089. className: "wp-block-post-author__byline",
  27090. multiline: false,
  27091. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Post author byline text'),
  27092. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write byline…'),
  27093. value: byline,
  27094. onChange: value => setAttributes({
  27095. byline: value
  27096. })
  27097. }), (0,external_wp_element_namespaceObject.createElement)("p", {
  27098. className: "wp-block-post-author__name"
  27099. }, (authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.name) || (0,external_wp_i18n_namespaceObject.__)('Post Author')), showBio && (0,external_wp_element_namespaceObject.createElement)("p", {
  27100. className: "wp-block-post-author__bio"
  27101. }, authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.description))));
  27102. }
  27103. /* harmony default export */ var post_author_edit = (PostAuthorEdit);
  27104. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-author.js
  27105. /**
  27106. * WordPress dependencies
  27107. */
  27108. const postAuthor = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  27109. viewBox: "0 0 24 24",
  27110. xmlns: "http://www.w3.org/2000/svg"
  27111. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  27112. d: "M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z",
  27113. fillRule: "evenodd",
  27114. clipRule: "evenodd"
  27115. }));
  27116. /* harmony default export */ var post_author = (postAuthor);
  27117. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author/index.js
  27118. /**
  27119. * Internal dependencies
  27120. */
  27121. const post_author_metadata = {
  27122. $schema: "https://schemas.wp.org/trunk/block.json",
  27123. apiVersion: 2,
  27124. name: "core/post-author",
  27125. title: "Post Author",
  27126. category: "theme",
  27127. description: "Display post author details such as name, avatar, and bio.",
  27128. textdomain: "default",
  27129. attributes: {
  27130. textAlign: {
  27131. type: "string"
  27132. },
  27133. avatarSize: {
  27134. type: "number",
  27135. "default": 48
  27136. },
  27137. showAvatar: {
  27138. type: "boolean",
  27139. "default": true
  27140. },
  27141. showBio: {
  27142. type: "boolean"
  27143. },
  27144. byline: {
  27145. type: "string"
  27146. }
  27147. },
  27148. usesContext: ["postType", "postId", "queryId"],
  27149. supports: {
  27150. html: false,
  27151. spacing: {
  27152. margin: true,
  27153. padding: true
  27154. },
  27155. typography: {
  27156. fontSize: true,
  27157. lineHeight: true,
  27158. __experimentalFontStyle: true,
  27159. __experimentalFontWeight: true,
  27160. __experimentalLetterSpacing: true,
  27161. __experimentalTextTransform: true,
  27162. __experimentalDefaultControls: {
  27163. fontSize: true
  27164. }
  27165. },
  27166. color: {
  27167. gradients: true,
  27168. link: true,
  27169. __experimentalDuotone: ".wp-block-post-author__avatar img",
  27170. __experimentalDefaultControls: {
  27171. background: true,
  27172. text: true
  27173. }
  27174. }
  27175. },
  27176. editorStyle: "wp-block-post-author-editor",
  27177. style: "wp-block-post-author"
  27178. };
  27179. /**
  27180. * WordPress dependencies
  27181. */
  27182. const {
  27183. name: post_author_name
  27184. } = post_author_metadata;
  27185. const post_author_settings = {
  27186. icon: post_author,
  27187. edit: post_author_edit
  27188. };
  27189. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author-biography/edit.js
  27190. /**
  27191. * External dependencies
  27192. */
  27193. /**
  27194. * WordPress dependencies
  27195. */
  27196. function PostAuthorBiographyEdit(_ref) {
  27197. let {
  27198. context: {
  27199. postType,
  27200. postId
  27201. },
  27202. attributes: {
  27203. textAlign
  27204. },
  27205. setAttributes
  27206. } = _ref;
  27207. const {
  27208. authorDetails
  27209. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  27210. var _getEditedEntityRecor;
  27211. const {
  27212. getEditedEntityRecord,
  27213. getUser
  27214. } = select(external_wp_coreData_namespaceObject.store);
  27215. const _authorId = (_getEditedEntityRecor = getEditedEntityRecord('postType', postType, postId)) === null || _getEditedEntityRecor === void 0 ? void 0 : _getEditedEntityRecor.author;
  27216. return {
  27217. authorDetails: _authorId ? getUser(_authorId) : null
  27218. };
  27219. }, [postType, postId]);
  27220. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  27221. className: classnames_default()({
  27222. [`has-text-align-${textAlign}`]: textAlign
  27223. })
  27224. });
  27225. const displayAuthorBiography = (authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.description) || (0,external_wp_i18n_namespaceObject.__)('Author Biography');
  27226. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  27227. group: "block"
  27228. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  27229. value: textAlign,
  27230. onChange: nextAlign => {
  27231. setAttributes({
  27232. textAlign: nextAlign
  27233. });
  27234. }
  27235. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, " ", displayAuthorBiography, " "));
  27236. }
  27237. /* harmony default export */ var post_author_biography_edit = (PostAuthorBiographyEdit);
  27238. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author-biography/index.js
  27239. /**
  27240. * Internal dependencies
  27241. */
  27242. const post_author_biography_metadata = {
  27243. $schema: "https://schemas.wp.org/trunk/block.json",
  27244. apiVersion: 2,
  27245. name: "core/post-author-biography",
  27246. title: "Post Author Biography",
  27247. category: "theme",
  27248. description: "The author biography.",
  27249. textdomain: "default",
  27250. attributes: {
  27251. textAlign: {
  27252. type: "string"
  27253. }
  27254. },
  27255. usesContext: ["postType", "postId"],
  27256. supports: {
  27257. spacing: {
  27258. margin: true,
  27259. padding: true
  27260. },
  27261. color: {
  27262. gradients: true,
  27263. link: true,
  27264. __experimentalDefaultControls: {
  27265. background: true,
  27266. text: true
  27267. }
  27268. },
  27269. typography: {
  27270. fontSize: true,
  27271. lineHeight: true,
  27272. __experimentalFontFamily: true,
  27273. __experimentalFontWeight: true,
  27274. __experimentalFontStyle: true,
  27275. __experimentalTextTransform: true,
  27276. __experimentalLetterSpacing: true,
  27277. __experimentalDefaultControls: {
  27278. fontSize: true
  27279. }
  27280. }
  27281. }
  27282. };
  27283. /**
  27284. * WordPress dependencies
  27285. */
  27286. const {
  27287. name: post_author_biography_name
  27288. } = post_author_biography_metadata;
  27289. const post_author_biography_settings = {
  27290. icon: post_author,
  27291. edit: post_author_biography_edit
  27292. };
  27293. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-form/form.js
  27294. /**
  27295. * WordPress dependencies
  27296. */
  27297. const CommentsForm = () => {
  27298. const disabledFormRef = (0,external_wp_compose_namespaceObject.__experimentalUseDisabled)();
  27299. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(CommentsForm);
  27300. return (0,external_wp_element_namespaceObject.createElement)("div", {
  27301. className: "comment-respond"
  27302. }, (0,external_wp_element_namespaceObject.createElement)("h3", {
  27303. className: "comment-reply-title"
  27304. }, (0,external_wp_i18n_namespaceObject.__)('Leave a Reply')), (0,external_wp_element_namespaceObject.createElement)("form", {
  27305. noValidate: true,
  27306. className: "comment-form",
  27307. ref: disabledFormRef
  27308. }, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_element_namespaceObject.createElement)("label", {
  27309. htmlFor: `comment-${instanceId}`
  27310. }, (0,external_wp_i18n_namespaceObject.__)('Comment')), (0,external_wp_element_namespaceObject.createElement)("textarea", {
  27311. id: `comment-${instanceId}`,
  27312. name: "comment",
  27313. cols: "45",
  27314. rows: "8"
  27315. })), (0,external_wp_element_namespaceObject.createElement)("p", {
  27316. className: "form-submit wp-block-button"
  27317. }, (0,external_wp_element_namespaceObject.createElement)("input", {
  27318. name: "submit",
  27319. type: "submit",
  27320. className: "submit wp-block-button__link",
  27321. label: (0,external_wp_i18n_namespaceObject.__)('Post Comment'),
  27322. value: (0,external_wp_i18n_namespaceObject.__)('Post Comment')
  27323. }))));
  27324. };
  27325. /* harmony default export */ var post_comments_form_form = (CommentsForm);
  27326. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments/edit.js
  27327. /**
  27328. * External dependencies
  27329. */
  27330. /**
  27331. * WordPress dependencies
  27332. */
  27333. /**
  27334. * Internal dependencies
  27335. */
  27336. function PostCommentsEdit(_ref) {
  27337. let {
  27338. attributes: {
  27339. textAlign
  27340. },
  27341. setAttributes,
  27342. context: {
  27343. postType,
  27344. postId
  27345. }
  27346. } = _ref;
  27347. let [postTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
  27348. postTitle = postTitle || (0,external_wp_i18n_namespaceObject.__)('Post Title');
  27349. const [commentStatus] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'comment_status', postId);
  27350. const {
  27351. avatarURL,
  27352. defaultCommentStatus
  27353. } = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalDiscussionSettings);
  27354. const isSiteEditor = postType === undefined || postId === undefined;
  27355. const postTypeSupportsComments = (0,external_wp_data_namespaceObject.useSelect)(select => {
  27356. var _select$getPostType;
  27357. return postType ? !!((_select$getPostType = select(external_wp_coreData_namespaceObject.store).getPostType(postType)) !== null && _select$getPostType !== void 0 && _select$getPostType.supports.comments) : false;
  27358. });
  27359. let warning = (0,external_wp_i18n_namespaceObject.__)('Post Comments block: This is just a placeholder, not a real comment. The final styling may differ because it also depends on the current theme. For better compatibility with the Block Editor, please consider replacing this block with the "Comments Query Loop" block.');
  27360. let showPlaceholder = true;
  27361. if (!isSiteEditor && 'open' !== commentStatus) {
  27362. if ('closed' === commentStatus) {
  27363. warning = (0,external_wp_i18n_namespaceObject.sprintf)(
  27364. /* translators: 1: Post type (i.e. "post", "page") */
  27365. (0,external_wp_i18n_namespaceObject.__)('Post Comments block: Comments to this %s are not allowed.'), postType);
  27366. showPlaceholder = false;
  27367. } else if (!postTypeSupportsComments) {
  27368. warning = (0,external_wp_i18n_namespaceObject.sprintf)(
  27369. /* translators: 1: Post type (i.e. "post", "page") */
  27370. (0,external_wp_i18n_namespaceObject.__)('Post Comments block: Comments for this post type (%s) are not enabled.'), postType);
  27371. showPlaceholder = false;
  27372. } else if ('open' !== defaultCommentStatus) {
  27373. warning = (0,external_wp_i18n_namespaceObject.__)('Post Comments block: Comments are not enabled.');
  27374. showPlaceholder = false;
  27375. }
  27376. }
  27377. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  27378. className: classnames_default()({
  27379. [`has-text-align-${textAlign}`]: textAlign
  27380. })
  27381. });
  27382. const disabledRef = (0,external_wp_compose_namespaceObject.__experimentalUseDisabled)();
  27383. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  27384. group: "block"
  27385. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  27386. value: textAlign,
  27387. onChange: nextAlign => {
  27388. setAttributes({
  27389. textAlign: nextAlign
  27390. });
  27391. }
  27392. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, warning), showPlaceholder && (0,external_wp_element_namespaceObject.createElement)("div", {
  27393. className: "wp-block-post-comments__placeholder",
  27394. ref: disabledRef
  27395. }, (0,external_wp_element_namespaceObject.createElement)("h3", null,
  27396. /* translators: %s: Post title. */
  27397. (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('One response to %s'), postTitle)), (0,external_wp_element_namespaceObject.createElement)("div", {
  27398. className: "navigation"
  27399. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  27400. className: "alignleft"
  27401. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  27402. href: "#top"
  27403. }, "\xAB ", (0,external_wp_i18n_namespaceObject.__)('Older Comments'))), (0,external_wp_element_namespaceObject.createElement)("div", {
  27404. className: "alignright"
  27405. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  27406. href: "#top"
  27407. }, (0,external_wp_i18n_namespaceObject.__)('Newer Comments'), " \xBB"))), (0,external_wp_element_namespaceObject.createElement)("ol", {
  27408. className: "commentlist"
  27409. }, (0,external_wp_element_namespaceObject.createElement)("li", {
  27410. className: "comment even thread-even depth-1"
  27411. }, (0,external_wp_element_namespaceObject.createElement)("article", {
  27412. className: "comment-body"
  27413. }, (0,external_wp_element_namespaceObject.createElement)("footer", {
  27414. className: "comment-meta"
  27415. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  27416. className: "comment-author vcard"
  27417. }, (0,external_wp_element_namespaceObject.createElement)("img", {
  27418. alt: "Commenter Avatar",
  27419. src: avatarURL,
  27420. className: "avatar avatar-32 photo",
  27421. height: "32",
  27422. width: "32",
  27423. loading: "lazy"
  27424. }), (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(
  27425. /* translators: %s: Comment author link. */
  27426. (0,external_wp_i18n_namespaceObject.__)('%s <span>says:</span>'), (0,external_wp_i18n_namespaceObject.sprintf)('<cite><a>%s</a></cite>', (0,external_wp_i18n_namespaceObject.__)('A WordPress Commenter'))), {
  27427. span: (0,external_wp_element_namespaceObject.createElement)("span", {
  27428. className: "says"
  27429. }),
  27430. a:
  27431. /* eslint-disable jsx-a11y/anchor-has-content */
  27432. (0,external_wp_element_namespaceObject.createElement)("a", {
  27433. href: "#top",
  27434. className: "url"
  27435. })
  27436. /* eslint-enable jsx-a11y/anchor-has-content */
  27437. ,
  27438. cite: (0,external_wp_element_namespaceObject.createElement)("cite", {
  27439. className: "fn"
  27440. })
  27441. })), (0,external_wp_element_namespaceObject.createElement)("div", {
  27442. className: "comment-metadata"
  27443. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  27444. href: "#top"
  27445. }, (0,external_wp_element_namespaceObject.createElement)("time", {
  27446. dateTime: "2000-01-01T12:00:00+00:00"
  27447. }, (0,external_wp_i18n_namespaceObject.__)('January 1, 2000 at 12:00 am'))), ' ', (0,external_wp_element_namespaceObject.createElement)("span", {
  27448. className: "edit-link"
  27449. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  27450. className: "comment-edit-link",
  27451. href: "#top"
  27452. }, (0,external_wp_i18n_namespaceObject.__)('Edit'))))), (0,external_wp_element_namespaceObject.createElement)("div", {
  27453. className: "comment-content"
  27454. }, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Hi, this is a comment.'), (0,external_wp_element_namespaceObject.createElement)("br", null), (0,external_wp_i18n_namespaceObject.__)('To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'), (0,external_wp_element_namespaceObject.createElement)("br", null), (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Commenter avatars come from <a>Gravatar</a>'), {
  27455. a:
  27456. /* eslint-disable-next-line jsx-a11y/anchor-has-content */
  27457. (0,external_wp_element_namespaceObject.createElement)("a", {
  27458. href: "https://gravatar.com/"
  27459. })
  27460. }))), (0,external_wp_element_namespaceObject.createElement)("div", {
  27461. className: "reply"
  27462. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  27463. className: "comment-reply-link",
  27464. href: "#top",
  27465. "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
  27466. /* translators: Comment reply button text. %s: Comment author name. */
  27467. (0,external_wp_i18n_namespaceObject.__)('Reply to %s'), (0,external_wp_i18n_namespaceObject.__)('A WordPress Commenter'))
  27468. }, (0,external_wp_i18n_namespaceObject.__)('Reply')))))), (0,external_wp_element_namespaceObject.createElement)("div", {
  27469. className: "navigation"
  27470. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  27471. className: "alignleft"
  27472. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  27473. href: "#top"
  27474. }, "\xAB ", (0,external_wp_i18n_namespaceObject.__)('Older Comments'))), (0,external_wp_element_namespaceObject.createElement)("div", {
  27475. className: "alignright"
  27476. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  27477. href: "#top"
  27478. }, (0,external_wp_i18n_namespaceObject.__)('Newer Comments'), " \xBB"))), (0,external_wp_element_namespaceObject.createElement)(post_comments_form_form, null))));
  27479. }
  27480. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments/index.js
  27481. /**
  27482. * WordPress dependencies
  27483. */
  27484. /**
  27485. * Internal dependencies
  27486. */
  27487. const post_comments_metadata = {
  27488. $schema: "https://schemas.wp.org/trunk/block.json",
  27489. apiVersion: 2,
  27490. name: "core/post-comments",
  27491. title: "Post Comments (deprecated)",
  27492. category: "theme",
  27493. description: "This block is deprecated. Please use the Comments Query Loop block instead.",
  27494. textdomain: "default",
  27495. attributes: {
  27496. textAlign: {
  27497. type: "string"
  27498. }
  27499. },
  27500. usesContext: ["postId", "postType"],
  27501. supports: {
  27502. html: false,
  27503. align: ["wide", "full"],
  27504. typography: {
  27505. fontSize: true,
  27506. lineHeight: true,
  27507. __experimentalFontStyle: true,
  27508. __experimentalFontWeight: true,
  27509. __experimentalLetterSpacing: true,
  27510. __experimentalTextTransform: true,
  27511. __experimentalDefaultControls: {
  27512. fontSize: true
  27513. }
  27514. },
  27515. color: {
  27516. gradients: true,
  27517. link: true,
  27518. __experimentalDefaultControls: {
  27519. background: true,
  27520. text: true
  27521. }
  27522. },
  27523. inserter: false
  27524. },
  27525. style: ["wp-block-post-comments", "wp-block-buttons", "wp-block-button"],
  27526. editorStyle: "wp-block-post-comments-editor"
  27527. };
  27528. const {
  27529. name: post_comments_name
  27530. } = post_comments_metadata;
  27531. const post_comments_settings = {
  27532. icon: post_comments,
  27533. edit: PostCommentsEdit
  27534. };
  27535. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-comments-form.js
  27536. /**
  27537. * WordPress dependencies
  27538. */
  27539. const postCommentsForm = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  27540. xmlns: "http://www.w3.org/2000/svg",
  27541. viewBox: "0 0 24 24"
  27542. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  27543. d: "M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-.5 6.6H6.7l-1.2 1.2v-6.3h7v5.1z"
  27544. }));
  27545. /* harmony default export */ var post_comments_form = (postCommentsForm);
  27546. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-form/edit.js
  27547. /**
  27548. * External dependencies
  27549. */
  27550. /**
  27551. * WordPress dependencies
  27552. */
  27553. /**
  27554. * Internal dependencies
  27555. */
  27556. function PostCommentsFormEdit(_ref) {
  27557. let {
  27558. attributes,
  27559. context,
  27560. setAttributes
  27561. } = _ref;
  27562. const {
  27563. textAlign
  27564. } = attributes;
  27565. const {
  27566. postId,
  27567. postType
  27568. } = context;
  27569. const [commentStatus, setCommentStatus] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'comment_status', postId);
  27570. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  27571. className: classnames_default()({
  27572. [`has-text-align-${textAlign}`]: textAlign
  27573. })
  27574. });
  27575. const isSiteEditor = postType === undefined || postId === undefined;
  27576. const {
  27577. defaultCommentStatus
  27578. } = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalDiscussionSettings);
  27579. const postTypeSupportsComments = (0,external_wp_data_namespaceObject.useSelect)(select => {
  27580. var _select$getPostType;
  27581. return postType ? !!((_select$getPostType = select(external_wp_coreData_namespaceObject.store).getPostType(postType)) !== null && _select$getPostType !== void 0 && _select$getPostType.supports.comments) : false;
  27582. });
  27583. let warning = false;
  27584. let actions;
  27585. let showPlaceholder = true;
  27586. if (!isSiteEditor && 'open' !== commentStatus) {
  27587. if ('closed' === commentStatus) {
  27588. warning = (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled for this item.');
  27589. actions = [(0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  27590. key: "enableComments",
  27591. onClick: () => setCommentStatus('open'),
  27592. variant: "primary"
  27593. }, (0,external_wp_i18n_namespaceObject._x)('Enable comments', 'action that affects the current post'))];
  27594. showPlaceholder = false;
  27595. } else if (!postTypeSupportsComments) {
  27596. warning = (0,external_wp_i18n_namespaceObject.sprintf)(
  27597. /* translators: 1: Post type (i.e. "post", "page") */
  27598. (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled for this post type (%s).'), postType);
  27599. showPlaceholder = false;
  27600. } else if ('open' !== defaultCommentStatus) {
  27601. warning = (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled.');
  27602. showPlaceholder = false;
  27603. }
  27604. }
  27605. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  27606. group: "block"
  27607. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  27608. value: textAlign,
  27609. onChange: nextAlign => {
  27610. setAttributes({
  27611. textAlign: nextAlign
  27612. });
  27613. }
  27614. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, warning && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, {
  27615. actions: actions
  27616. }, warning), showPlaceholder ? (0,external_wp_element_namespaceObject.createElement)(post_comments_form_form, null) : null));
  27617. }
  27618. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-form/index.js
  27619. /**
  27620. * WordPress dependencies
  27621. */
  27622. /**
  27623. * Internal dependencies
  27624. */
  27625. const post_comments_form_metadata = {
  27626. $schema: "https://schemas.wp.org/trunk/block.json",
  27627. apiVersion: 2,
  27628. name: "core/post-comments-form",
  27629. title: "Post Comments Form",
  27630. category: "theme",
  27631. description: "Display a post's comments form.",
  27632. textdomain: "default",
  27633. attributes: {
  27634. textAlign: {
  27635. type: "string"
  27636. }
  27637. },
  27638. usesContext: ["postId", "postType"],
  27639. supports: {
  27640. html: false,
  27641. color: {
  27642. gradients: true,
  27643. link: true,
  27644. __experimentalDefaultControls: {
  27645. background: true,
  27646. text: true
  27647. }
  27648. },
  27649. typography: {
  27650. fontSize: true,
  27651. lineHeight: true,
  27652. __experimentalFontStyle: true,
  27653. __experimentalFontWeight: true,
  27654. __experimentalLetterSpacing: true,
  27655. __experimentalTextTransform: true,
  27656. __experimentalDefaultControls: {
  27657. fontSize: true
  27658. }
  27659. }
  27660. },
  27661. editorStyle: "wp-block-post-comments-form-editor",
  27662. style: ["wp-block-post-comments-form", "wp-block-buttons", "wp-block-button"]
  27663. };
  27664. const {
  27665. name: post_comments_form_name
  27666. } = post_comments_form_metadata;
  27667. const post_comments_form_settings = {
  27668. icon: post_comments_form,
  27669. edit: PostCommentsFormEdit
  27670. };
  27671. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-content.js
  27672. /**
  27673. * WordPress dependencies
  27674. */
  27675. const postContent = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  27676. xmlns: "https://www.w3.org/2000/svg",
  27677. viewBox: "0 0 24 24"
  27678. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  27679. d: "M4 20h16v-1.5H4V20zm0-4.8h16v-1.5H4v1.5zm0-6.4v1.5h16V8.8H4zM16 4H4v1.5h12V4z"
  27680. }));
  27681. /* harmony default export */ var post_content = (postContent);
  27682. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/hooks.js
  27683. /**
  27684. * WordPress dependencies
  27685. */
  27686. /**
  27687. * Returns whether the current user can edit the given entity.
  27688. *
  27689. * @param {string} kind Entity kind.
  27690. * @param {string} name Entity name.
  27691. * @param {string} recordId Record's id.
  27692. */
  27693. function useCanEditEntity(kind, name, recordId) {
  27694. return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).canUserEditEntityRecord(kind, name, recordId), [kind, name, recordId]);
  27695. }
  27696. /* harmony default export */ var hooks = ({
  27697. useCanEditEntity
  27698. });
  27699. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-content/edit.js
  27700. /**
  27701. * WordPress dependencies
  27702. */
  27703. /**
  27704. * Internal dependencies
  27705. */
  27706. function ReadOnlyContent(_ref) {
  27707. let {
  27708. userCanEdit,
  27709. postType,
  27710. postId
  27711. } = _ref;
  27712. const [,, content] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'content', postId);
  27713. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  27714. return content !== null && content !== void 0 && content.protected && !userCanEdit ? (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('This content is password protected.'))) : (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, {
  27715. dangerouslySetInnerHTML: {
  27716. __html: content === null || content === void 0 ? void 0 : content.rendered
  27717. }
  27718. }));
  27719. }
  27720. function EditableContent(_ref2) {
  27721. let {
  27722. layout,
  27723. context = {}
  27724. } = _ref2;
  27725. const {
  27726. postType,
  27727. postId
  27728. } = context;
  27729. const themeSupportsLayout = (0,external_wp_data_namespaceObject.useSelect)(select => {
  27730. var _getSettings;
  27731. const {
  27732. getSettings
  27733. } = select(external_wp_blockEditor_namespaceObject.store);
  27734. return (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout;
  27735. }, []);
  27736. const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
  27737. const usedLayout = !!layout && layout.inherit ? defaultLayout : layout;
  27738. const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType, {
  27739. id: postId
  27740. });
  27741. const props = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)((0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  27742. className: 'entry-content'
  27743. }), {
  27744. value: blocks,
  27745. onInput,
  27746. onChange,
  27747. __experimentalLayout: themeSupportsLayout ? usedLayout : undefined
  27748. });
  27749. return (0,external_wp_element_namespaceObject.createElement)("div", props);
  27750. }
  27751. function Content(props) {
  27752. const {
  27753. context: {
  27754. queryId,
  27755. postType,
  27756. postId
  27757. } = {}
  27758. } = props;
  27759. const isDescendentOfQueryLoop = Number.isFinite(queryId);
  27760. const userCanEdit = useCanEditEntity('postType', postType, postId);
  27761. const isEditable = userCanEdit && !isDescendentOfQueryLoop;
  27762. return isEditable ? (0,external_wp_element_namespaceObject.createElement)(EditableContent, props) : (0,external_wp_element_namespaceObject.createElement)(ReadOnlyContent, {
  27763. userCanEdit: userCanEdit,
  27764. postType: postType,
  27765. postId: postId
  27766. });
  27767. }
  27768. function edit_Placeholder() {
  27769. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  27770. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('This is the Post Content block, it will display all the blocks in any single post or page.')), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('That might be a simple arrangement like consecutive paragraphs in a blog post, or a more elaborate composition that includes image galleries, videos, tables, columns, and any other block types.')), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('If there are any Custom Post Types registered at your site, the Post Content block can display the contents of those entries as well.')));
  27771. }
  27772. function RecursionError() {
  27773. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  27774. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
  27775. }
  27776. function PostContentEdit(_ref3) {
  27777. let {
  27778. context,
  27779. attributes
  27780. } = _ref3;
  27781. const {
  27782. postId: contextPostId,
  27783. postType: contextPostType
  27784. } = context;
  27785. const {
  27786. layout = {}
  27787. } = attributes;
  27788. const [hasAlreadyRendered, RecursionProvider] = (0,external_wp_blockEditor_namespaceObject.__experimentalUseNoRecursiveRenders)(contextPostId);
  27789. if (contextPostId && contextPostType && hasAlreadyRendered) {
  27790. return (0,external_wp_element_namespaceObject.createElement)(RecursionError, null);
  27791. }
  27792. return (0,external_wp_element_namespaceObject.createElement)(RecursionProvider, null, contextPostId && contextPostType ? (0,external_wp_element_namespaceObject.createElement)(Content, {
  27793. context: context,
  27794. layout: layout
  27795. }) : (0,external_wp_element_namespaceObject.createElement)(edit_Placeholder, null));
  27796. }
  27797. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-content/index.js
  27798. /**
  27799. * WordPress dependencies
  27800. */
  27801. /**
  27802. * Internal dependencies
  27803. */
  27804. const post_content_metadata = {
  27805. $schema: "https://schemas.wp.org/trunk/block.json",
  27806. apiVersion: 2,
  27807. name: "core/post-content",
  27808. title: "Post Content",
  27809. category: "theme",
  27810. description: "Displays the contents of a post or page.",
  27811. textdomain: "default",
  27812. usesContext: ["postId", "postType", "queryId"],
  27813. supports: {
  27814. align: ["wide", "full"],
  27815. html: false,
  27816. __experimentalLayout: true
  27817. },
  27818. editorStyle: "wp-block-post-content-editor"
  27819. };
  27820. const {
  27821. name: post_content_name
  27822. } = post_content_metadata;
  27823. const post_content_settings = {
  27824. icon: post_content,
  27825. edit: PostContentEdit
  27826. };
  27827. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/edit.js
  27828. /**
  27829. * External dependencies
  27830. */
  27831. /**
  27832. * WordPress dependencies
  27833. */
  27834. function PostDateEdit(_ref) {
  27835. let {
  27836. attributes: {
  27837. textAlign,
  27838. format,
  27839. isLink
  27840. },
  27841. context: {
  27842. postId,
  27843. postType: postTypeSlug,
  27844. queryId
  27845. },
  27846. setAttributes
  27847. } = _ref;
  27848. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  27849. className: classnames_default()({
  27850. [`has-text-align-${textAlign}`]: textAlign
  27851. })
  27852. });
  27853. const timeRef = (0,external_wp_element_namespaceObject.useRef)();
  27854. const isDescendentOfQueryLoop = Number.isFinite(queryId);
  27855. const dateSettings = (0,external_wp_date_namespaceObject.__experimentalGetSettings)();
  27856. const [siteFormat = dateSettings.formats.date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'date_format');
  27857. const [siteTimeFormat = dateSettings.formats.time] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'time_format');
  27858. const [date, setDate] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, 'date', postId);
  27859. const postType = (0,external_wp_data_namespaceObject.useSelect)(select => postTypeSlug ? select(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug) : null, [postTypeSlug]);
  27860. let postDate = date ? (0,external_wp_element_namespaceObject.createElement)("time", {
  27861. dateTime: (0,external_wp_date_namespaceObject.dateI18n)('c', date),
  27862. ref: timeRef
  27863. }, (0,external_wp_date_namespaceObject.dateI18n)(format || siteFormat, date)) : (0,external_wp_i18n_namespaceObject.__)('Post Date');
  27864. if (isLink && date) {
  27865. postDate = (0,external_wp_element_namespaceObject.createElement)("a", {
  27866. href: "#post-date-pseudo-link",
  27867. onClick: event => event.preventDefault()
  27868. }, postDate);
  27869. }
  27870. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  27871. group: "block"
  27872. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  27873. value: textAlign,
  27874. onChange: nextAlign => {
  27875. setAttributes({
  27876. textAlign: nextAlign
  27877. });
  27878. }
  27879. }), date && !isDescendentOfQueryLoop && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
  27880. popoverProps: {
  27881. anchorRef: timeRef.current
  27882. },
  27883. renderContent: () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DateTimePicker, {
  27884. currentDate: date,
  27885. onChange: setDate,
  27886. is12Hour: is12HourFormat(siteTimeFormat)
  27887. }),
  27888. renderToggle: _ref2 => {
  27889. let {
  27890. isOpen,
  27891. onToggle
  27892. } = _ref2;
  27893. const openOnArrowDown = event => {
  27894. if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) {
  27895. event.preventDefault();
  27896. onToggle();
  27897. }
  27898. };
  27899. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  27900. "aria-expanded": isOpen,
  27901. icon: library_edit,
  27902. title: (0,external_wp_i18n_namespaceObject.__)('Change Date'),
  27903. onClick: onToggle,
  27904. onKeyDown: openOnArrowDown
  27905. });
  27906. }
  27907. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  27908. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  27909. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalDateFormatPicker, {
  27910. format: format,
  27911. defaultFormat: siteFormat,
  27912. onChange: nextFormat => setAttributes({
  27913. format: nextFormat
  27914. })
  27915. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  27916. label: postType !== null && postType !== void 0 && postType.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "post".
  27917. (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name.toLowerCase()) : (0,external_wp_i18n_namespaceObject.__)('Link to post'),
  27918. onChange: () => setAttributes({
  27919. isLink: !isLink
  27920. }),
  27921. checked: isLink
  27922. }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, postDate));
  27923. }
  27924. function is12HourFormat(format) {
  27925. // To know if the time format is a 12 hour time, look for any of the 12 hour
  27926. // format characters: 'a', 'A', 'g', and 'h'. The character must be
  27927. // unescaped, i.e. not preceded by a '\'. Coincidentally, 'aAgh' is how I
  27928. // feel when working with regular expressions.
  27929. // https://www.php.net/manual/en/datetime.format.php
  27930. return /(?:^|[^\\])[aAgh]/.test(format);
  27931. }
  27932. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/deprecated.js
  27933. /**
  27934. * Internal dependencies
  27935. */
  27936. const post_date_deprecated_v1 = {
  27937. attributes: {
  27938. textAlign: {
  27939. type: 'string'
  27940. },
  27941. format: {
  27942. type: 'string'
  27943. },
  27944. isLink: {
  27945. type: 'boolean',
  27946. default: false
  27947. }
  27948. },
  27949. supports: {
  27950. html: false,
  27951. color: {
  27952. gradients: true,
  27953. link: true
  27954. },
  27955. typography: {
  27956. fontSize: true,
  27957. lineHeight: true,
  27958. __experimentalFontFamily: true,
  27959. __experimentalFontWeight: true,
  27960. __experimentalFontStyle: true,
  27961. __experimentalTextTransform: true,
  27962. __experimentalLetterSpacing: true
  27963. }
  27964. },
  27965. save() {
  27966. return null;
  27967. },
  27968. migrate: migrate_font_family,
  27969. isEligible(_ref) {
  27970. var _style$typography;
  27971. let {
  27972. style
  27973. } = _ref;
  27974. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  27975. }
  27976. };
  27977. /**
  27978. * New deprecations need to be placed first
  27979. * for them to have higher priority.
  27980. *
  27981. * Old deprecations may need to be updated as well.
  27982. *
  27983. * See block-deprecation.md
  27984. */
  27985. /* harmony default export */ var post_date_deprecated = ([post_date_deprecated_v1]);
  27986. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/index.js
  27987. /**
  27988. * WordPress dependencies
  27989. */
  27990. /**
  27991. * Internal dependencies
  27992. */
  27993. const post_date_metadata = {
  27994. $schema: "https://schemas.wp.org/trunk/block.json",
  27995. apiVersion: 2,
  27996. name: "core/post-date",
  27997. title: "Post Date",
  27998. category: "theme",
  27999. description: "Add the date of this post.",
  28000. textdomain: "default",
  28001. attributes: {
  28002. textAlign: {
  28003. type: "string"
  28004. },
  28005. format: {
  28006. type: "string"
  28007. },
  28008. isLink: {
  28009. type: "boolean",
  28010. "default": false
  28011. }
  28012. },
  28013. usesContext: ["postId", "postType", "queryId"],
  28014. supports: {
  28015. html: false,
  28016. color: {
  28017. gradients: true,
  28018. link: true,
  28019. __experimentalDefaultControls: {
  28020. background: true,
  28021. text: true,
  28022. link: true
  28023. }
  28024. },
  28025. typography: {
  28026. fontSize: true,
  28027. lineHeight: true,
  28028. __experimentalFontFamily: true,
  28029. __experimentalFontWeight: true,
  28030. __experimentalFontStyle: true,
  28031. __experimentalTextTransform: true,
  28032. __experimentalLetterSpacing: true,
  28033. __experimentalDefaultControls: {
  28034. fontSize: true
  28035. }
  28036. }
  28037. }
  28038. };
  28039. const {
  28040. name: post_date_name
  28041. } = post_date_metadata;
  28042. const post_date_settings = {
  28043. icon: post_date,
  28044. edit: PostDateEdit,
  28045. deprecated: post_date_deprecated
  28046. };
  28047. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-excerpt.js
  28048. /**
  28049. * WordPress dependencies
  28050. */
  28051. const postExcerpt = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  28052. xmlns: "http://www.w3.org/2000/svg",
  28053. viewBox: "0 0 24 24"
  28054. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  28055. d: "M12.75 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.395.395 0 00.199-.166c.05-.083.114-.253.114-.584V7.2H8.8V4h3.95v5.333zM7.95 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.394.394 0 00.198-.166c.05-.083.115-.253.115-.584V7.2H4V4h3.95v5.333zM13 20H4v-1.5h9V20zM20 16H4v-1.5h16V16z"
  28056. }));
  28057. /* harmony default export */ var post_excerpt = (postExcerpt);
  28058. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-excerpt/edit.js
  28059. /**
  28060. * External dependencies
  28061. */
  28062. /**
  28063. * WordPress dependencies
  28064. */
  28065. /**
  28066. * Internal dependencies
  28067. */
  28068. function PostExcerptEditor(_ref) {
  28069. let {
  28070. attributes: {
  28071. textAlign,
  28072. moreText,
  28073. showMoreOnNewLine
  28074. },
  28075. setAttributes,
  28076. isSelected,
  28077. context: {
  28078. postId,
  28079. postType,
  28080. queryId
  28081. }
  28082. } = _ref;
  28083. const isDescendentOfQueryLoop = Number.isFinite(queryId);
  28084. const userCanEdit = useCanEditEntity('postType', postType, postId);
  28085. const isEditable = userCanEdit && !isDescendentOfQueryLoop;
  28086. const [rawExcerpt, setExcerpt, {
  28087. rendered: renderedExcerpt,
  28088. protected: isProtected
  28089. } = {}] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'excerpt', postId);
  28090. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  28091. className: classnames_default()({
  28092. [`has-text-align-${textAlign}`]: textAlign
  28093. })
  28094. });
  28095. /**
  28096. * When excerpt is editable, strip the html tags from
  28097. * rendered excerpt. This will be used if the entity's
  28098. * excerpt has been produced from the content.
  28099. */
  28100. const strippedRenderedExcerpt = (0,external_wp_element_namespaceObject.useMemo)(() => {
  28101. if (!renderedExcerpt) return '';
  28102. const document = new window.DOMParser().parseFromString(renderedExcerpt, 'text/html');
  28103. return document.body.textContent || document.body.innerText || '';
  28104. }, [renderedExcerpt]);
  28105. if (!postType || !postId) {
  28106. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('This is the Post Excerpt block, it will display the excerpt from single posts.')), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('If there are any Custom Post Types with support for excerpts, the Post Excerpt block can display the excerpts of those entries as well.')));
  28107. }
  28108. if (isProtected && !userCanEdit) {
  28109. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('There is no excerpt because this is a protected post.')));
  28110. }
  28111. const readMoreLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  28112. className: "wp-block-post-excerpt__more-link",
  28113. tagName: "a",
  28114. "aria-label": (0,external_wp_i18n_namespaceObject.__)('"Read more" link text'),
  28115. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add "read more" link text'),
  28116. value: moreText,
  28117. onChange: newMoreText => setAttributes({
  28118. moreText: newMoreText
  28119. }),
  28120. withoutInteractiveFormatting: true
  28121. });
  28122. const excerptClassName = classnames_default()('wp-block-post-excerpt__excerpt', {
  28123. 'is-inline': !showMoreOnNewLine
  28124. });
  28125. const excerptContent = isEditable ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  28126. className: excerptClassName,
  28127. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Post excerpt text'),
  28128. value: rawExcerpt || strippedRenderedExcerpt || (isSelected ? '' : (0,external_wp_i18n_namespaceObject.__)('No post excerpt found')),
  28129. onChange: setExcerpt,
  28130. tagName: "p"
  28131. }) : (0,external_wp_element_namespaceObject.createElement)("p", {
  28132. className: excerptClassName
  28133. }, strippedRenderedExcerpt || (0,external_wp_i18n_namespaceObject.__)('No post excerpt found'));
  28134. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, {
  28135. value: textAlign,
  28136. onChange: newAlign => setAttributes({
  28137. textAlign: newAlign
  28138. })
  28139. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  28140. title: (0,external_wp_i18n_namespaceObject.__)('Post Excerpt Settings')
  28141. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  28142. label: (0,external_wp_i18n_namespaceObject.__)('Show link on new line'),
  28143. checked: showMoreOnNewLine,
  28144. onChange: newShowMoreOnNewLine => setAttributes({
  28145. showMoreOnNewLine: newShowMoreOnNewLine
  28146. })
  28147. }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, excerptContent, !showMoreOnNewLine && ' ', showMoreOnNewLine ? (0,external_wp_element_namespaceObject.createElement)("p", {
  28148. className: "wp-block-post-excerpt__more-text"
  28149. }, readMoreLink) : readMoreLink));
  28150. }
  28151. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-excerpt/transforms.js
  28152. /**
  28153. * WordPress dependencies
  28154. */
  28155. const post_excerpt_transforms_transforms = {
  28156. from: [{
  28157. type: 'block',
  28158. blocks: ['core/post-content'],
  28159. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-excerpt')
  28160. }],
  28161. to: [{
  28162. type: 'block',
  28163. blocks: ['core/post-content'],
  28164. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-content')
  28165. }]
  28166. };
  28167. /* harmony default export */ var post_excerpt_transforms = (post_excerpt_transforms_transforms);
  28168. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js
  28169. /**
  28170. * WordPress dependencies
  28171. */
  28172. /**
  28173. * Internal dependencies
  28174. */
  28175. const post_excerpt_metadata = {
  28176. $schema: "https://schemas.wp.org/trunk/block.json",
  28177. apiVersion: 2,
  28178. name: "core/post-excerpt",
  28179. title: "Post Excerpt",
  28180. category: "theme",
  28181. description: "Display a post's excerpt.",
  28182. textdomain: "default",
  28183. attributes: {
  28184. textAlign: {
  28185. type: "string"
  28186. },
  28187. moreText: {
  28188. type: "string"
  28189. },
  28190. showMoreOnNewLine: {
  28191. type: "boolean",
  28192. "default": true
  28193. }
  28194. },
  28195. usesContext: ["postId", "postType", "queryId"],
  28196. supports: {
  28197. html: false,
  28198. color: {
  28199. gradients: true,
  28200. link: true,
  28201. __experimentalDefaultControls: {
  28202. background: true,
  28203. text: true,
  28204. link: true
  28205. }
  28206. },
  28207. spacing: {
  28208. margin: true,
  28209. padding: true
  28210. },
  28211. typography: {
  28212. fontSize: true,
  28213. lineHeight: true,
  28214. __experimentalFontStyle: true,
  28215. __experimentalFontWeight: true,
  28216. __experimentalLetterSpacing: true,
  28217. __experimentalTextTransform: true,
  28218. __experimentalDefaultControls: {
  28219. fontSize: true
  28220. }
  28221. }
  28222. },
  28223. editorStyle: "wp-block-post-excerpt-editor",
  28224. style: "wp-block-post-excerpt"
  28225. };
  28226. const {
  28227. name: post_excerpt_name
  28228. } = post_excerpt_metadata;
  28229. const post_excerpt_settings = {
  28230. icon: post_excerpt,
  28231. transforms: post_excerpt_transforms,
  28232. edit: PostExcerptEditor
  28233. };
  28234. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/dimension-controls.js
  28235. /**
  28236. * WordPress dependencies
  28237. */
  28238. const SCALE_OPTIONS = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  28239. value: "cover",
  28240. label: (0,external_wp_i18n_namespaceObject._x)('Cover', 'Scale option for Image dimension control')
  28241. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  28242. value: "contain",
  28243. label: (0,external_wp_i18n_namespaceObject._x)('Contain', 'Scale option for Image dimension control')
  28244. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  28245. value: "fill",
  28246. label: (0,external_wp_i18n_namespaceObject._x)('Fill', 'Scale option for Image dimension control')
  28247. }));
  28248. const DEFAULT_SCALE = 'cover';
  28249. const DEFAULT_SIZE = 'full';
  28250. const scaleHelp = {
  28251. cover: (0,external_wp_i18n_namespaceObject.__)('Image is scaled and cropped to fill the entire space without being distorted.'),
  28252. contain: (0,external_wp_i18n_namespaceObject.__)('Image is scaled to fill the space without clipping nor distorting.'),
  28253. fill: (0,external_wp_i18n_namespaceObject.__)('Image will be stretched and distorted to completely fill the space.')
  28254. };
  28255. const DimensionControls = _ref => {
  28256. let {
  28257. clientId,
  28258. attributes: {
  28259. width,
  28260. height,
  28261. scale,
  28262. sizeSlug
  28263. },
  28264. setAttributes,
  28265. imageSizeOptions = []
  28266. } = _ref;
  28267. const defaultUnits = ['px', '%', 'vw', 'em', 'rem'];
  28268. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  28269. availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || defaultUnits
  28270. });
  28271. const onDimensionChange = (dimension, nextValue) => {
  28272. const parsedValue = parseFloat(nextValue);
  28273. /**
  28274. * If we have no value set and we change the unit,
  28275. * we don't want to set the attribute, as it would
  28276. * end up having the unit as value without any number.
  28277. */
  28278. if (isNaN(parsedValue) && nextValue) return;
  28279. setAttributes({
  28280. [dimension]: parsedValue < 0 ? '0' : nextValue
  28281. });
  28282. };
  28283. const scaleLabel = (0,external_wp_i18n_namespaceObject._x)('Scale', 'Image scaling options');
  28284. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  28285. __experimentalGroup: "dimensions"
  28286. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  28287. className: "single-column",
  28288. hasValue: () => !!height,
  28289. label: (0,external_wp_i18n_namespaceObject.__)('Height'),
  28290. onDeselect: () => setAttributes({
  28291. height: undefined
  28292. }),
  28293. resetAllFilter: () => ({
  28294. height: undefined
  28295. }),
  28296. isShownByDefault: true,
  28297. panelId: clientId
  28298. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  28299. label: (0,external_wp_i18n_namespaceObject.__)('Height'),
  28300. labelPosition: "top",
  28301. value: height || '',
  28302. min: 0,
  28303. onChange: nextHeight => onDimensionChange('height', nextHeight),
  28304. units: units
  28305. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  28306. className: "single-column",
  28307. hasValue: () => !!width,
  28308. label: (0,external_wp_i18n_namespaceObject.__)('Width'),
  28309. onDeselect: () => setAttributes({
  28310. width: undefined
  28311. }),
  28312. resetAllFilter: () => ({
  28313. width: undefined
  28314. }),
  28315. isShownByDefault: true,
  28316. panelId: clientId
  28317. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  28318. label: (0,external_wp_i18n_namespaceObject.__)('Width'),
  28319. labelPosition: "top",
  28320. value: width || '',
  28321. min: 0,
  28322. onChange: nextWidth => onDimensionChange('width', nextWidth),
  28323. units: units
  28324. })), !!height && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  28325. hasValue: () => !!scale && scale !== DEFAULT_SCALE,
  28326. label: scaleLabel,
  28327. onDeselect: () => setAttributes({
  28328. scale: DEFAULT_SCALE
  28329. }),
  28330. resetAllFilter: () => ({
  28331. scale: DEFAULT_SCALE
  28332. }),
  28333. isShownByDefault: true,
  28334. panelId: clientId
  28335. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
  28336. label: scaleLabel,
  28337. value: scale,
  28338. help: scaleHelp[scale],
  28339. onChange: value => setAttributes({
  28340. scale: value
  28341. }),
  28342. isBlock: true
  28343. }, SCALE_OPTIONS)), !!imageSizeOptions.length && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  28344. hasValue: () => !!sizeSlug,
  28345. label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
  28346. onDeselect: () => setAttributes({
  28347. sizeSlug: undefined
  28348. }),
  28349. resetAllFilter: () => ({
  28350. sizeSlug: undefined
  28351. }),
  28352. isShownByDefault: false,
  28353. panelId: clientId
  28354. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  28355. label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
  28356. value: sizeSlug || DEFAULT_SIZE,
  28357. options: imageSizeOptions,
  28358. onChange: nextSizeSlug => setAttributes({
  28359. sizeSlug: nextSizeSlug
  28360. }),
  28361. help: (0,external_wp_i18n_namespaceObject.__)('Select the size of the source image.')
  28362. })));
  28363. };
  28364. /* harmony default export */ var dimension_controls = (DimensionControls);
  28365. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/edit.js
  28366. /**
  28367. * WordPress dependencies
  28368. */
  28369. /**
  28370. * Internal dependencies
  28371. */
  28372. const placeholderIllustration = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  28373. className: "components-placeholder__illustration",
  28374. fill: "none",
  28375. xmlns: "http://www.w3.org/2000/svg",
  28376. viewBox: "0 0 60 60",
  28377. preserveAspectRatio: "none"
  28378. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  28379. vectorEffect: "non-scaling-stroke",
  28380. d: "M60 60 0 0"
  28381. }));
  28382. const post_featured_image_edit_ALLOWED_MEDIA_TYPES = ['image'];
  28383. const placeholderChip = (0,external_wp_element_namespaceObject.createElement)("div", {
  28384. className: "wp-block-post-featured-image__placeholder"
  28385. }, placeholderIllustration);
  28386. function getMediaSourceUrlBySizeSlug(media, slug) {
  28387. var _media$media_details, _media$media_details$, _media$media_details$2;
  28388. return (media === null || media === void 0 ? void 0 : (_media$media_details = media.media_details) === null || _media$media_details === void 0 ? void 0 : (_media$media_details$ = _media$media_details.sizes) === null || _media$media_details$ === void 0 ? void 0 : (_media$media_details$2 = _media$media_details$[slug]) === null || _media$media_details$2 === void 0 ? void 0 : _media$media_details$2.source_url) || (media === null || media === void 0 ? void 0 : media.source_url);
  28389. }
  28390. function PostFeaturedImageDisplay(_ref) {
  28391. let {
  28392. clientId,
  28393. attributes,
  28394. setAttributes,
  28395. context: {
  28396. postId,
  28397. postType: postTypeSlug,
  28398. queryId
  28399. }
  28400. } = _ref;
  28401. const isDescendentOfQueryLoop = Number.isFinite(queryId);
  28402. const {
  28403. isLink,
  28404. height,
  28405. width,
  28406. scale,
  28407. sizeSlug
  28408. } = attributes;
  28409. const [featuredImage, setFeaturedImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, 'featured_media', postId);
  28410. const {
  28411. media,
  28412. postType
  28413. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  28414. const {
  28415. getMedia,
  28416. getPostType
  28417. } = select(external_wp_coreData_namespaceObject.store);
  28418. return {
  28419. media: featuredImage && getMedia(featuredImage, {
  28420. context: 'view'
  28421. }),
  28422. postType: postTypeSlug && getPostType(postTypeSlug)
  28423. };
  28424. }, [featuredImage, postTypeSlug]);
  28425. const mediaUrl = getMediaSourceUrlBySizeSlug(media, sizeSlug);
  28426. const imageSizes = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().imageSizes, []);
  28427. const imageSizeOptions = imageSizes.filter(_ref2 => {
  28428. var _media$media_details2, _media$media_details3, _media$media_details4;
  28429. let {
  28430. slug
  28431. } = _ref2;
  28432. return media === null || media === void 0 ? void 0 : (_media$media_details2 = media.media_details) === null || _media$media_details2 === void 0 ? void 0 : (_media$media_details3 = _media$media_details2.sizes) === null || _media$media_details3 === void 0 ? void 0 : (_media$media_details4 = _media$media_details3[slug]) === null || _media$media_details4 === void 0 ? void 0 : _media$media_details4.source_url;
  28433. }).map(_ref3 => {
  28434. let {
  28435. name,
  28436. slug
  28437. } = _ref3;
  28438. return {
  28439. value: slug,
  28440. label: name
  28441. };
  28442. });
  28443. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  28444. style: {
  28445. width,
  28446. height
  28447. }
  28448. });
  28449. const placeholder = content => {
  28450. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  28451. className: "block-editor-media-placeholder"
  28452. }, placeholderIllustration, content);
  28453. };
  28454. const onSelectImage = value => {
  28455. if (value !== null && value !== void 0 && value.id) {
  28456. setFeaturedImage(value.id);
  28457. }
  28458. };
  28459. const {
  28460. createErrorNotice
  28461. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  28462. const onUploadError = message => {
  28463. createErrorNotice(message[2], {
  28464. type: 'snackbar'
  28465. });
  28466. };
  28467. const controls = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(dimension_controls, {
  28468. clientId: clientId,
  28469. attributes: attributes,
  28470. setAttributes: setAttributes,
  28471. imageSizeOptions: imageSizeOptions
  28472. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  28473. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  28474. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  28475. label: postType !== null && postType !== void 0 && postType.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "post".
  28476. (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name.toLowerCase()) : (0,external_wp_i18n_namespaceObject.__)('Link to post'),
  28477. onChange: () => setAttributes({
  28478. isLink: !isLink
  28479. }),
  28480. checked: isLink
  28481. }))));
  28482. let image;
  28483. if (!featuredImage && isDescendentOfQueryLoop) {
  28484. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, controls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, placeholderChip));
  28485. }
  28486. const label = (0,external_wp_i18n_namespaceObject.__)('Add a featured image');
  28487. if (!featuredImage) {
  28488. image = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  28489. onSelect: onSelectImage,
  28490. accept: "image/*",
  28491. allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES,
  28492. onError: onUploadError,
  28493. placeholder: placeholder,
  28494. mediaLibraryButton: _ref4 => {
  28495. let {
  28496. open
  28497. } = _ref4;
  28498. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  28499. icon: library_upload,
  28500. variant: "primary",
  28501. label: label,
  28502. showTooltip: true,
  28503. tooltipPosition: "top center",
  28504. onClick: () => {
  28505. open();
  28506. }
  28507. });
  28508. }
  28509. });
  28510. } else {
  28511. // We have a Featured image so show a Placeholder if is loading.
  28512. image = !media ? placeholderChip : (0,external_wp_element_namespaceObject.createElement)("img", {
  28513. src: mediaUrl,
  28514. alt: media.alt_text ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The image's alt text.
  28515. (0,external_wp_i18n_namespaceObject.__)('Featured image: %s'), media.alt_text) : (0,external_wp_i18n_namespaceObject.__)('Featured image'),
  28516. style: {
  28517. height,
  28518. objectFit: height && scale
  28519. }
  28520. });
  28521. }
  28522. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, controls, !!media && !isDescendentOfQueryLoop && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  28523. group: "other"
  28524. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  28525. mediaId: featuredImage,
  28526. mediaURL: mediaUrl,
  28527. allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES,
  28528. accept: "image/*",
  28529. onSelect: onSelectImage,
  28530. onError: onUploadError
  28531. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  28532. onClick: () => setFeaturedImage(0)
  28533. }, (0,external_wp_i18n_namespaceObject.__)('Reset')))), (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, image));
  28534. }
  28535. function PostFeaturedImageEdit(props) {
  28536. var _props$context;
  28537. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  28538. if (!((_props$context = props.context) !== null && _props$context !== void 0 && _props$context.postId)) {
  28539. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, placeholderChip);
  28540. }
  28541. return (0,external_wp_element_namespaceObject.createElement)(PostFeaturedImageDisplay, props);
  28542. }
  28543. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js
  28544. /**
  28545. * WordPress dependencies
  28546. */
  28547. /**
  28548. * Internal dependencies
  28549. */
  28550. const post_featured_image_metadata = {
  28551. $schema: "https://schemas.wp.org/trunk/block.json",
  28552. apiVersion: 2,
  28553. name: "core/post-featured-image",
  28554. title: "Post Featured Image",
  28555. category: "theme",
  28556. description: "Display a post's featured image.",
  28557. textdomain: "default",
  28558. attributes: {
  28559. isLink: {
  28560. type: "boolean",
  28561. "default": false
  28562. },
  28563. width: {
  28564. type: "string"
  28565. },
  28566. height: {
  28567. type: "string"
  28568. },
  28569. scale: {
  28570. type: "string",
  28571. "default": "cover"
  28572. },
  28573. sizeSlug: {
  28574. type: "string"
  28575. }
  28576. },
  28577. usesContext: ["postId", "postType", "queryId"],
  28578. supports: {
  28579. align: ["left", "right", "center", "wide", "full"],
  28580. color: {
  28581. __experimentalDuotone: "img, .wp-block-post-featured-image__placeholder, .components-placeholder__illustration, .components-placeholder::before",
  28582. text: false,
  28583. background: false
  28584. },
  28585. html: false,
  28586. spacing: {
  28587. margin: true,
  28588. padding: true
  28589. }
  28590. },
  28591. editorStyle: "wp-block-post-featured-image-editor",
  28592. style: "wp-block-post-featured-image"
  28593. };
  28594. const {
  28595. name: post_featured_image_name
  28596. } = post_featured_image_metadata;
  28597. const post_featured_image_settings = {
  28598. icon: post_featured_image,
  28599. edit: PostFeaturedImageEdit
  28600. };
  28601. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/edit.js
  28602. /**
  28603. * External dependencies
  28604. */
  28605. /**
  28606. * WordPress dependencies
  28607. */
  28608. function PostNavigationLinkEdit(_ref) {
  28609. let {
  28610. attributes: {
  28611. type,
  28612. label,
  28613. showTitle,
  28614. textAlign,
  28615. linkLabel
  28616. },
  28617. setAttributes
  28618. } = _ref;
  28619. const isNext = type === 'next';
  28620. let placeholder = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next') : (0,external_wp_i18n_namespaceObject.__)('Previous');
  28621. if (showTitle) {
  28622. /* translators: Label before for next and previous post. There is a space after the colon. */
  28623. placeholder = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next: ') : (0,external_wp_i18n_namespaceObject.__)('Previous: ');
  28624. }
  28625. const ariaLabel = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next post') : (0,external_wp_i18n_namespaceObject.__)('Previous post');
  28626. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  28627. className: classnames_default()({
  28628. [`has-text-align-${textAlign}`]: textAlign
  28629. })
  28630. });
  28631. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  28632. label: (0,external_wp_i18n_namespaceObject.__)('Display the title as a link'),
  28633. help: (0,external_wp_i18n_namespaceObject.__)('If you have entered a custom label, it will be prepended before the title.'),
  28634. checked: !!showTitle,
  28635. onChange: () => setAttributes({
  28636. showTitle: !showTitle
  28637. })
  28638. }), showTitle && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  28639. label: (0,external_wp_i18n_namespaceObject.__)('Include the label as part of the link'),
  28640. checked: !!linkLabel,
  28641. onChange: () => setAttributes({
  28642. linkLabel: !linkLabel
  28643. })
  28644. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, {
  28645. value: textAlign,
  28646. onChange: nextAlign => {
  28647. setAttributes({
  28648. textAlign: nextAlign
  28649. });
  28650. }
  28651. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  28652. tagName: "a",
  28653. "aria-label": ariaLabel,
  28654. placeholder: placeholder,
  28655. value: label,
  28656. allowedFormats: ['core/bold', 'core/italic'],
  28657. onChange: newLabel => setAttributes({
  28658. label: newLabel
  28659. })
  28660. }), showTitle && (0,external_wp_element_namespaceObject.createElement)("a", {
  28661. href: "#post-navigation-pseudo-link",
  28662. onClick: event => event.preventDefault()
  28663. }, (0,external_wp_i18n_namespaceObject.__)('An example title'))));
  28664. }
  28665. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/next.js
  28666. /**
  28667. * WordPress dependencies
  28668. */
  28669. const next = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  28670. xmlns: "http://www.w3.org/2000/svg",
  28671. viewBox: "0 0 24 24"
  28672. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  28673. d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"
  28674. }));
  28675. /* harmony default export */ var library_next = (next);
  28676. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/previous.js
  28677. /**
  28678. * WordPress dependencies
  28679. */
  28680. const previous = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  28681. xmlns: "http://www.w3.org/2000/svg",
  28682. viewBox: "0 0 24 24"
  28683. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  28684. d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"
  28685. }));
  28686. /* harmony default export */ var library_previous = (previous);
  28687. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/variations.js
  28688. /**
  28689. * WordPress dependencies
  28690. */
  28691. const post_navigation_link_variations_variations = [{
  28692. isDefault: true,
  28693. name: 'post-next',
  28694. title: (0,external_wp_i18n_namespaceObject.__)('Next post'),
  28695. description: (0,external_wp_i18n_namespaceObject.__)('Displays the post link that follows the current post.'),
  28696. icon: library_next,
  28697. attributes: {
  28698. type: 'next'
  28699. },
  28700. scope: ['inserter', 'transform']
  28701. }, {
  28702. name: 'post-previous',
  28703. title: (0,external_wp_i18n_namespaceObject.__)('Previous post'),
  28704. description: (0,external_wp_i18n_namespaceObject.__)('Displays the post link that precedes the current post.'),
  28705. icon: library_previous,
  28706. attributes: {
  28707. type: 'previous'
  28708. },
  28709. scope: ['inserter', 'transform']
  28710. }];
  28711. /**
  28712. * Add `isActive` function to all `post-navigation-link` variations, if not defined.
  28713. * `isActive` function is used to find a variation match from a created
  28714. * Block by providing its attributes.
  28715. */
  28716. post_navigation_link_variations_variations.forEach(variation => {
  28717. if (variation.isActive) return;
  28718. variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type;
  28719. });
  28720. /* harmony default export */ var post_navigation_link_variations = (post_navigation_link_variations_variations);
  28721. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js
  28722. /**
  28723. * Internal dependencies
  28724. */
  28725. const post_navigation_link_metadata = {
  28726. $schema: "https://schemas.wp.org/trunk/block.json",
  28727. apiVersion: 2,
  28728. name: "core/post-navigation-link",
  28729. title: "Post Navigation Link",
  28730. category: "theme",
  28731. description: "Displays the next or previous post link that is adjacent to the current post.",
  28732. textdomain: "default",
  28733. attributes: {
  28734. textAlign: {
  28735. type: "string"
  28736. },
  28737. type: {
  28738. type: "string",
  28739. "default": "next"
  28740. },
  28741. label: {
  28742. type: "string"
  28743. },
  28744. showTitle: {
  28745. type: "boolean",
  28746. "default": false
  28747. },
  28748. linkLabel: {
  28749. type: "boolean",
  28750. "default": false
  28751. }
  28752. },
  28753. supports: {
  28754. reusable: false,
  28755. html: false,
  28756. typography: {
  28757. fontSize: true,
  28758. lineHeight: true,
  28759. __experimentalFontStyle: true,
  28760. __experimentalFontWeight: true,
  28761. __experimentalLetterSpacing: true,
  28762. __experimentalTextTransform: true,
  28763. __experimentalDefaultControls: {
  28764. fontSize: true
  28765. }
  28766. }
  28767. }
  28768. };
  28769. const {
  28770. name: post_navigation_link_name
  28771. } = post_navigation_link_metadata;
  28772. const post_navigation_link_settings = {
  28773. edit: PostNavigationLinkEdit,
  28774. variations: post_navigation_link_variations
  28775. };
  28776. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/edit.js
  28777. /**
  28778. * External dependencies
  28779. */
  28780. /**
  28781. * WordPress dependencies
  28782. */
  28783. const post_template_edit_TEMPLATE = [['core/post-title'], ['core/post-date'], ['core/post-excerpt']];
  28784. function PostTemplateInnerBlocks() {
  28785. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
  28786. className: 'wp-block-post'
  28787. }, {
  28788. template: post_template_edit_TEMPLATE
  28789. });
  28790. return (0,external_wp_element_namespaceObject.createElement)("li", innerBlocksProps);
  28791. }
  28792. function PostTemplateBlockPreview(_ref) {
  28793. let {
  28794. blocks,
  28795. blockContextId,
  28796. isHidden,
  28797. setActiveBlockContextId
  28798. } = _ref;
  28799. const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({
  28800. blocks,
  28801. props: {
  28802. className: 'wp-block-post'
  28803. }
  28804. });
  28805. const handleOnClick = () => {
  28806. setActiveBlockContextId(blockContextId);
  28807. };
  28808. const style = {
  28809. display: isHidden ? 'none' : undefined
  28810. };
  28811. return (0,external_wp_element_namespaceObject.createElement)("li", _extends({}, blockPreviewProps, {
  28812. tabIndex: 0 // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
  28813. ,
  28814. role: "button",
  28815. onClick: handleOnClick,
  28816. onKeyPress: handleOnClick,
  28817. style: style
  28818. }));
  28819. }
  28820. const MemoizedPostTemplateBlockPreview = (0,external_wp_element_namespaceObject.memo)(PostTemplateBlockPreview);
  28821. function PostTemplateEdit(_ref2) {
  28822. let {
  28823. clientId,
  28824. context: {
  28825. query: {
  28826. perPage,
  28827. offset,
  28828. postType,
  28829. order,
  28830. orderBy,
  28831. author,
  28832. search,
  28833. exclude,
  28834. sticky,
  28835. inherit,
  28836. taxQuery
  28837. } = {},
  28838. queryContext = [{
  28839. page: 1
  28840. }],
  28841. templateSlug,
  28842. displayLayout: {
  28843. type: layoutType = 'flex',
  28844. columns = 1
  28845. } = {}
  28846. }
  28847. } = _ref2;
  28848. const [{
  28849. page
  28850. }] = queryContext;
  28851. const [activeBlockContextId, setActiveBlockContextId] = (0,external_wp_element_namespaceObject.useState)();
  28852. const {
  28853. posts,
  28854. blocks
  28855. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  28856. const {
  28857. getEntityRecords,
  28858. getTaxonomies
  28859. } = select(external_wp_coreData_namespaceObject.store);
  28860. const {
  28861. getBlocks
  28862. } = select(external_wp_blockEditor_namespaceObject.store);
  28863. const taxonomies = getTaxonomies({
  28864. type: postType,
  28865. per_page: -1,
  28866. context: 'view'
  28867. });
  28868. const query = {
  28869. offset: perPage ? perPage * (page - 1) + offset : 0,
  28870. order,
  28871. orderby: orderBy
  28872. };
  28873. if (taxQuery) {
  28874. // We have to build the tax query for the REST API and use as
  28875. // keys the taxonomies `rest_base` with the `term ids` as values.
  28876. const builtTaxQuery = Object.entries(taxQuery).reduce((accumulator, _ref3) => {
  28877. let [taxonomySlug, terms] = _ref3;
  28878. const taxonomy = taxonomies === null || taxonomies === void 0 ? void 0 : taxonomies.find(_ref4 => {
  28879. let {
  28880. slug
  28881. } = _ref4;
  28882. return slug === taxonomySlug;
  28883. });
  28884. if (taxonomy !== null && taxonomy !== void 0 && taxonomy.rest_base) {
  28885. accumulator[taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.rest_base] = terms;
  28886. }
  28887. return accumulator;
  28888. }, {});
  28889. if (!!Object.keys(builtTaxQuery).length) {
  28890. Object.assign(query, builtTaxQuery);
  28891. }
  28892. }
  28893. if (perPage) {
  28894. query.per_page = perPage;
  28895. }
  28896. if (author) {
  28897. query.author = author;
  28898. }
  28899. if (search) {
  28900. query.search = search;
  28901. }
  28902. if (exclude !== null && exclude !== void 0 && exclude.length) {
  28903. query.exclude = exclude;
  28904. } // If sticky is not set, it will return all posts in the results.
  28905. // If sticky is set to `only`, it will limit the results to sticky posts only.
  28906. // If it is anything else, it will exclude sticky posts from results. For the record the value stored is `exclude`.
  28907. if (sticky) {
  28908. query.sticky = sticky === 'only';
  28909. } // If `inherit` is truthy, adjust conditionally the query to create a better preview.
  28910. if (inherit) {
  28911. // Change the post-type if needed.
  28912. if (templateSlug !== null && templateSlug !== void 0 && templateSlug.startsWith('archive-')) {
  28913. query.postType = templateSlug.replace('archive-', '');
  28914. postType = query.postType;
  28915. }
  28916. }
  28917. return {
  28918. posts: getEntityRecords('postType', postType, query),
  28919. blocks: getBlocks(clientId)
  28920. };
  28921. }, [perPage, page, offset, order, orderBy, clientId, author, search, postType, exclude, sticky, inherit, templateSlug, taxQuery]);
  28922. const blockContexts = (0,external_wp_element_namespaceObject.useMemo)(() => posts === null || posts === void 0 ? void 0 : posts.map(post => ({
  28923. postType: post.type,
  28924. postId: post.id
  28925. })), [posts]);
  28926. const hasLayoutFlex = layoutType === 'flex' && columns > 1;
  28927. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  28928. className: classnames_default()({
  28929. 'is-flex-container': hasLayoutFlex,
  28930. [`columns-${columns}`]: hasLayoutFlex
  28931. })
  28932. });
  28933. if (!posts) {
  28934. return (0,external_wp_element_namespaceObject.createElement)("p", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
  28935. }
  28936. if (!posts.length) {
  28937. return (0,external_wp_element_namespaceObject.createElement)("p", blockProps, " ", (0,external_wp_i18n_namespaceObject.__)('No results found.'));
  28938. } // To avoid flicker when switching active block contexts, a preview is rendered
  28939. // for each block context, but the preview for the active block context is hidden.
  28940. // This ensures that when it is displayed again, the cached rendering of the
  28941. // block preview is used, instead of having to re-render the preview from scratch.
  28942. return (0,external_wp_element_namespaceObject.createElement)("ul", blockProps, blockContexts && blockContexts.map(blockContext => {
  28943. var _blockContexts$, _blockContexts$2;
  28944. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockContextProvider, {
  28945. key: blockContext.postId,
  28946. value: blockContext
  28947. }, blockContext.postId === (activeBlockContextId || ((_blockContexts$ = blockContexts[0]) === null || _blockContexts$ === void 0 ? void 0 : _blockContexts$.postId)) ? (0,external_wp_element_namespaceObject.createElement)(PostTemplateInnerBlocks, null) : null, (0,external_wp_element_namespaceObject.createElement)(MemoizedPostTemplateBlockPreview, {
  28948. blocks: blocks,
  28949. blockContextId: blockContext.postId,
  28950. setActiveBlockContextId: setActiveBlockContextId,
  28951. isHidden: blockContext.postId === (activeBlockContextId || ((_blockContexts$2 = blockContexts[0]) === null || _blockContexts$2 === void 0 ? void 0 : _blockContexts$2.postId))
  28952. }));
  28953. }));
  28954. }
  28955. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/save.js
  28956. /**
  28957. * WordPress dependencies
  28958. */
  28959. function PostTemplateSave() {
  28960. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  28961. }
  28962. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/index.js
  28963. /**
  28964. * WordPress dependencies
  28965. */
  28966. /**
  28967. * Internal dependencies
  28968. */
  28969. const post_template_metadata = {
  28970. $schema: "https://schemas.wp.org/trunk/block.json",
  28971. apiVersion: 2,
  28972. name: "core/post-template",
  28973. title: "Post Template",
  28974. category: "theme",
  28975. parent: ["core/query"],
  28976. description: "Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.",
  28977. textdomain: "default",
  28978. usesContext: ["queryId", "query", "queryContext", "displayLayout", "templateSlug"],
  28979. supports: {
  28980. reusable: false,
  28981. html: false,
  28982. align: true,
  28983. __experimentalLayout: {
  28984. allowEditing: false
  28985. }
  28986. },
  28987. style: "wp-block-post-template",
  28988. editorStyle: "wp-block-post-template-editor"
  28989. };
  28990. const {
  28991. name: post_template_name
  28992. } = post_template_metadata;
  28993. const post_template_settings = {
  28994. icon: library_layout,
  28995. edit: PostTemplateEdit,
  28996. save: PostTemplateSave
  28997. };
  28998. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/use-post-terms.js
  28999. /**
  29000. * WordPress dependencies
  29001. */
  29002. function usePostTerms(_ref) {
  29003. var _term$visibility2;
  29004. let {
  29005. postId,
  29006. postType,
  29007. term
  29008. } = _ref;
  29009. const {
  29010. rest_base: restBase,
  29011. slug
  29012. } = term;
  29013. const [termIds] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, restBase, postId);
  29014. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  29015. var _term$visibility;
  29016. const visible = term === null || term === void 0 ? void 0 : (_term$visibility = term.visibility) === null || _term$visibility === void 0 ? void 0 : _term$visibility.publicly_queryable;
  29017. if (!visible) {
  29018. return {
  29019. postTerms: [],
  29020. _isLoading: false,
  29021. hasPostTerms: false
  29022. };
  29023. }
  29024. if (!termIds) {
  29025. var _term$postTerms;
  29026. // Waiting for post terms to be fetched.
  29027. return {
  29028. isLoading: term === null || term === void 0 ? void 0 : (_term$postTerms = term.postTerms) === null || _term$postTerms === void 0 ? void 0 : _term$postTerms.includes(postType)
  29029. };
  29030. }
  29031. if (!termIds.length) {
  29032. return {
  29033. isLoading: false
  29034. };
  29035. }
  29036. const {
  29037. getEntityRecords,
  29038. isResolving
  29039. } = select(external_wp_coreData_namespaceObject.store);
  29040. const taxonomyArgs = ['taxonomy', slug, {
  29041. include: termIds,
  29042. context: 'view'
  29043. }];
  29044. const terms = getEntityRecords(...taxonomyArgs);
  29045. const _isLoading = isResolving('getEntityRecords', taxonomyArgs);
  29046. return {
  29047. postTerms: terms,
  29048. isLoading: _isLoading,
  29049. hasPostTerms: !!(terms !== null && terms !== void 0 && terms.length)
  29050. };
  29051. }, [termIds, term === null || term === void 0 ? void 0 : (_term$visibility2 = term.visibility) === null || _term$visibility2 === void 0 ? void 0 : _term$visibility2.publicly_queryable]);
  29052. }
  29053. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/edit.js
  29054. /**
  29055. * External dependencies
  29056. */
  29057. /**
  29058. * WordPress dependencies
  29059. */
  29060. /**
  29061. * Internal dependencies
  29062. */
  29063. function PostTermsEdit(_ref) {
  29064. var _selectedTerm$labels;
  29065. let {
  29066. attributes,
  29067. clientId,
  29068. context,
  29069. setAttributes
  29070. } = _ref;
  29071. const {
  29072. term,
  29073. textAlign,
  29074. separator
  29075. } = attributes;
  29076. const {
  29077. postId,
  29078. postType
  29079. } = context;
  29080. const selectedTerm = (0,external_wp_data_namespaceObject.useSelect)(select => {
  29081. var _taxonomy$visibility;
  29082. if (!term) return {};
  29083. const {
  29084. getTaxonomy
  29085. } = select(external_wp_coreData_namespaceObject.store);
  29086. const taxonomy = getTaxonomy(term);
  29087. return taxonomy !== null && taxonomy !== void 0 && (_taxonomy$visibility = taxonomy.visibility) !== null && _taxonomy$visibility !== void 0 && _taxonomy$visibility.publicly_queryable ? taxonomy : {};
  29088. }, [term]);
  29089. const {
  29090. postTerms,
  29091. hasPostTerms,
  29092. isLoading
  29093. } = usePostTerms({
  29094. postId,
  29095. postType,
  29096. term: selectedTerm
  29097. });
  29098. const hasPost = postId && postType;
  29099. const blockInformation = (0,external_wp_blockEditor_namespaceObject.useBlockDisplayInformation)(clientId);
  29100. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  29101. className: classnames_default()({
  29102. [`has-text-align-${textAlign}`]: textAlign,
  29103. [`taxonomy-${term}`]: term
  29104. })
  29105. });
  29106. if (!hasPost || !term) {
  29107. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, blockInformation.title);
  29108. }
  29109. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, {
  29110. value: textAlign,
  29111. onChange: nextAlign => {
  29112. setAttributes({
  29113. textAlign: nextAlign
  29114. });
  29115. }
  29116. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  29117. __experimentalGroup: "advanced"
  29118. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  29119. autoComplete: "off",
  29120. label: (0,external_wp_i18n_namespaceObject.__)('Separator'),
  29121. value: separator || '',
  29122. onChange: nextValue => {
  29123. setAttributes({
  29124. separator: nextValue
  29125. });
  29126. },
  29127. help: (0,external_wp_i18n_namespaceObject.__)('Enter character(s) used to separate terms.')
  29128. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, isLoading && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), !isLoading && hasPostTerms && postTerms.map(postTerm => (0,external_wp_element_namespaceObject.createElement)("a", {
  29129. key: postTerm.id,
  29130. href: postTerm.link,
  29131. onClick: event => event.preventDefault()
  29132. }, (0,external_lodash_namespaceObject.unescape)(postTerm.name))).reduce((prev, curr) => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, prev, (0,external_wp_element_namespaceObject.createElement)("span", {
  29133. className: "wp-block-post-terms__separator"
  29134. }, separator || ' '), curr)), !isLoading && !hasPostTerms && ((selectedTerm === null || selectedTerm === void 0 ? void 0 : (_selectedTerm$labels = selectedTerm.labels) === null || _selectedTerm$labels === void 0 ? void 0 : _selectedTerm$labels.no_terms) || (0,external_wp_i18n_namespaceObject.__)('Term items not found.'))));
  29135. }
  29136. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-categories.js
  29137. /**
  29138. * WordPress dependencies
  29139. */
  29140. const postCategories = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  29141. viewBox: "0 0 24 24",
  29142. xmlns: "http://www.w3.org/2000/svg"
  29143. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  29144. d: "M20 4H4v1.5h16V4zm-2 9h-3c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3zM4 9.5h9V8H4v1.5zM9 13H6c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3z",
  29145. fillRule: "evenodd",
  29146. clipRule: "evenodd"
  29147. }));
  29148. /* harmony default export */ var post_categories = (postCategories);
  29149. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-terms.js
  29150. /**
  29151. * WordPress dependencies
  29152. */
  29153. const postTerms = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  29154. viewBox: "0 0 24 24",
  29155. xmlns: "http://www.w3.org/2000/svg"
  29156. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  29157. d: "M8.1 12.3c.1.1.3.3.5.3.2.1.4.1.6.1.2 0 .4 0 .6-.1.2-.1.4-.2.5-.3l3-3c.3-.3.5-.7.5-1.1 0-.4-.2-.8-.5-1.1L9.7 3.5c-.1-.2-.3-.3-.5-.3H5c-.4 0-.8.4-.8.8v4.2c0 .2.1.4.2.5l3.7 3.6zM5.8 4.8h3.1l3.4 3.4v.1l-3 3 .5.5-.7-.5-3.3-3.4V4.8zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"
  29158. }));
  29159. /* harmony default export */ var post_terms = (postTerms);
  29160. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/variations.js
  29161. /**
  29162. * WordPress dependencies
  29163. */
  29164. const post_terms_variations_variations = [{
  29165. name: 'category',
  29166. title: (0,external_wp_i18n_namespaceObject.__)('Post Categories'),
  29167. description: (0,external_wp_i18n_namespaceObject.__)("Display a post's categories."),
  29168. icon: post_categories,
  29169. isDefault: true,
  29170. attributes: {
  29171. term: 'category'
  29172. },
  29173. isActive: blockAttributes => blockAttributes.term === 'category'
  29174. }, {
  29175. name: 'post_tag',
  29176. title: (0,external_wp_i18n_namespaceObject.__)('Post Tags'),
  29177. description: (0,external_wp_i18n_namespaceObject.__)("Display a post's tags."),
  29178. icon: post_terms,
  29179. attributes: {
  29180. term: 'post_tag'
  29181. },
  29182. isActive: blockAttributes => blockAttributes.term === 'post_tag'
  29183. }];
  29184. /* harmony default export */ var post_terms_variations = (post_terms_variations_variations);
  29185. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/index.js
  29186. /**
  29187. * Internal dependencies
  29188. */
  29189. const post_terms_metadata = {
  29190. $schema: "https://schemas.wp.org/trunk/block.json",
  29191. apiVersion: 2,
  29192. name: "core/post-terms",
  29193. title: "Post Terms",
  29194. category: "theme",
  29195. description: "Post terms.",
  29196. textdomain: "default",
  29197. attributes: {
  29198. term: {
  29199. type: "string"
  29200. },
  29201. textAlign: {
  29202. type: "string"
  29203. },
  29204. separator: {
  29205. type: "string",
  29206. "default": ", "
  29207. }
  29208. },
  29209. usesContext: ["postId", "postType"],
  29210. supports: {
  29211. html: false,
  29212. color: {
  29213. gradients: true,
  29214. link: true,
  29215. __experimentalDefaultControls: {
  29216. background: true,
  29217. text: true,
  29218. link: true
  29219. }
  29220. },
  29221. typography: {
  29222. lineHeight: true,
  29223. fontSize: true,
  29224. __experimentalFontStyle: true,
  29225. __experimentalFontWeight: true,
  29226. __experimentalLetterSpacing: true,
  29227. __experimentalTextTransform: true,
  29228. __experimentalDefaultControls: {
  29229. fontSize: true
  29230. }
  29231. }
  29232. },
  29233. style: "wp-block-post-terms"
  29234. };
  29235. /**
  29236. * WordPress dependencies
  29237. */
  29238. const {
  29239. name: post_terms_name
  29240. } = post_terms_metadata;
  29241. const post_terms_settings = {
  29242. icon: post_terms,
  29243. variations: post_terms_variations,
  29244. edit: PostTermsEdit
  29245. };
  29246. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/edit.js
  29247. /**
  29248. * External dependencies
  29249. */
  29250. /**
  29251. * WordPress dependencies
  29252. */
  29253. /**
  29254. * Internal dependencies
  29255. */
  29256. function PostTitleEdit(_ref) {
  29257. let {
  29258. attributes: {
  29259. level,
  29260. textAlign,
  29261. isLink,
  29262. rel,
  29263. linkTarget
  29264. },
  29265. setAttributes,
  29266. context: {
  29267. postType,
  29268. postId,
  29269. queryId
  29270. }
  29271. } = _ref;
  29272. const TagName = 0 === level ? 'p' : 'h' + level;
  29273. const isDescendentOfQueryLoop = Number.isFinite(queryId);
  29274. const userCanEdit = useCanEditEntity('postType', postType, postId);
  29275. const [rawTitle = '', setTitle, fullTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
  29276. const [link] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'link', postId);
  29277. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  29278. className: classnames_default()({
  29279. [`has-text-align-${textAlign}`]: textAlign
  29280. })
  29281. });
  29282. let titleElement = (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_i18n_namespaceObject.__)('Post Title'));
  29283. if (postType && postId) {
  29284. titleElement = userCanEdit && !isDescendentOfQueryLoop ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, _extends({
  29285. tagName: TagName,
  29286. placeholder: (0,external_wp_i18n_namespaceObject.__)('No Title'),
  29287. value: rawTitle,
  29288. onChange: setTitle,
  29289. __experimentalVersion: 2
  29290. }, blockProps)) : (0,external_wp_element_namespaceObject.createElement)(TagName, _extends({}, blockProps, {
  29291. dangerouslySetInnerHTML: {
  29292. __html: fullTitle === null || fullTitle === void 0 ? void 0 : fullTitle.rendered
  29293. }
  29294. }));
  29295. }
  29296. if (isLink && postType && postId) {
  29297. titleElement = userCanEdit && !isDescendentOfQueryLoop ? (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  29298. tagName: "a",
  29299. href: link,
  29300. target: linkTarget,
  29301. rel: rel,
  29302. placeholder: !rawTitle.length ? (0,external_wp_i18n_namespaceObject.__)('No Title') : null,
  29303. value: rawTitle,
  29304. onChange: setTitle,
  29305. __experimentalVersion: 2
  29306. })) : (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
  29307. href: link,
  29308. target: linkTarget,
  29309. rel: rel,
  29310. onClick: event => event.preventDefault(),
  29311. dangerouslySetInnerHTML: {
  29312. __html: fullTitle === null || fullTitle === void 0 ? void 0 : fullTitle.rendered
  29313. }
  29314. }));
  29315. }
  29316. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  29317. group: "block"
  29318. }, (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
  29319. selectedLevel: level,
  29320. onChange: newLevel => setAttributes({
  29321. level: newLevel
  29322. })
  29323. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  29324. value: textAlign,
  29325. onChange: nextAlign => {
  29326. setAttributes({
  29327. textAlign: nextAlign
  29328. });
  29329. }
  29330. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  29331. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  29332. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  29333. label: (0,external_wp_i18n_namespaceObject.__)('Make title a link'),
  29334. onChange: () => setAttributes({
  29335. isLink: !isLink
  29336. }),
  29337. checked: isLink
  29338. }), isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  29339. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  29340. onChange: value => setAttributes({
  29341. linkTarget: value ? '_blank' : '_self'
  29342. }),
  29343. checked: linkTarget === '_blank'
  29344. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  29345. label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
  29346. value: rel,
  29347. onChange: newRel => setAttributes({
  29348. rel: newRel
  29349. })
  29350. })))), titleElement);
  29351. }
  29352. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/deprecated.js
  29353. /**
  29354. * Internal dependencies
  29355. */
  29356. const post_title_deprecated_v1 = {
  29357. attributes: {
  29358. textAlign: {
  29359. type: 'string'
  29360. },
  29361. level: {
  29362. type: 'number',
  29363. default: 2
  29364. },
  29365. isLink: {
  29366. type: 'boolean',
  29367. default: false
  29368. },
  29369. rel: {
  29370. type: 'string',
  29371. attribute: 'rel',
  29372. default: ''
  29373. },
  29374. linkTarget: {
  29375. type: 'string',
  29376. default: '_self'
  29377. }
  29378. },
  29379. supports: {
  29380. align: ['wide', 'full'],
  29381. html: false,
  29382. color: {
  29383. gradients: true,
  29384. link: true
  29385. },
  29386. spacing: {
  29387. margin: true
  29388. },
  29389. typography: {
  29390. fontSize: true,
  29391. lineHeight: true,
  29392. __experimentalFontFamily: true,
  29393. __experimentalFontWeight: true,
  29394. __experimentalFontStyle: true,
  29395. __experimentalTextTransform: true
  29396. }
  29397. },
  29398. save() {
  29399. return null;
  29400. },
  29401. migrate: migrate_font_family,
  29402. isEligible(_ref) {
  29403. var _style$typography;
  29404. let {
  29405. style
  29406. } = _ref;
  29407. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  29408. }
  29409. };
  29410. /**
  29411. * New deprecations need to be placed first
  29412. * for them to have higher priority.
  29413. *
  29414. * Old deprecations may need to be updated as well.
  29415. *
  29416. * See block-deprecation.md
  29417. */
  29418. /* harmony default export */ var post_title_deprecated = ([post_title_deprecated_v1]);
  29419. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/index.js
  29420. /**
  29421. * WordPress dependencies
  29422. */
  29423. /**
  29424. * Internal dependencies
  29425. */
  29426. const post_title_metadata = {
  29427. $schema: "https://schemas.wp.org/trunk/block.json",
  29428. apiVersion: 2,
  29429. name: "core/post-title",
  29430. title: "Post Title",
  29431. category: "theme",
  29432. description: "Displays the title of a post, page, or any other content-type.",
  29433. textdomain: "default",
  29434. usesContext: ["postId", "postType", "queryId"],
  29435. attributes: {
  29436. textAlign: {
  29437. type: "string"
  29438. },
  29439. level: {
  29440. type: "number",
  29441. "default": 2
  29442. },
  29443. isLink: {
  29444. type: "boolean",
  29445. "default": false
  29446. },
  29447. rel: {
  29448. type: "string",
  29449. attribute: "rel",
  29450. "default": ""
  29451. },
  29452. linkTarget: {
  29453. type: "string",
  29454. "default": "_self"
  29455. }
  29456. },
  29457. supports: {
  29458. align: ["wide", "full"],
  29459. html: false,
  29460. color: {
  29461. gradients: true,
  29462. link: true,
  29463. __experimentalDefaultControls: {
  29464. background: true,
  29465. text: true,
  29466. link: true
  29467. }
  29468. },
  29469. spacing: {
  29470. margin: true
  29471. },
  29472. typography: {
  29473. fontSize: true,
  29474. lineHeight: true,
  29475. __experimentalFontFamily: true,
  29476. __experimentalFontWeight: true,
  29477. __experimentalFontStyle: true,
  29478. __experimentalTextTransform: true,
  29479. __experimentalLetterSpacing: true,
  29480. __experimentalDefaultControls: {
  29481. fontSize: true,
  29482. fontAppearance: true,
  29483. textTransform: true
  29484. }
  29485. }
  29486. },
  29487. style: "wp-block-post-title"
  29488. };
  29489. const {
  29490. name: post_title_name
  29491. } = post_title_metadata;
  29492. const post_title_settings = {
  29493. icon: post_title,
  29494. edit: PostTitleEdit,
  29495. deprecated: post_title_deprecated
  29496. };
  29497. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/preformatted.js
  29498. /**
  29499. * WordPress dependencies
  29500. */
  29501. const preformatted = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  29502. viewBox: "0 0 24 24",
  29503. xmlns: "http://www.w3.org/2000/svg"
  29504. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  29505. d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 16.5h6V15H7v1.5zm4-4h6V11h-6v1.5zM9 11H7v1.5h2V11zm6 5.5h2V15h-2v1.5z"
  29506. }));
  29507. /* harmony default export */ var library_preformatted = (preformatted);
  29508. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/edit.js
  29509. /**
  29510. * WordPress dependencies
  29511. */
  29512. function PreformattedEdit(_ref) {
  29513. let {
  29514. attributes,
  29515. mergeBlocks,
  29516. setAttributes,
  29517. onRemove,
  29518. style
  29519. } = _ref;
  29520. const {
  29521. content
  29522. } = attributes;
  29523. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  29524. style
  29525. });
  29526. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  29527. tagName: "pre",
  29528. identifier: "content",
  29529. preserveWhiteSpace: true,
  29530. value: content,
  29531. onChange: nextContent => {
  29532. setAttributes({
  29533. content: nextContent
  29534. });
  29535. },
  29536. onRemove: onRemove,
  29537. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Preformatted text'),
  29538. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write preformatted text…'),
  29539. onMerge: mergeBlocks
  29540. }, blockProps, {
  29541. __unstablePastePlainText: true
  29542. }));
  29543. }
  29544. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/save.js
  29545. /**
  29546. * WordPress dependencies
  29547. */
  29548. function preformatted_save_save(_ref) {
  29549. let {
  29550. attributes
  29551. } = _ref;
  29552. const {
  29553. content
  29554. } = attributes;
  29555. return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  29556. value: content
  29557. }));
  29558. }
  29559. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/transforms.js
  29560. /**
  29561. * WordPress dependencies
  29562. */
  29563. const preformatted_transforms_transforms = {
  29564. from: [{
  29565. type: 'block',
  29566. blocks: ['core/code', 'core/paragraph'],
  29567. transform: _ref => {
  29568. let {
  29569. content,
  29570. anchor
  29571. } = _ref;
  29572. return (0,external_wp_blocks_namespaceObject.createBlock)('core/preformatted', {
  29573. content,
  29574. anchor
  29575. });
  29576. }
  29577. }, {
  29578. type: 'raw',
  29579. isMatch: node => node.nodeName === 'PRE' && !(node.children.length === 1 && node.firstChild.nodeName === 'CODE'),
  29580. schema: _ref2 => {
  29581. let {
  29582. phrasingContentSchema
  29583. } = _ref2;
  29584. return {
  29585. pre: {
  29586. children: phrasingContentSchema
  29587. }
  29588. };
  29589. }
  29590. }],
  29591. to: [{
  29592. type: 'block',
  29593. blocks: ['core/paragraph'],
  29594. transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes)
  29595. }, {
  29596. type: 'block',
  29597. blocks: ['core/code'],
  29598. transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/code', attributes)
  29599. }]
  29600. };
  29601. /* harmony default export */ var preformatted_transforms = (preformatted_transforms_transforms);
  29602. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/index.js
  29603. /**
  29604. * WordPress dependencies
  29605. */
  29606. /**
  29607. * Internal dependencies
  29608. */
  29609. const preformatted_metadata = {
  29610. $schema: "https://schemas.wp.org/trunk/block.json",
  29611. apiVersion: 2,
  29612. name: "core/preformatted",
  29613. title: "Preformatted",
  29614. category: "text",
  29615. description: "Add text that respects your spacing and tabs, and also allows styling.",
  29616. textdomain: "default",
  29617. attributes: {
  29618. content: {
  29619. type: "string",
  29620. source: "html",
  29621. selector: "pre",
  29622. "default": "",
  29623. __unstablePreserveWhiteSpace: true,
  29624. __experimentalRole: "content"
  29625. }
  29626. },
  29627. supports: {
  29628. anchor: true,
  29629. color: {
  29630. gradients: true,
  29631. __experimentalDefaultControls: {
  29632. background: true,
  29633. text: true
  29634. }
  29635. },
  29636. typography: {
  29637. fontSize: true,
  29638. lineHeight: true,
  29639. __experimentalFontStyle: true,
  29640. __experimentalFontWeight: true,
  29641. __experimentalLetterSpacing: true,
  29642. __experimentalTextTransform: true,
  29643. __experimentalDefaultControls: {
  29644. fontSize: true
  29645. }
  29646. }
  29647. },
  29648. style: "wp-block-preformatted"
  29649. };
  29650. const {
  29651. name: preformatted_name
  29652. } = preformatted_metadata;
  29653. const preformatted_settings = {
  29654. icon: library_preformatted,
  29655. example: {
  29656. attributes: {
  29657. /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */
  29658. // translators: Sample content for the Preformatted block. Can be replaced with a more locale-adequate work.
  29659. content: (0,external_wp_i18n_namespaceObject.__)('EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\nWindow, very small in the distance, illuminated.\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;')
  29660. /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */
  29661. }
  29662. },
  29663. transforms: preformatted_transforms,
  29664. edit: PreformattedEdit,
  29665. save: preformatted_save_save,
  29666. merge(attributes, attributesToMerge) {
  29667. return {
  29668. content: attributes.content + attributesToMerge.content
  29669. };
  29670. }
  29671. };
  29672. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pullquote.js
  29673. /**
  29674. * WordPress dependencies
  29675. */
  29676. const pullquote = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  29677. viewBox: "0 0 24 24",
  29678. xmlns: "http://www.w3.org/2000/svg"
  29679. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  29680. d: "M18 8H6c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v4zM4 4v1.5h16V4H4zm0 16h16v-1.5H4V20z"
  29681. }));
  29682. /* harmony default export */ var library_pullquote = (pullquote);
  29683. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/shared.js
  29684. const SOLID_COLOR_CLASS = `is-style-solid-color`;
  29685. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/deprecated.js
  29686. /**
  29687. * External dependencies
  29688. */
  29689. /**
  29690. * WordPress dependencies
  29691. */
  29692. /**
  29693. * Internal dependencies
  29694. */
  29695. const pullquote_deprecated_blockAttributes = {
  29696. value: {
  29697. type: 'string',
  29698. source: 'html',
  29699. selector: 'blockquote',
  29700. multiline: 'p'
  29701. },
  29702. citation: {
  29703. type: 'string',
  29704. source: 'html',
  29705. selector: 'cite',
  29706. default: ''
  29707. },
  29708. mainColor: {
  29709. type: 'string'
  29710. },
  29711. customMainColor: {
  29712. type: 'string'
  29713. },
  29714. textColor: {
  29715. type: 'string'
  29716. },
  29717. customTextColor: {
  29718. type: 'string'
  29719. }
  29720. };
  29721. function parseBorderColor(styleString) {
  29722. if (!styleString) {
  29723. return;
  29724. }
  29725. const matches = styleString.match(/border-color:([^;]+)[;]?/);
  29726. if (matches && matches[1]) {
  29727. return matches[1];
  29728. }
  29729. } // TODO: this is ripe for a bit of a clean up according to the example in https://developer.wordpress.org/block-editor/reference-guides/block-api/block-deprecation/#example
  29730. const pullquote_deprecated_deprecated = [{
  29731. attributes: { ...pullquote_deprecated_blockAttributes
  29732. },
  29733. save(_ref) {
  29734. let {
  29735. attributes
  29736. } = _ref;
  29737. const {
  29738. mainColor,
  29739. customMainColor,
  29740. customTextColor,
  29741. textColor,
  29742. value,
  29743. citation,
  29744. className
  29745. } = attributes;
  29746. const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
  29747. let figureClasses, figureStyles; // Is solid color style
  29748. if (isSolidColorStyle) {
  29749. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
  29750. figureClasses = classnames_default()({
  29751. 'has-background': backgroundClass || customMainColor,
  29752. [backgroundClass]: backgroundClass
  29753. });
  29754. figureStyles = {
  29755. backgroundColor: backgroundClass ? undefined : customMainColor
  29756. }; // Is normal style and a custom color is being used ( we can set a style directly with its value)
  29757. } else if (customMainColor) {
  29758. figureStyles = {
  29759. borderColor: customMainColor
  29760. };
  29761. }
  29762. const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  29763. const blockquoteClasses = classnames_default()({
  29764. 'has-text-color': textColor || customTextColor,
  29765. [blockquoteTextColorClass]: blockquoteTextColorClass
  29766. });
  29767. const blockquoteStyles = blockquoteTextColorClass ? undefined : {
  29768. color: customTextColor
  29769. };
  29770. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  29771. className: figureClasses,
  29772. style: figureStyles
  29773. }), (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  29774. className: blockquoteClasses,
  29775. style: blockquoteStyles
  29776. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  29777. value: value,
  29778. multiline: true
  29779. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  29780. tagName: "cite",
  29781. value: citation
  29782. })));
  29783. },
  29784. migrate(_ref2) {
  29785. let {
  29786. className,
  29787. mainColor,
  29788. customMainColor,
  29789. customTextColor,
  29790. ...attributes
  29791. } = _ref2;
  29792. const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
  29793. let style;
  29794. if (customMainColor) {
  29795. if (!isSolidColorStyle) {
  29796. // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.
  29797. style = {
  29798. border: {
  29799. color: customMainColor
  29800. }
  29801. };
  29802. } else {
  29803. // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.
  29804. style = {
  29805. color: {
  29806. background: customMainColor
  29807. }
  29808. };
  29809. }
  29810. } // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.
  29811. if (customTextColor && style) {
  29812. style.color = { ...style.color,
  29813. text: customTextColor
  29814. };
  29815. }
  29816. return {
  29817. className,
  29818. backgroundColor: isSolidColorStyle ? mainColor : undefined,
  29819. borderColor: isSolidColorStyle ? undefined : mainColor,
  29820. textAlign: isSolidColorStyle ? 'left' : undefined,
  29821. style,
  29822. ...attributes
  29823. };
  29824. }
  29825. }, {
  29826. attributes: { ...pullquote_deprecated_blockAttributes,
  29827. // figureStyle is an attribute that never existed.
  29828. // We are using it as a way to access the styles previously applied to the figure.
  29829. figureStyle: {
  29830. source: 'attribute',
  29831. selector: 'figure',
  29832. attribute: 'style'
  29833. }
  29834. },
  29835. save(_ref3) {
  29836. let {
  29837. attributes
  29838. } = _ref3;
  29839. const {
  29840. mainColor,
  29841. customMainColor,
  29842. textColor,
  29843. customTextColor,
  29844. value,
  29845. citation,
  29846. className,
  29847. figureStyle
  29848. } = attributes;
  29849. const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
  29850. let figureClasses, figureStyles; // Is solid color style
  29851. if (isSolidColorStyle) {
  29852. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
  29853. figureClasses = classnames_default()({
  29854. 'has-background': backgroundClass || customMainColor,
  29855. [backgroundClass]: backgroundClass
  29856. });
  29857. figureStyles = {
  29858. backgroundColor: backgroundClass ? undefined : customMainColor
  29859. }; // Is normal style and a custom color is being used ( we can set a style directly with its value)
  29860. } else if (customMainColor) {
  29861. figureStyles = {
  29862. borderColor: customMainColor
  29863. }; // If normal style and a named color are being used, we need to retrieve the color value to set the style,
  29864. // as there is no expectation that themes create classes that set border colors.
  29865. } else if (mainColor) {
  29866. // Previously here we queried the color settings to know the color value
  29867. // of a named color. This made the save function impure and the block was refactored,
  29868. // because meanwhile a change in the editor made it impossible to query color settings in the save function.
  29869. // Here instead of querying the color settings to know the color value, we retrieve the value
  29870. // directly from the style previously serialized.
  29871. const borderColor = parseBorderColor(figureStyle);
  29872. figureStyles = {
  29873. borderColor
  29874. };
  29875. }
  29876. const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  29877. const blockquoteClasses = (textColor || customTextColor) && classnames_default()('has-text-color', {
  29878. [blockquoteTextColorClass]: blockquoteTextColorClass
  29879. });
  29880. const blockquoteStyles = blockquoteTextColorClass ? undefined : {
  29881. color: customTextColor
  29882. };
  29883. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  29884. className: figureClasses,
  29885. style: figureStyles
  29886. }, (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  29887. className: blockquoteClasses,
  29888. style: blockquoteStyles
  29889. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  29890. value: value,
  29891. multiline: true
  29892. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  29893. tagName: "cite",
  29894. value: citation
  29895. })));
  29896. },
  29897. migrate(_ref4) {
  29898. let {
  29899. className,
  29900. figureStyle,
  29901. mainColor,
  29902. customMainColor,
  29903. customTextColor,
  29904. ...attributes
  29905. } = _ref4;
  29906. const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
  29907. let style;
  29908. if (customMainColor) {
  29909. if (!isSolidColorStyle) {
  29910. // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.
  29911. style = {
  29912. border: {
  29913. color: customMainColor
  29914. }
  29915. };
  29916. } else {
  29917. // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.
  29918. style = {
  29919. color: {
  29920. background: customMainColor
  29921. }
  29922. };
  29923. }
  29924. } // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.
  29925. if (customTextColor && style) {
  29926. style.color = { ...style.color,
  29927. text: customTextColor
  29928. };
  29929. } // If is the default style, and a main color is set,
  29930. // migrate the main color value into a custom border color.
  29931. // The custom border color value is retrieved by parsing the figure styles.
  29932. if (!isSolidColorStyle && mainColor && figureStyle) {
  29933. const borderColor = parseBorderColor(figureStyle);
  29934. if (borderColor) {
  29935. return { ...attributes,
  29936. className,
  29937. // Block supports: Set style.border.color if a deprecated block has `mainColor`, inline border CSS and is not a solid color style.
  29938. style: {
  29939. border: {
  29940. color: borderColor
  29941. }
  29942. }
  29943. };
  29944. }
  29945. }
  29946. return {
  29947. className,
  29948. backgroundColor: isSolidColorStyle ? mainColor : undefined,
  29949. borderColor: isSolidColorStyle ? undefined : mainColor,
  29950. textAlign: isSolidColorStyle ? 'left' : undefined,
  29951. style,
  29952. ...attributes
  29953. };
  29954. }
  29955. }, {
  29956. attributes: pullquote_deprecated_blockAttributes,
  29957. save(_ref5) {
  29958. let {
  29959. attributes
  29960. } = _ref5;
  29961. const {
  29962. mainColor,
  29963. customMainColor,
  29964. textColor,
  29965. customTextColor,
  29966. value,
  29967. citation,
  29968. className
  29969. } = attributes;
  29970. const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
  29971. let figureClass, figureStyles; // Is solid color style
  29972. if (isSolidColorStyle) {
  29973. figureClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
  29974. if (!figureClass) {
  29975. figureStyles = {
  29976. backgroundColor: customMainColor
  29977. };
  29978. } // Is normal style and a custom color is being used ( we can set a style directly with its value)
  29979. } else if (customMainColor) {
  29980. figureStyles = {
  29981. borderColor: customMainColor
  29982. }; // Is normal style and a named color is being used, we need to retrieve the color value to set the style,
  29983. // as there is no expectation that themes create classes that set border colors.
  29984. } else if (mainColor) {
  29985. const colors = (0,external_lodash_namespaceObject.get)((0,external_wp_data_namespaceObject.select)(external_wp_blockEditor_namespaceObject.store).getSettings(), ['colors'], []);
  29986. const colorObject = (0,external_wp_blockEditor_namespaceObject.getColorObjectByAttributeValues)(colors, mainColor);
  29987. figureStyles = {
  29988. borderColor: colorObject.color
  29989. };
  29990. }
  29991. const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  29992. const blockquoteClasses = textColor || customTextColor ? classnames_default()('has-text-color', {
  29993. [blockquoteTextColorClass]: blockquoteTextColorClass
  29994. }) : undefined;
  29995. const blockquoteStyle = blockquoteTextColorClass ? undefined : {
  29996. color: customTextColor
  29997. };
  29998. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  29999. className: figureClass,
  30000. style: figureStyles
  30001. }, (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  30002. className: blockquoteClasses,
  30003. style: blockquoteStyle
  30004. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  30005. value: value,
  30006. multiline: true
  30007. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  30008. tagName: "cite",
  30009. value: citation
  30010. })));
  30011. },
  30012. migrate(_ref6) {
  30013. let {
  30014. className,
  30015. mainColor,
  30016. customMainColor,
  30017. customTextColor,
  30018. ...attributes
  30019. } = _ref6;
  30020. const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
  30021. let style = {};
  30022. if (customMainColor) {
  30023. if (!isSolidColorStyle) {
  30024. // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.
  30025. style = {
  30026. border: {
  30027. color: customMainColor
  30028. }
  30029. };
  30030. } else {
  30031. // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.
  30032. style = {
  30033. color: {
  30034. background: customMainColor
  30035. }
  30036. };
  30037. }
  30038. } // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.
  30039. if (customTextColor && style) {
  30040. style.color = { ...style.color,
  30041. text: customTextColor
  30042. };
  30043. }
  30044. return {
  30045. className,
  30046. backgroundColor: isSolidColorStyle ? mainColor : undefined,
  30047. borderColor: isSolidColorStyle ? undefined : mainColor,
  30048. textAlign: isSolidColorStyle ? 'left' : undefined,
  30049. style,
  30050. ...attributes
  30051. };
  30052. }
  30053. }, {
  30054. attributes: { ...pullquote_deprecated_blockAttributes
  30055. },
  30056. save(_ref7) {
  30057. let {
  30058. attributes
  30059. } = _ref7;
  30060. const {
  30061. value,
  30062. citation
  30063. } = attributes;
  30064. return (0,external_wp_element_namespaceObject.createElement)("blockquote", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  30065. value: value,
  30066. multiline: true
  30067. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  30068. tagName: "cite",
  30069. value: citation
  30070. }));
  30071. }
  30072. }, {
  30073. attributes: { ...pullquote_deprecated_blockAttributes,
  30074. citation: {
  30075. type: 'string',
  30076. source: 'html',
  30077. selector: 'footer'
  30078. },
  30079. align: {
  30080. type: 'string',
  30081. default: 'none'
  30082. }
  30083. },
  30084. save(_ref8) {
  30085. let {
  30086. attributes
  30087. } = _ref8;
  30088. const {
  30089. value,
  30090. citation,
  30091. align
  30092. } = attributes;
  30093. return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  30094. className: `align${align}`
  30095. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  30096. value: value,
  30097. multiline: true
  30098. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  30099. tagName: "footer",
  30100. value: citation
  30101. }));
  30102. }
  30103. }];
  30104. /* harmony default export */ var pullquote_deprecated = (pullquote_deprecated_deprecated);
  30105. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/figure.js
  30106. const Figure = 'figure';
  30107. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/blockquote.js
  30108. const BlockQuote = 'blockquote';
  30109. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/edit.js
  30110. /**
  30111. * External dependencies
  30112. */
  30113. /**
  30114. * WordPress dependencies
  30115. */
  30116. /**
  30117. * Internal dependencies
  30118. */
  30119. const isWebPlatform = external_wp_element_namespaceObject.Platform.OS === 'web';
  30120. function PullQuoteEdit(_ref) {
  30121. let {
  30122. attributes,
  30123. setAttributes,
  30124. isSelected,
  30125. insertBlocksAfter
  30126. } = _ref;
  30127. const {
  30128. textAlign,
  30129. citation,
  30130. value
  30131. } = attributes;
  30132. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  30133. className: classnames_default()({
  30134. [`has-text-align-${textAlign}`]: textAlign
  30135. })
  30136. });
  30137. const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) || isSelected;
  30138. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  30139. group: "block"
  30140. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  30141. value: textAlign,
  30142. onChange: nextAlign => {
  30143. setAttributes({
  30144. textAlign: nextAlign
  30145. });
  30146. }
  30147. })), (0,external_wp_element_namespaceObject.createElement)(Figure, blockProps, (0,external_wp_element_namespaceObject.createElement)(BlockQuote, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  30148. identifier: "value",
  30149. multiline: true,
  30150. value: value,
  30151. onChange: nextValue => setAttributes({
  30152. value: nextValue
  30153. }),
  30154. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Pullquote text'),
  30155. placeholder: // translators: placeholder text used for the quote
  30156. (0,external_wp_i18n_namespaceObject.__)('Add quote'),
  30157. textAlign: "center"
  30158. }), shouldShowCitation && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  30159. identifier: "citation",
  30160. tagName: isWebPlatform ? 'cite' : undefined,
  30161. style: {
  30162. display: 'block'
  30163. },
  30164. value: citation,
  30165. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Pullquote citation text'),
  30166. placeholder: // translators: placeholder text used for the citation
  30167. (0,external_wp_i18n_namespaceObject.__)('Add citation'),
  30168. onChange: nextCitation => setAttributes({
  30169. citation: nextCitation
  30170. }),
  30171. className: "wp-block-pullquote__citation",
  30172. __unstableMobileNoFocusOnMount: true,
  30173. textAlign: "center",
  30174. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
  30175. }))));
  30176. }
  30177. /* harmony default export */ var pullquote_edit = (PullQuoteEdit);
  30178. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/save.js
  30179. /**
  30180. * External dependencies
  30181. */
  30182. /**
  30183. * WordPress dependencies
  30184. */
  30185. function pullquote_save_save(_ref) {
  30186. let {
  30187. attributes
  30188. } = _ref;
  30189. const {
  30190. textAlign,
  30191. citation,
  30192. value
  30193. } = attributes;
  30194. const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation);
  30195. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  30196. className: classnames_default()({
  30197. [`has-text-align-${textAlign}`]: textAlign
  30198. })
  30199. }), (0,external_wp_element_namespaceObject.createElement)("blockquote", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  30200. value: value,
  30201. multiline: true
  30202. }), shouldShowCitation && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  30203. tagName: "cite",
  30204. value: citation
  30205. })));
  30206. }
  30207. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/transforms.js
  30208. /**
  30209. * WordPress dependencies
  30210. */
  30211. const pullquote_transforms_transforms = {
  30212. from: [{
  30213. type: 'block',
  30214. isMultiBlock: true,
  30215. blocks: ['core/paragraph'],
  30216. transform: attributes => {
  30217. return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
  30218. value: (0,external_wp_richText_namespaceObject.toHTMLString)({
  30219. value: (0,external_wp_richText_namespaceObject.join)(attributes.map(_ref => {
  30220. let {
  30221. content
  30222. } = _ref;
  30223. return (0,external_wp_richText_namespaceObject.create)({
  30224. html: content
  30225. });
  30226. }), '\u2028'),
  30227. multilineTag: 'p'
  30228. }),
  30229. anchor: attributes.anchor
  30230. });
  30231. }
  30232. }, {
  30233. type: 'block',
  30234. blocks: ['core/heading'],
  30235. transform: _ref2 => {
  30236. let {
  30237. content,
  30238. anchor
  30239. } = _ref2;
  30240. return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
  30241. value: `<p>${content}</p>`,
  30242. anchor
  30243. });
  30244. }
  30245. }],
  30246. to: [{
  30247. type: 'block',
  30248. blocks: ['core/paragraph'],
  30249. transform: _ref3 => {
  30250. let {
  30251. value,
  30252. citation
  30253. } = _ref3;
  30254. const paragraphs = [];
  30255. if (value && value !== '<p></p>') {
  30256. paragraphs.push(...(0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
  30257. html: value,
  30258. multilineTag: 'p'
  30259. }), '\u2028').map(piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  30260. content: (0,external_wp_richText_namespaceObject.toHTMLString)({
  30261. value: piece
  30262. })
  30263. })));
  30264. }
  30265. if (citation && citation !== '<p></p>') {
  30266. paragraphs.push((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  30267. content: citation
  30268. }));
  30269. }
  30270. if (paragraphs.length === 0) {
  30271. return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  30272. content: ''
  30273. });
  30274. }
  30275. return paragraphs;
  30276. }
  30277. }, {
  30278. type: 'block',
  30279. blocks: ['core/heading'],
  30280. transform: _ref4 => {
  30281. let {
  30282. value,
  30283. citation,
  30284. ...attrs
  30285. } = _ref4;
  30286. // If there is no pullquote content, use the citation as the
  30287. // content of the resulting heading. A nonexistent citation
  30288. // will result in an empty heading.
  30289. if (value === '<p></p>') {
  30290. return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
  30291. content: citation
  30292. });
  30293. }
  30294. const pieces = (0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
  30295. html: value,
  30296. multilineTag: 'p'
  30297. }), '\u2028');
  30298. const headingBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
  30299. content: (0,external_wp_richText_namespaceObject.toHTMLString)({
  30300. value: pieces[0]
  30301. })
  30302. });
  30303. if (!citation && pieces.length === 1) {
  30304. return headingBlock;
  30305. }
  30306. const quotePieces = pieces.slice(1);
  30307. const pullquoteBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', { ...attrs,
  30308. citation,
  30309. value: (0,external_wp_richText_namespaceObject.toHTMLString)({
  30310. value: quotePieces.length ? (0,external_wp_richText_namespaceObject.join)(pieces.slice(1), '\u2028') : (0,external_wp_richText_namespaceObject.create)(),
  30311. multilineTag: 'p'
  30312. })
  30313. });
  30314. return [headingBlock, pullquoteBlock];
  30315. }
  30316. }]
  30317. };
  30318. /* harmony default export */ var pullquote_transforms = (pullquote_transforms_transforms);
  30319. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/index.js
  30320. /**
  30321. * WordPress dependencies
  30322. */
  30323. /**
  30324. * Internal dependencies
  30325. */
  30326. const pullquote_metadata = {
  30327. $schema: "https://schemas.wp.org/trunk/block.json",
  30328. apiVersion: 2,
  30329. name: "core/pullquote",
  30330. title: "Pullquote",
  30331. category: "text",
  30332. description: "Give special visual emphasis to a quote from your text.",
  30333. textdomain: "default",
  30334. attributes: {
  30335. value: {
  30336. type: "string",
  30337. source: "html",
  30338. selector: "blockquote",
  30339. multiline: "p",
  30340. __experimentalRole: "content"
  30341. },
  30342. citation: {
  30343. type: "string",
  30344. source: "html",
  30345. selector: "cite",
  30346. "default": "",
  30347. __experimentalRole: "content"
  30348. },
  30349. textAlign: {
  30350. type: "string"
  30351. }
  30352. },
  30353. supports: {
  30354. anchor: true,
  30355. align: ["left", "right", "wide", "full"],
  30356. color: {
  30357. gradients: true,
  30358. background: true,
  30359. link: true,
  30360. __experimentalDefaultControls: {
  30361. background: true,
  30362. text: true
  30363. }
  30364. },
  30365. typography: {
  30366. fontSize: true,
  30367. lineHeight: true,
  30368. __experimentalFontStyle: true,
  30369. __experimentalFontWeight: true,
  30370. __experimentalLetterSpacing: true,
  30371. __experimentalTextTransform: true,
  30372. __experimentalDefaultControls: {
  30373. fontSize: true,
  30374. fontAppearance: true
  30375. }
  30376. },
  30377. __experimentalBorder: {
  30378. color: true,
  30379. radius: true,
  30380. style: true,
  30381. width: true,
  30382. __experimentalDefaultControls: {
  30383. color: true,
  30384. radius: true,
  30385. style: true,
  30386. width: true
  30387. }
  30388. }
  30389. },
  30390. editorStyle: "wp-block-pullquote-editor",
  30391. style: "wp-block-pullquote"
  30392. };
  30393. const {
  30394. name: pullquote_name
  30395. } = pullquote_metadata;
  30396. const pullquote_settings = {
  30397. icon: library_pullquote,
  30398. example: {
  30399. attributes: {
  30400. value: '<p>' + // translators: Quote serving as example for the Pullquote block. Attributed to Matt Mullenweg.
  30401. (0,external_wp_i18n_namespaceObject.__)('One of the hardest things to do in technology is disrupt yourself.') + '</p>',
  30402. citation: (0,external_wp_i18n_namespaceObject.__)('Matt Mullenweg')
  30403. }
  30404. },
  30405. transforms: pullquote_transforms,
  30406. edit: pullquote_edit,
  30407. save: pullquote_save_save,
  30408. deprecated: pullquote_deprecated
  30409. };
  30410. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/loop.js
  30411. /**
  30412. * WordPress dependencies
  30413. */
  30414. const loop = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  30415. viewBox: "0 0 24 24",
  30416. xmlns: "http://www.w3.org/2000/svg"
  30417. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  30418. d: "M18.1823 11.6392C18.1823 13.0804 17.0139 14.2487 15.5727 14.2487C14.3579 14.2487 13.335 13.4179 13.0453 12.2922L13.0377 12.2625L13.0278 12.2335L12.3985 10.377L12.3942 10.3785C11.8571 8.64997 10.246 7.39405 8.33961 7.39405C5.99509 7.39405 4.09448 9.29465 4.09448 11.6392C4.09448 13.9837 5.99509 15.8843 8.33961 15.8843C8.88499 15.8843 9.40822 15.781 9.88943 15.5923L9.29212 14.0697C8.99812 14.185 8.67729 14.2487 8.33961 14.2487C6.89838 14.2487 5.73003 13.0804 5.73003 11.6392C5.73003 10.1979 6.89838 9.02959 8.33961 9.02959C9.55444 9.02959 10.5773 9.86046 10.867 10.9862L10.8772 10.9836L11.4695 12.7311C11.9515 14.546 13.6048 15.8843 15.5727 15.8843C17.9172 15.8843 19.8178 13.9837 19.8178 11.6392C19.8178 9.29465 17.9172 7.39404 15.5727 7.39404C15.0287 7.39404 14.5066 7.4968 14.0264 7.6847L14.6223 9.20781C14.9158 9.093 15.2358 9.02959 15.5727 9.02959C17.0139 9.02959 18.1823 10.1979 18.1823 11.6392Z"
  30419. }));
  30420. /* harmony default export */ var library_loop = (loop);
  30421. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/settings.js
  30422. /**
  30423. * WordPress dependencies
  30424. */
  30425. const settings_settings = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  30426. xmlns: "http://www.w3.org/2000/svg",
  30427. viewBox: "0 0 24 24"
  30428. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  30429. d: "M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"
  30430. }));
  30431. /* harmony default export */ var library_settings = (settings_settings);
  30432. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/query-toolbar.js
  30433. /**
  30434. * WordPress dependencies
  30435. */
  30436. function QueryToolbar(_ref) {
  30437. let {
  30438. attributes: {
  30439. query,
  30440. displayLayout
  30441. },
  30442. setQuery,
  30443. setDisplayLayout,
  30444. openPatternSelectionModal
  30445. } = _ref;
  30446. const maxPageInputId = (0,external_wp_compose_namespaceObject.useInstanceId)(QueryToolbar, 'blocks-query-pagination-max-page-input');
  30447. const displayLayoutControls = [{
  30448. icon: library_list,
  30449. title: (0,external_wp_i18n_namespaceObject.__)('List view'),
  30450. onClick: () => setDisplayLayout({
  30451. type: 'list'
  30452. }),
  30453. isActive: (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.type) === 'list'
  30454. }, {
  30455. icon: library_grid,
  30456. title: (0,external_wp_i18n_namespaceObject.__)('Grid view'),
  30457. onClick: () => setDisplayLayout({
  30458. type: 'flex',
  30459. columns: (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.columns) || 3
  30460. }),
  30461. isActive: (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.type) === 'flex'
  30462. }];
  30463. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !query.inherit && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
  30464. contentClassName: "block-library-query-toolbar__popover",
  30465. renderToggle: _ref2 => {
  30466. let {
  30467. onToggle
  30468. } = _ref2;
  30469. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  30470. icon: library_settings,
  30471. label: (0,external_wp_i18n_namespaceObject.__)('Display settings'),
  30472. onClick: onToggle
  30473. });
  30474. },
  30475. renderContent: () => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, {
  30476. __unstableInputWidth: "60px",
  30477. label: (0,external_wp_i18n_namespaceObject.__)('Items per Page'),
  30478. labelPosition: "edge",
  30479. min: 1,
  30480. max: 100,
  30481. onChange: value => {
  30482. if (isNaN(value) || value < 1 || value > 100) {
  30483. return;
  30484. }
  30485. setQuery({
  30486. perPage: value
  30487. });
  30488. },
  30489. step: "1",
  30490. value: query.perPage,
  30491. isDragEnabled: false
  30492. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, {
  30493. __unstableInputWidth: "60px",
  30494. label: (0,external_wp_i18n_namespaceObject.__)('Offset'),
  30495. labelPosition: "edge",
  30496. min: 0,
  30497. max: 100,
  30498. onChange: value => {
  30499. if (isNaN(value) || value < 0 || value > 100) {
  30500. return;
  30501. }
  30502. setQuery({
  30503. offset: value
  30504. });
  30505. },
  30506. step: "1",
  30507. value: query.offset,
  30508. isDragEnabled: false
  30509. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  30510. id: maxPageInputId,
  30511. help: (0,external_wp_i18n_namespaceObject.__)('Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).')
  30512. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, {
  30513. id: maxPageInputId,
  30514. __unstableInputWidth: "60px",
  30515. label: (0,external_wp_i18n_namespaceObject.__)('Max page to show'),
  30516. labelPosition: "edge",
  30517. min: 0,
  30518. onChange: value => {
  30519. if (isNaN(value) || value < 0) {
  30520. return;
  30521. }
  30522. setQuery({
  30523. pages: value
  30524. });
  30525. },
  30526. step: "1",
  30527. value: query.pages,
  30528. isDragEnabled: false
  30529. })))
  30530. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
  30531. className: "wp-block-template-part__block-control-group"
  30532. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  30533. onClick: openPatternSelectionModal
  30534. }, (0,external_wp_i18n_namespaceObject.__)('Replace'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
  30535. controls: displayLayoutControls
  30536. }));
  30537. }
  30538. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/order-control.js
  30539. /**
  30540. * WordPress dependencies
  30541. */
  30542. const orderOptions = [{
  30543. label: (0,external_wp_i18n_namespaceObject.__)('Newest to oldest'),
  30544. value: 'date/desc'
  30545. }, {
  30546. label: (0,external_wp_i18n_namespaceObject.__)('Oldest to newest'),
  30547. value: 'date/asc'
  30548. }, {
  30549. /* translators: label for ordering posts by title in ascending order */
  30550. label: (0,external_wp_i18n_namespaceObject.__)('A → Z'),
  30551. value: 'title/asc'
  30552. }, {
  30553. /* translators: label for ordering posts by title in descending order */
  30554. label: (0,external_wp_i18n_namespaceObject.__)('Z → A'),
  30555. value: 'title/desc'
  30556. }];
  30557. function OrderControl(_ref) {
  30558. let {
  30559. order,
  30560. orderBy,
  30561. onChange
  30562. } = _ref;
  30563. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  30564. label: (0,external_wp_i18n_namespaceObject.__)('Order by'),
  30565. value: `${orderBy}/${order}`,
  30566. options: orderOptions,
  30567. onChange: value => {
  30568. const [newOrderBy, newOrder] = value.split('/');
  30569. onChange({
  30570. order: newOrder,
  30571. orderBy: newOrderBy
  30572. });
  30573. }
  30574. });
  30575. }
  30576. /* harmony default export */ var order_control = (OrderControl);
  30577. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/utils.js
  30578. /**
  30579. * WordPress dependencies
  30580. */
  30581. /**
  30582. * @typedef IHasNameAndId
  30583. * @property {string|number} id The entity's id.
  30584. * @property {string} name The entity's name.
  30585. */
  30586. /**
  30587. * The object used in Query block that contains info and helper mappings
  30588. * from an array of IHasNameAndId objects.
  30589. *
  30590. * @typedef {Object} QueryEntitiesInfo
  30591. * @property {IHasNameAndId[]} entities The array of entities.
  30592. * @property {Object<string, IHasNameAndId>} mapById Object mapping with the id as key and the entity as value.
  30593. * @property {Object<string, IHasNameAndId>} mapByName Object mapping with the name as key and the entity as value.
  30594. * @property {string[]} names Array with the entities' names.
  30595. */
  30596. /**
  30597. * Returns a helper object with mapping from Objects that implement
  30598. * the `IHasNameAndId` interface. The returned object is used for
  30599. * integration with `FormTokenField` component.
  30600. *
  30601. * @param {IHasNameAndId[]} entities The entities to extract of helper object.
  30602. * @return {QueryEntitiesInfo} The object with the entities information.
  30603. */
  30604. const getEntitiesInfo = entities => {
  30605. const mapping = entities === null || entities === void 0 ? void 0 : entities.reduce((accumulator, entity) => {
  30606. const {
  30607. mapById,
  30608. mapByName,
  30609. names
  30610. } = accumulator;
  30611. mapById[entity.id] = entity;
  30612. mapByName[entity.name] = entity;
  30613. names.push(entity.name);
  30614. return accumulator;
  30615. }, {
  30616. mapById: {},
  30617. mapByName: {},
  30618. names: []
  30619. });
  30620. return {
  30621. entities,
  30622. ...mapping
  30623. };
  30624. };
  30625. /**
  30626. * Returns a helper object that contains:
  30627. * 1. An `options` object from the available post types, to be passed to a `SelectControl`.
  30628. * 2. A helper map with available taxonomies per post type.
  30629. *
  30630. * @return {Object} The helper object related to post types.
  30631. */
  30632. const usePostTypes = () => {
  30633. const postTypes = (0,external_wp_data_namespaceObject.useSelect)(select => {
  30634. var _getPostTypes;
  30635. const {
  30636. getPostTypes
  30637. } = select(external_wp_coreData_namespaceObject.store);
  30638. const excludedPostTypes = ['attachment'];
  30639. const filteredPostTypes = (_getPostTypes = getPostTypes({
  30640. per_page: -1
  30641. })) === null || _getPostTypes === void 0 ? void 0 : _getPostTypes.filter(_ref => {
  30642. let {
  30643. viewable,
  30644. slug
  30645. } = _ref;
  30646. return viewable && !excludedPostTypes.includes(slug);
  30647. });
  30648. return filteredPostTypes;
  30649. }, []);
  30650. const postTypesTaxonomiesMap = (0,external_wp_element_namespaceObject.useMemo)(() => {
  30651. if (!(postTypes !== null && postTypes !== void 0 && postTypes.length)) return;
  30652. return postTypes.reduce((accumulator, type) => {
  30653. accumulator[type.slug] = type.taxonomies;
  30654. return accumulator;
  30655. }, {});
  30656. }, [postTypes]);
  30657. const postTypesSelectOptions = (0,external_wp_element_namespaceObject.useMemo)(() => (postTypes || []).map(_ref2 => {
  30658. let {
  30659. labels,
  30660. slug
  30661. } = _ref2;
  30662. return {
  30663. label: labels.singular_name,
  30664. value: slug
  30665. };
  30666. }), [postTypes]);
  30667. return {
  30668. postTypesTaxonomiesMap,
  30669. postTypesSelectOptions
  30670. };
  30671. };
  30672. /**
  30673. * Hook that returns the taxonomies associated with a specific post type.
  30674. *
  30675. * @param {string} postType The post type from which to retrieve the associated taxonomies.
  30676. * @return {Object[]} An array of the associated taxonomies.
  30677. */
  30678. const useTaxonomies = postType => {
  30679. const taxonomies = (0,external_wp_data_namespaceObject.useSelect)(select => {
  30680. const {
  30681. getTaxonomies
  30682. } = select(external_wp_coreData_namespaceObject.store);
  30683. const filteredTaxonomies = getTaxonomies({
  30684. type: postType,
  30685. per_page: -1,
  30686. context: 'view'
  30687. });
  30688. return filteredTaxonomies;
  30689. }, [postType]);
  30690. return taxonomies;
  30691. };
  30692. /**
  30693. * Recurses over a list of blocks and returns the first found
  30694. * Query Loop block's clientId.
  30695. *
  30696. * @param {WPBlock[]} blocks The list of blocks to look through.
  30697. * @return {string=} The first found Query Loop's clientId.
  30698. */
  30699. const getFirstQueryClientIdFromBlocks = blocks => {
  30700. const blocksQueue = [...blocks];
  30701. while (blocksQueue.length > 0) {
  30702. var _block$innerBlocks;
  30703. const block = blocksQueue.shift();
  30704. if (block.name === 'core/query') {
  30705. return block.clientId;
  30706. }
  30707. (_block$innerBlocks = block.innerBlocks) === null || _block$innerBlocks === void 0 ? void 0 : _block$innerBlocks.forEach(innerBlock => {
  30708. blocksQueue.push(innerBlock);
  30709. });
  30710. }
  30711. };
  30712. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/author-control.js
  30713. /**
  30714. * WordPress dependencies
  30715. */
  30716. /**
  30717. * Internal dependencies
  30718. */
  30719. const author_control_AUTHORS_QUERY = {
  30720. who: 'authors',
  30721. per_page: -1,
  30722. _fields: 'id,name',
  30723. context: 'view'
  30724. };
  30725. function AuthorControl(_ref) {
  30726. let {
  30727. value,
  30728. onChange
  30729. } = _ref;
  30730. const authorsList = (0,external_wp_data_namespaceObject.useSelect)(select => {
  30731. const {
  30732. getUsers
  30733. } = select(external_wp_coreData_namespaceObject.store);
  30734. return getUsers(author_control_AUTHORS_QUERY);
  30735. }, []);
  30736. if (!authorsList) {
  30737. return null;
  30738. }
  30739. const authorsInfo = getEntitiesInfo(authorsList);
  30740. /**
  30741. * We need to normalize the value because the block operates on a
  30742. * comma(`,`) separated string value and `FormTokenFiels` needs an
  30743. * array.
  30744. */
  30745. const normalizedValue = !value ? [] : value.toString().split(','); // Returns only the existing authors ids. This prevents the component
  30746. // from crashing in the editor, when non existing ids are provided.
  30747. const sanitizedValue = normalizedValue.reduce((accumulator, authorId) => {
  30748. const author = authorsInfo.mapById[authorId];
  30749. if (author) {
  30750. accumulator.push({
  30751. id: authorId,
  30752. value: author.name
  30753. });
  30754. }
  30755. return accumulator;
  30756. }, []);
  30757. const getIdByValue = (entitiesMappedByName, authorValue) => {
  30758. var _entitiesMappedByName;
  30759. const id = (authorValue === null || authorValue === void 0 ? void 0 : authorValue.id) || ((_entitiesMappedByName = entitiesMappedByName[authorValue]) === null || _entitiesMappedByName === void 0 ? void 0 : _entitiesMappedByName.id);
  30760. if (id) return id;
  30761. };
  30762. const onAuthorChange = newValue => {
  30763. const ids = Array.from(newValue.reduce((accumulator, author) => {
  30764. // Verify that new values point to existing entities.
  30765. const id = getIdByValue(authorsInfo.mapByName, author);
  30766. if (id) accumulator.add(id);
  30767. return accumulator;
  30768. }, new Set()));
  30769. onChange({
  30770. author: ids.join(',')
  30771. });
  30772. };
  30773. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormTokenField, {
  30774. label: (0,external_wp_i18n_namespaceObject.__)('Authors'),
  30775. value: sanitizedValue,
  30776. suggestions: authorsInfo.names,
  30777. onChange: onAuthorChange
  30778. });
  30779. }
  30780. /* harmony default export */ var author_control = (AuthorControl);
  30781. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/constants.js
  30782. const MAX_FETCHED_TERMS = 100;
  30783. const DEFAULTS_POSTS_PER_PAGE = 3;
  30784. /* harmony default export */ var constants = ({
  30785. MAX_FETCHED_TERMS,
  30786. DEFAULTS_POSTS_PER_PAGE
  30787. });
  30788. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/taxonomy-controls.js
  30789. /**
  30790. * WordPress dependencies
  30791. */
  30792. /**
  30793. * Internal dependencies
  30794. */
  30795. // Helper function to get the term id based on user input in terms `FormTokenField`.
  30796. const getTermIdByTermValue = (termsMappedByName, termValue) => {
  30797. var _termsMappedByName$te;
  30798. // First we check for exact match by `term.id` or case sensitive `term.name` match.
  30799. const termId = (termValue === null || termValue === void 0 ? void 0 : termValue.id) || ((_termsMappedByName$te = termsMappedByName[termValue]) === null || _termsMappedByName$te === void 0 ? void 0 : _termsMappedByName$te.id);
  30800. if (termId) return termId;
  30801. /**
  30802. * Here we make an extra check for entered terms in a non case sensitive way,
  30803. * to match user expectations, due to `FormTokenField` behaviour that shows
  30804. * suggestions which are case insensitive.
  30805. *
  30806. * Although WP tries to discourage users to add terms with the same name (case insensitive),
  30807. * it's still possible if you manually change the name, as long as the terms have different slugs.
  30808. * In this edge case we always apply the first match from the terms list.
  30809. */
  30810. const termValueLower = termValue.toLocaleLowerCase();
  30811. for (const term in termsMappedByName) {
  30812. if (term.toLocaleLowerCase() === termValueLower) {
  30813. return termsMappedByName[term].id;
  30814. }
  30815. }
  30816. };
  30817. function TaxonomyControls(_ref) {
  30818. let {
  30819. onChange,
  30820. query
  30821. } = _ref;
  30822. const taxonomies = useTaxonomies(query.postType);
  30823. const taxonomiesInfo = (0,external_wp_data_namespaceObject.useSelect)(select => {
  30824. const {
  30825. getEntityRecords
  30826. } = select(external_wp_coreData_namespaceObject.store);
  30827. const termsQuery = {
  30828. per_page: MAX_FETCHED_TERMS
  30829. };
  30830. const _taxonomiesInfo = taxonomies === null || taxonomies === void 0 ? void 0 : taxonomies.map(_ref2 => {
  30831. let {
  30832. slug,
  30833. name
  30834. } = _ref2;
  30835. const _terms = getEntityRecords('taxonomy', slug, termsQuery);
  30836. return {
  30837. slug,
  30838. name,
  30839. terms: getEntitiesInfo(_terms)
  30840. };
  30841. });
  30842. return _taxonomiesInfo;
  30843. }, [taxonomies]);
  30844. const onTermsChange = taxonomySlug => newTermValues => {
  30845. const taxonomyInfo = taxonomiesInfo.find(_ref3 => {
  30846. let {
  30847. slug
  30848. } = _ref3;
  30849. return slug === taxonomySlug;
  30850. });
  30851. if (!taxonomyInfo) return;
  30852. const termIds = Array.from(newTermValues.reduce((accumulator, termValue) => {
  30853. const termId = getTermIdByTermValue(taxonomyInfo.terms.mapByName, termValue);
  30854. if (termId) accumulator.add(termId);
  30855. return accumulator;
  30856. }, new Set()));
  30857. const newTaxQuery = { ...query.taxQuery,
  30858. [taxonomySlug]: termIds
  30859. };
  30860. onChange({
  30861. taxQuery: newTaxQuery
  30862. });
  30863. }; // Returns only the existing term ids in proper format to be
  30864. // used in `FormTokenField`. This prevents the component from
  30865. // crashing in the editor, when non existing term ids were provided.
  30866. const getExistingTaxQueryValue = taxonomySlug => {
  30867. var _query$taxQuery;
  30868. const taxonomyInfo = taxonomiesInfo.find(_ref4 => {
  30869. let {
  30870. slug
  30871. } = _ref4;
  30872. return slug === taxonomySlug;
  30873. });
  30874. if (!taxonomyInfo) return [];
  30875. return (((_query$taxQuery = query.taxQuery) === null || _query$taxQuery === void 0 ? void 0 : _query$taxQuery[taxonomySlug]) || []).reduce((accumulator, termId) => {
  30876. const term = taxonomyInfo.terms.mapById[termId];
  30877. if (term) {
  30878. accumulator.push({
  30879. id: termId,
  30880. value: term.name
  30881. });
  30882. }
  30883. return accumulator;
  30884. }, []);
  30885. };
  30886. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !!(taxonomiesInfo !== null && taxonomiesInfo !== void 0 && taxonomiesInfo.length) && taxonomiesInfo.map(_ref5 => {
  30887. var _terms$names;
  30888. let {
  30889. slug,
  30890. name,
  30891. terms
  30892. } = _ref5;
  30893. if (!(terms !== null && terms !== void 0 && (_terms$names = terms.names) !== null && _terms$names !== void 0 && _terms$names.length)) {
  30894. return null;
  30895. }
  30896. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormTokenField, {
  30897. key: slug,
  30898. label: name,
  30899. value: getExistingTaxQueryValue(slug),
  30900. suggestions: terms.names,
  30901. onChange: onTermsChange(slug)
  30902. });
  30903. }));
  30904. }
  30905. /* harmony default export */ var taxonomy_controls = (TaxonomyControls);
  30906. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/sticky-control.js
  30907. /**
  30908. * WordPress dependencies
  30909. */
  30910. const stickyOptions = [{
  30911. label: (0,external_wp_i18n_namespaceObject.__)('Include'),
  30912. value: ''
  30913. }, {
  30914. label: (0,external_wp_i18n_namespaceObject.__)('Exclude'),
  30915. value: 'exclude'
  30916. }, {
  30917. label: (0,external_wp_i18n_namespaceObject.__)('Only'),
  30918. value: 'only'
  30919. }];
  30920. function StickyControl(_ref) {
  30921. let {
  30922. value,
  30923. onChange
  30924. } = _ref;
  30925. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  30926. label: (0,external_wp_i18n_namespaceObject.__)('Sticky posts'),
  30927. options: stickyOptions,
  30928. value: value,
  30929. onChange: onChange,
  30930. help: (0,external_wp_i18n_namespaceObject.__)('Blog posts can be "stickied", a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.')
  30931. });
  30932. }
  30933. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/index.js
  30934. /**
  30935. * External dependencies
  30936. */
  30937. /**
  30938. * WordPress dependencies
  30939. */
  30940. /**
  30941. * Internal dependencies
  30942. */
  30943. function QueryInspectorControls(_ref) {
  30944. let {
  30945. attributes: {
  30946. query,
  30947. displayLayout
  30948. },
  30949. setQuery,
  30950. setDisplayLayout
  30951. } = _ref;
  30952. const {
  30953. order,
  30954. orderBy,
  30955. author: authorIds,
  30956. postType,
  30957. sticky,
  30958. inherit,
  30959. taxQuery
  30960. } = query;
  30961. const [showSticky, setShowSticky] = (0,external_wp_element_namespaceObject.useState)(postType === 'post');
  30962. const {
  30963. postTypesTaxonomiesMap,
  30964. postTypesSelectOptions
  30965. } = usePostTypes();
  30966. (0,external_wp_element_namespaceObject.useEffect)(() => {
  30967. setShowSticky(postType === 'post');
  30968. }, [postType]);
  30969. const onPostTypeChange = newValue => {
  30970. const updateQuery = {
  30971. postType: newValue
  30972. }; // We need to dynamically update the `taxQuery` property,
  30973. // by removing any not supported taxonomy from the query.
  30974. const supportedTaxonomies = postTypesTaxonomiesMap[newValue];
  30975. const updatedTaxQuery = Object.entries(taxQuery || {}).reduce((accumulator, _ref2) => {
  30976. let [taxonomySlug, terms] = _ref2;
  30977. if (supportedTaxonomies.includes(taxonomySlug)) {
  30978. accumulator[taxonomySlug] = terms;
  30979. }
  30980. return accumulator;
  30981. }, {});
  30982. updateQuery.taxQuery = !!Object.keys(updatedTaxQuery).length ? updatedTaxQuery : undefined;
  30983. if (newValue !== 'post') {
  30984. updateQuery.sticky = '';
  30985. }
  30986. setQuery(updateQuery);
  30987. };
  30988. const [querySearch, setQuerySearch] = (0,external_wp_element_namespaceObject.useState)(query.search);
  30989. const onChangeDebounced = (0,external_wp_element_namespaceObject.useCallback)((0,external_lodash_namespaceObject.debounce)(() => {
  30990. if (query.search !== querySearch) {
  30991. setQuery({
  30992. search: querySearch
  30993. });
  30994. }
  30995. }, 250), [querySearch, query.search]);
  30996. (0,external_wp_element_namespaceObject.useEffect)(() => {
  30997. onChangeDebounced();
  30998. return onChangeDebounced.cancel;
  30999. }, [querySearch, onChangeDebounced]);
  31000. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  31001. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  31002. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  31003. label: (0,external_wp_i18n_namespaceObject.__)('Inherit query from template'),
  31004. help: (0,external_wp_i18n_namespaceObject.__)('Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently.'),
  31005. checked: !!inherit,
  31006. onChange: value => setQuery({
  31007. inherit: !!value
  31008. })
  31009. }), !inherit && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  31010. options: postTypesSelectOptions,
  31011. value: postType,
  31012. label: (0,external_wp_i18n_namespaceObject.__)('Post type'),
  31013. onChange: onPostTypeChange,
  31014. help: (0,external_wp_i18n_namespaceObject.__)('WordPress contains different types of content and they are divided into collections called "Post types". By default there are a few different ones such as blog posts and pages, but plugins could add more.')
  31015. }), (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.type) === 'flex' && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  31016. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  31017. value: displayLayout.columns,
  31018. onChange: value => setDisplayLayout({
  31019. columns: value
  31020. }),
  31021. min: 2,
  31022. max: Math.max(6, displayLayout.columns)
  31023. }), displayLayout.columns > 6 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
  31024. status: "warning",
  31025. isDismissible: false
  31026. }, (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.'))), !inherit && (0,external_wp_element_namespaceObject.createElement)(order_control, {
  31027. order,
  31028. orderBy,
  31029. onChange: setQuery
  31030. }), !inherit && showSticky && (0,external_wp_element_namespaceObject.createElement)(StickyControl, {
  31031. value: sticky,
  31032. onChange: value => setQuery({
  31033. sticky: value
  31034. })
  31035. })), !inherit && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  31036. title: (0,external_wp_i18n_namespaceObject.__)('Filters')
  31037. }, (0,external_wp_element_namespaceObject.createElement)(taxonomy_controls, {
  31038. onChange: setQuery,
  31039. query: query
  31040. }), (0,external_wp_element_namespaceObject.createElement)(author_control, {
  31041. value: authorIds,
  31042. onChange: setQuery
  31043. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  31044. label: (0,external_wp_i18n_namespaceObject.__)('Keyword'),
  31045. value: querySearch,
  31046. onChange: setQuerySearch
  31047. })));
  31048. }
  31049. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/query-placeholder.js
  31050. /**
  31051. * WordPress dependencies
  31052. */
  31053. function QueryPlaceholder(_ref) {
  31054. let {
  31055. clientId,
  31056. name,
  31057. setAttributes,
  31058. icon,
  31059. label
  31060. } = _ref;
  31061. const {
  31062. defaultVariation,
  31063. scopeVariations
  31064. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  31065. const {
  31066. getBlockVariations,
  31067. getBlockType,
  31068. getDefaultBlockVariation
  31069. } = select(external_wp_blocks_namespaceObject.store);
  31070. return {
  31071. blockType: getBlockType(name),
  31072. defaultVariation: getDefaultBlockVariation(name, 'block'),
  31073. scopeVariations: getBlockVariations(name, 'block')
  31074. };
  31075. }, [name]);
  31076. const {
  31077. replaceInnerBlocks
  31078. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  31079. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  31080. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker, {
  31081. icon: icon,
  31082. label: label,
  31083. variations: scopeVariations,
  31084. onSelect: function () {
  31085. let nextVariation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultVariation;
  31086. if (nextVariation.attributes) {
  31087. setAttributes(nextVariation.attributes);
  31088. }
  31089. if (nextVariation.innerBlocks) {
  31090. replaceInnerBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(nextVariation.innerBlocks), false);
  31091. }
  31092. }
  31093. }));
  31094. }
  31095. /* harmony default export */ var query_placeholder = (QueryPlaceholder);
  31096. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/index.js
  31097. /**
  31098. * WordPress dependencies
  31099. */
  31100. /**
  31101. * Internal dependencies
  31102. */
  31103. const query_edit_TEMPLATE = [['core/post-template']];
  31104. function QueryContent(_ref) {
  31105. let {
  31106. attributes,
  31107. setAttributes,
  31108. openPatternSelectionModal
  31109. } = _ref;
  31110. const {
  31111. queryId,
  31112. query,
  31113. displayLayout,
  31114. tagName: TagName = 'div',
  31115. layout = {}
  31116. } = attributes;
  31117. const {
  31118. __unstableMarkNextChangeAsNotPersistent
  31119. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  31120. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(QueryContent);
  31121. const {
  31122. themeSupportsLayout
  31123. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  31124. var _getSettings;
  31125. const {
  31126. getSettings
  31127. } = select(external_wp_blockEditor_namespaceObject.store);
  31128. return {
  31129. themeSupportsLayout: (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout
  31130. };
  31131. }, []);
  31132. const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
  31133. const usedLayout = !!layout && layout.inherit ? defaultLayout : layout;
  31134. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  31135. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  31136. template: query_edit_TEMPLATE,
  31137. __experimentalLayout: themeSupportsLayout ? usedLayout : undefined
  31138. });
  31139. const {
  31140. postsPerPage
  31141. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  31142. const {
  31143. getSettings
  31144. } = select(external_wp_blockEditor_namespaceObject.store);
  31145. return {
  31146. postsPerPage: +getSettings().postsPerPage || DEFAULTS_POSTS_PER_PAGE
  31147. };
  31148. }, []); // There are some effects running where some initialization logic is
  31149. // happening and setting some values to some attributes (ex. queryId).
  31150. // These updates can cause an `undo trap` where undoing will result in
  31151. // resetting again, so we need to mark these changes as not persistent
  31152. // with `__unstableMarkNextChangeAsNotPersistent`.
  31153. // Changes in query property (which is an object) need to be in the same callback,
  31154. // because updates are batched after the render and changes in different query properties
  31155. // would cause to override previous wanted changes.
  31156. (0,external_wp_element_namespaceObject.useEffect)(() => {
  31157. const newQuery = {};
  31158. if (!query.perPage && postsPerPage) {
  31159. newQuery.perPage = postsPerPage;
  31160. }
  31161. if (!!Object.keys(newQuery).length) {
  31162. __unstableMarkNextChangeAsNotPersistent();
  31163. updateQuery(newQuery);
  31164. }
  31165. }, [query.perPage]); // We need this for multi-query block pagination.
  31166. // Query parameters for each block are scoped to their ID.
  31167. (0,external_wp_element_namespaceObject.useEffect)(() => {
  31168. if (!Number.isFinite(queryId)) {
  31169. __unstableMarkNextChangeAsNotPersistent();
  31170. setAttributes({
  31171. queryId: instanceId
  31172. });
  31173. }
  31174. }, [queryId, instanceId]);
  31175. const updateQuery = newQuery => setAttributes({
  31176. query: { ...query,
  31177. ...newQuery
  31178. }
  31179. });
  31180. const updateDisplayLayout = newDisplayLayout => setAttributes({
  31181. displayLayout: { ...displayLayout,
  31182. ...newDisplayLayout
  31183. }
  31184. });
  31185. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(QueryInspectorControls, {
  31186. attributes: attributes,
  31187. setQuery: updateQuery,
  31188. setDisplayLayout: updateDisplayLayout
  31189. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(QueryToolbar, {
  31190. attributes: attributes,
  31191. setQuery: updateQuery,
  31192. setDisplayLayout: updateDisplayLayout,
  31193. openPatternSelectionModal: openPatternSelectionModal
  31194. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  31195. __experimentalGroup: "advanced"
  31196. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  31197. label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
  31198. options: [{
  31199. label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'),
  31200. value: 'div'
  31201. }, {
  31202. label: '<main>',
  31203. value: 'main'
  31204. }, {
  31205. label: '<section>',
  31206. value: 'section'
  31207. }, {
  31208. label: '<aside>',
  31209. value: 'aside'
  31210. }],
  31211. value: TagName,
  31212. onChange: value => setAttributes({
  31213. tagName: value
  31214. })
  31215. })), (0,external_wp_element_namespaceObject.createElement)(TagName, innerBlocksProps));
  31216. }
  31217. function QueryPatternSetup(_ref2) {
  31218. var _blockType$icon;
  31219. let {
  31220. attributes,
  31221. clientId,
  31222. name,
  31223. openPatternSelectionModal,
  31224. setAttributes
  31225. } = _ref2;
  31226. const [isStartingBlank, setIsStartingBlank] = (0,external_wp_element_namespaceObject.useState)(false);
  31227. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  31228. const {
  31229. blockType,
  31230. allVariations,
  31231. hasPatterns
  31232. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  31233. const {
  31234. getBlockVariations,
  31235. getBlockType
  31236. } = select(external_wp_blocks_namespaceObject.store);
  31237. const {
  31238. getBlockRootClientId,
  31239. __experimentalGetPatternsByBlockTypes
  31240. } = select(external_wp_blockEditor_namespaceObject.store);
  31241. const rootClientId = getBlockRootClientId(clientId);
  31242. return {
  31243. blockType: getBlockType(name),
  31244. allVariations: getBlockVariations(name),
  31245. hasPatterns: !!__experimentalGetPatternsByBlockTypes(name, rootClientId).length
  31246. };
  31247. }, [name, clientId]);
  31248. const matchingVariation = (0,external_wp_blockEditor_namespaceObject.__experimentalGetMatchingVariation)(attributes, allVariations);
  31249. const icon = (matchingVariation === null || matchingVariation === void 0 ? void 0 : matchingVariation.icon) || (blockType === null || blockType === void 0 ? void 0 : (_blockType$icon = blockType.icon) === null || _blockType$icon === void 0 ? void 0 : _blockType$icon.src);
  31250. const label = (matchingVariation === null || matchingVariation === void 0 ? void 0 : matchingVariation.title) || (blockType === null || blockType === void 0 ? void 0 : blockType.title);
  31251. if (isStartingBlank) {
  31252. return (0,external_wp_element_namespaceObject.createElement)(query_placeholder, {
  31253. clientId: clientId,
  31254. name: name,
  31255. setAttributes: setAttributes,
  31256. icon: icon,
  31257. label: label
  31258. });
  31259. }
  31260. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  31261. icon: icon,
  31262. label: label,
  31263. instructions: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern for the query loop or start blank.')
  31264. }, !!hasPatterns && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  31265. variant: "primary",
  31266. onClick: openPatternSelectionModal
  31267. }, (0,external_wp_i18n_namespaceObject.__)('Choose')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  31268. variant: "secondary",
  31269. onClick: () => {
  31270. setIsStartingBlank(true);
  31271. }
  31272. }, (0,external_wp_i18n_namespaceObject.__)('Start blank'))));
  31273. }
  31274. const QueryEdit = props => {
  31275. const {
  31276. clientId,
  31277. name
  31278. } = props;
  31279. const [isPatternSelectionModalOpen, setIsPatternSelectionModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
  31280. const {
  31281. replaceBlock,
  31282. selectBlock
  31283. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  31284. const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_blockEditor_namespaceObject.store).getBlocks(clientId).length, [clientId]);
  31285. const Component = hasInnerBlocks ? QueryContent : QueryPatternSetup;
  31286. const onBlockPatternSelect = blocks => {
  31287. const clonedBlocks = blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block));
  31288. const firstQueryClientId = getFirstQueryClientIdFromBlocks(clonedBlocks);
  31289. replaceBlock(clientId, clonedBlocks);
  31290. if (firstQueryClientId) {
  31291. selectBlock(firstQueryClientId);
  31292. }
  31293. };
  31294. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(Component, _extends({}, props, {
  31295. openPatternSelectionModal: () => setIsPatternSelectionModalOpen(true)
  31296. })), isPatternSelectionModalOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
  31297. className: "block-editor-query-pattern__selection-modal",
  31298. title: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern'),
  31299. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
  31300. onRequestClose: () => setIsPatternSelectionModalOpen(false)
  31301. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternSetup, {
  31302. blockName: name,
  31303. clientId: clientId,
  31304. onBlockPatternSelect: onBlockPatternSelect
  31305. })));
  31306. };
  31307. /* harmony default export */ var query_edit = (QueryEdit);
  31308. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/save.js
  31309. /**
  31310. * WordPress dependencies
  31311. */
  31312. function QuerySave(_ref) {
  31313. let {
  31314. attributes: {
  31315. tagName: Tag = 'div'
  31316. }
  31317. } = _ref;
  31318. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
  31319. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  31320. return (0,external_wp_element_namespaceObject.createElement)(Tag, innerBlocksProps);
  31321. }
  31322. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/icons.js
  31323. /**
  31324. * WordPress dependencies
  31325. */
  31326. const titleDate = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  31327. xmlns: "http://www.w3.org/2000/svg",
  31328. viewBox: "0 0 48 48"
  31329. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  31330. d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zM7 26h12v1H7v-1zm34-5H7v3h34v-3zM7 38h12v1H7v-1zm34-5H7v3h34v-3z"
  31331. }));
  31332. const titleExcerpt = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  31333. xmlns: "http://www.w3.org/2000/svg",
  31334. viewBox: "0 0 48 48"
  31335. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  31336. d: "M41 9H7v3h34V9zm-4 5H7v1h30v-1zm4 3H7v1h34v-1zM7 20h30v1H7v-1zm0 12h30v1H7v-1zm34 3H7v1h34v-1zM7 38h30v1H7v-1zm34-11H7v3h34v-3z"
  31337. }));
  31338. const titleDateExcerpt = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  31339. xmlns: "http://www.w3.org/2000/svg",
  31340. viewBox: "0 0 48 48"
  31341. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  31342. d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zm22 3H7v1h34v-1zM7 20h34v1H7v-1zm0 12h12v1H7v-1zm34 3H7v1h34v-1zM7 38h34v1H7v-1zm34-11H7v3h34v-3z"
  31343. }));
  31344. const imageDateTitle = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  31345. xmlns: "http://www.w3.org/2000/svg",
  31346. viewBox: "0 0 48 48"
  31347. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  31348. d: "M7 9h34v6H7V9zm12 8H7v1h12v-1zm18 3H7v1h30v-1zm0 18H7v1h30v-1zM7 35h12v1H7v-1zm34-8H7v6h34v-6z"
  31349. }));
  31350. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/variations.js
  31351. /**
  31352. * WordPress dependencies
  31353. */
  31354. /**
  31355. * Internal dependencies
  31356. */
  31357. const QUERY_DEFAULT_ATTRIBUTES = {
  31358. query: {
  31359. perPage: 3,
  31360. pages: 0,
  31361. offset: 0,
  31362. postType: 'post',
  31363. order: 'desc',
  31364. orderBy: 'date',
  31365. author: '',
  31366. search: '',
  31367. exclude: [],
  31368. sticky: '',
  31369. inherit: false
  31370. }
  31371. };
  31372. const query_variations_variations = [{
  31373. name: 'posts-list',
  31374. title: (0,external_wp_i18n_namespaceObject.__)('Posts List'),
  31375. description: (0,external_wp_i18n_namespaceObject.__)('Display a list of your most recent posts, excluding sticky posts.'),
  31376. icon: post_list,
  31377. attributes: {
  31378. query: {
  31379. perPage: 4,
  31380. pages: 1,
  31381. offset: 0,
  31382. postType: 'post',
  31383. order: 'desc',
  31384. orderBy: 'date',
  31385. author: '',
  31386. search: '',
  31387. sticky: 'exclude',
  31388. inherit: false
  31389. }
  31390. },
  31391. scope: ['inserter']
  31392. }, {
  31393. name: 'title-date',
  31394. title: (0,external_wp_i18n_namespaceObject.__)('Title & Date'),
  31395. icon: titleDate,
  31396. attributes: { ...QUERY_DEFAULT_ATTRIBUTES
  31397. },
  31398. innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date']]], ['core/query-pagination'], ['core/query-no-results']],
  31399. scope: ['block']
  31400. }, {
  31401. name: 'title-excerpt',
  31402. title: (0,external_wp_i18n_namespaceObject.__)('Title & Excerpt'),
  31403. icon: titleExcerpt,
  31404. attributes: { ...QUERY_DEFAULT_ATTRIBUTES
  31405. },
  31406. innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-excerpt']]], ['core/query-pagination'], ['core/query-no-results']],
  31407. scope: ['block']
  31408. }, {
  31409. name: 'title-date-excerpt',
  31410. title: (0,external_wp_i18n_namespaceObject.__)('Title, Date, & Excerpt'),
  31411. icon: titleDateExcerpt,
  31412. attributes: { ...QUERY_DEFAULT_ATTRIBUTES
  31413. },
  31414. innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date'], ['core/post-excerpt']]], ['core/query-pagination'], ['core/query-no-results']],
  31415. scope: ['block']
  31416. }, {
  31417. name: 'image-date-title',
  31418. title: (0,external_wp_i18n_namespaceObject.__)('Image, Date, & Title'),
  31419. icon: imageDateTitle,
  31420. attributes: { ...QUERY_DEFAULT_ATTRIBUTES
  31421. },
  31422. innerBlocks: [['core/post-template', {}, [['core/post-featured-image'], ['core/post-date'], ['core/post-title']]], ['core/query-pagination'], ['core/query-no-results']],
  31423. scope: ['block']
  31424. }];
  31425. /* harmony default export */ var query_variations = (query_variations_variations);
  31426. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/deprecated.js
  31427. /**
  31428. * External dependencies
  31429. */
  31430. /**
  31431. * WordPress dependencies
  31432. */
  31433. const migrateToTaxQuery = attributes => {
  31434. var _query$categoryIds, _query$tagIds;
  31435. const {
  31436. query
  31437. } = attributes;
  31438. const newQuery = { ...(0,external_lodash_namespaceObject.omit)(query, ['categoryIds', 'tagIds'])
  31439. };
  31440. if ((_query$categoryIds = query.categoryIds) !== null && _query$categoryIds !== void 0 && _query$categoryIds.length || (_query$tagIds = query.tagIds) !== null && _query$tagIds !== void 0 && _query$tagIds.length) {
  31441. var _query$categoryIds2, _query$tagIds2;
  31442. newQuery.taxQuery = {
  31443. category: !!((_query$categoryIds2 = query.categoryIds) !== null && _query$categoryIds2 !== void 0 && _query$categoryIds2.length) ? query.categoryIds : undefined,
  31444. post_tag: !!((_query$tagIds2 = query.tagIds) !== null && _query$tagIds2 !== void 0 && _query$tagIds2.length) ? query.tagIds : undefined
  31445. };
  31446. }
  31447. return { ...attributes,
  31448. query: newQuery
  31449. };
  31450. };
  31451. const query_deprecated_deprecated = [// Version with `categoryIds and tagIds`.
  31452. {
  31453. attributes: {
  31454. queryId: {
  31455. type: 'number'
  31456. },
  31457. query: {
  31458. type: 'object',
  31459. default: {
  31460. perPage: null,
  31461. pages: 0,
  31462. offset: 0,
  31463. postType: 'post',
  31464. categoryIds: [],
  31465. tagIds: [],
  31466. order: 'desc',
  31467. orderBy: 'date',
  31468. author: '',
  31469. search: '',
  31470. exclude: [],
  31471. sticky: '',
  31472. inherit: true
  31473. }
  31474. },
  31475. tagName: {
  31476. type: 'string',
  31477. default: 'div'
  31478. },
  31479. displayLayout: {
  31480. type: 'object',
  31481. default: {
  31482. type: 'list'
  31483. }
  31484. }
  31485. },
  31486. supports: {
  31487. align: ['wide', 'full'],
  31488. html: false,
  31489. color: {
  31490. gradients: true,
  31491. link: true
  31492. },
  31493. __experimentalLayout: true
  31494. },
  31495. isEligible: _ref => {
  31496. let {
  31497. query: {
  31498. categoryIds,
  31499. tagIds
  31500. } = {}
  31501. } = _ref;
  31502. return categoryIds || tagIds;
  31503. },
  31504. migrate: migrateToTaxQuery,
  31505. save(_ref2) {
  31506. let {
  31507. attributes: {
  31508. tagName: Tag = 'div'
  31509. }
  31510. } = _ref2;
  31511. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
  31512. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  31513. return (0,external_wp_element_namespaceObject.createElement)(Tag, innerBlocksProps);
  31514. }
  31515. }, // Version with NO wrapper `div` element.
  31516. {
  31517. attributes: {
  31518. queryId: {
  31519. type: 'number'
  31520. },
  31521. query: {
  31522. type: 'object',
  31523. default: {
  31524. perPage: null,
  31525. pages: 0,
  31526. offset: 0,
  31527. postType: 'post',
  31528. categoryIds: [],
  31529. tagIds: [],
  31530. order: 'desc',
  31531. orderBy: 'date',
  31532. author: '',
  31533. search: '',
  31534. exclude: [],
  31535. sticky: '',
  31536. inherit: true
  31537. }
  31538. },
  31539. layout: {
  31540. type: 'object',
  31541. default: {
  31542. type: 'list'
  31543. }
  31544. }
  31545. },
  31546. supports: {
  31547. html: false
  31548. },
  31549. migrate(attributes) {
  31550. const withTaxQuery = migrateToTaxQuery(attributes);
  31551. return { ...(0,external_lodash_namespaceObject.omit)(withTaxQuery, ['layout']),
  31552. displayLayout: withTaxQuery.layout
  31553. };
  31554. },
  31555. save() {
  31556. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  31557. }
  31558. }];
  31559. /* harmony default export */ var query_deprecated = (query_deprecated_deprecated);
  31560. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/hooks.js
  31561. /**
  31562. * WordPress dependencies
  31563. */
  31564. const CreateNewPostLink = _ref => {
  31565. let {
  31566. attributes: {
  31567. query: {
  31568. postType
  31569. } = {}
  31570. } = {}
  31571. } = _ref;
  31572. if (!postType) return null;
  31573. const newPostUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('post-new.php', {
  31574. post_type: postType
  31575. });
  31576. return (0,external_wp_element_namespaceObject.createElement)("div", {
  31577. className: "wp-block-query__create-new-link"
  31578. }, (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('<a>Create a new post</a> for this feed.'), // eslint-disable-next-line jsx-a11y/anchor-has-content
  31579. {
  31580. a: (0,external_wp_element_namespaceObject.createElement)("a", {
  31581. href: newPostUrl
  31582. })
  31583. }));
  31584. };
  31585. /**
  31586. * Override the default edit UI to include layout controls
  31587. *
  31588. * @param {Function} BlockEdit Original component
  31589. * @return {Function} Wrapped component
  31590. */
  31591. const queryTopInspectorControls = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => {
  31592. const {
  31593. name,
  31594. isSelected
  31595. } = props;
  31596. if (name !== 'core/query' || !isSelected) {
  31597. return (0,external_wp_element_namespaceObject.createElement)(BlockEdit, _extends({
  31598. key: "edit"
  31599. }, props));
  31600. }
  31601. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(CreateNewPostLink, props)), (0,external_wp_element_namespaceObject.createElement)(BlockEdit, _extends({
  31602. key: "edit"
  31603. }, props)));
  31604. }, 'withInspectorControls');
  31605. /* harmony default export */ var query_hooks = (queryTopInspectorControls);
  31606. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/index.js
  31607. /**
  31608. * WordPress dependencies
  31609. */
  31610. /**
  31611. * Internal dependencies
  31612. */
  31613. const query_metadata = {
  31614. $schema: "https://schemas.wp.org/trunk/block.json",
  31615. apiVersion: 2,
  31616. name: "core/query",
  31617. title: "Query Loop",
  31618. category: "theme",
  31619. description: "An advanced block that allows displaying post types based on different query parameters and visual configurations.",
  31620. textdomain: "default",
  31621. attributes: {
  31622. queryId: {
  31623. type: "number"
  31624. },
  31625. query: {
  31626. type: "object",
  31627. "default": {
  31628. perPage: null,
  31629. pages: 0,
  31630. offset: 0,
  31631. postType: "post",
  31632. order: "desc",
  31633. orderBy: "date",
  31634. author: "",
  31635. search: "",
  31636. exclude: [],
  31637. sticky: "",
  31638. inherit: true,
  31639. taxQuery: null
  31640. }
  31641. },
  31642. tagName: {
  31643. type: "string",
  31644. "default": "div"
  31645. },
  31646. displayLayout: {
  31647. type: "object",
  31648. "default": {
  31649. type: "list"
  31650. }
  31651. }
  31652. },
  31653. providesContext: {
  31654. queryId: "queryId",
  31655. query: "query",
  31656. displayLayout: "displayLayout"
  31657. },
  31658. supports: {
  31659. align: ["wide", "full"],
  31660. html: false,
  31661. color: {
  31662. gradients: true,
  31663. link: true,
  31664. __experimentalDefaultControls: {
  31665. background: true,
  31666. text: true
  31667. }
  31668. },
  31669. __experimentalLayout: true
  31670. },
  31671. editorStyle: "wp-block-query-editor"
  31672. };
  31673. const {
  31674. name: query_name
  31675. } = query_metadata;
  31676. const query_settings = {
  31677. icon: library_loop,
  31678. edit: query_edit,
  31679. save: QuerySave,
  31680. variations: query_variations,
  31681. deprecated: query_deprecated
  31682. }; // Importing this file includes side effects and is whitelisted
  31683. // in block-library/package.json under `sideEffects`.
  31684. (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/query', query_hooks);
  31685. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-no-results/edit.js
  31686. /**
  31687. * WordPress dependencies
  31688. */
  31689. const query_no_results_edit_TEMPLATE = [['core/paragraph', {
  31690. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add text or blocks that will display when the query returns no results.')
  31691. }]];
  31692. function QueryNoResultsEdit() {
  31693. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  31694. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  31695. template: query_no_results_edit_TEMPLATE
  31696. });
  31697. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
  31698. }
  31699. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-no-results/save.js
  31700. /**
  31701. * WordPress dependencies
  31702. */
  31703. function QueryNoResultsSave() {
  31704. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  31705. }
  31706. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-no-results/index.js
  31707. /**
  31708. * WordPress dependencies
  31709. */
  31710. /**
  31711. * Internal dependencies
  31712. */
  31713. const query_no_results_metadata = {
  31714. $schema: "https://schemas.wp.org/trunk/block.json",
  31715. apiVersion: 2,
  31716. name: "core/query-no-results",
  31717. title: "No results",
  31718. category: "theme",
  31719. description: "Contains the block elements used to render content when no query results are found.",
  31720. parent: ["core/query"],
  31721. textdomain: "default",
  31722. usesContext: ["queryId", "query"],
  31723. supports: {
  31724. align: true,
  31725. reusable: false,
  31726. html: false,
  31727. color: {
  31728. gradients: true,
  31729. link: true
  31730. }
  31731. }
  31732. };
  31733. const {
  31734. name: query_no_results_name
  31735. } = query_no_results_metadata;
  31736. const query_no_results_settings = {
  31737. icon: library_loop,
  31738. edit: QueryNoResultsEdit,
  31739. save: QueryNoResultsSave
  31740. };
  31741. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/query-pagination-arrow-controls.js
  31742. /**
  31743. * WordPress dependencies
  31744. */
  31745. function QueryPaginationArrowControls(_ref) {
  31746. let {
  31747. value,
  31748. onChange
  31749. } = _ref;
  31750. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
  31751. label: (0,external_wp_i18n_namespaceObject.__)('Arrow'),
  31752. value: value,
  31753. onChange: onChange,
  31754. help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow appended to the next and previous page link.'),
  31755. isBlock: true
  31756. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  31757. value: "none",
  31758. label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Query Pagination Next/Previous blocks')
  31759. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  31760. value: "arrow",
  31761. label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Query Pagination Next/Previous blocks')
  31762. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  31763. value: "chevron",
  31764. label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Query Pagination Next/Previous blocks')
  31765. }));
  31766. }
  31767. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/edit.js
  31768. /**
  31769. * WordPress dependencies
  31770. */
  31771. /**
  31772. * Internal dependencies
  31773. */
  31774. const query_pagination_edit_TEMPLATE = [['core/query-pagination-previous'], ['core/query-pagination-numbers'], ['core/query-pagination-next']];
  31775. const edit_getDefaultBlockLayout = blockTypeOrName => {
  31776. const layoutBlockSupportConfig = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockTypeOrName, '__experimentalLayout');
  31777. return layoutBlockSupportConfig === null || layoutBlockSupportConfig === void 0 ? void 0 : layoutBlockSupportConfig.default;
  31778. };
  31779. function edit_QueryPaginationEdit(_ref) {
  31780. let {
  31781. attributes: {
  31782. paginationArrow,
  31783. layout
  31784. },
  31785. setAttributes,
  31786. clientId,
  31787. name
  31788. } = _ref;
  31789. const usedLayout = layout || edit_getDefaultBlockLayout(name);
  31790. const hasNextPreviousBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => {
  31791. const {
  31792. getBlocks
  31793. } = select(external_wp_blockEditor_namespaceObject.store);
  31794. const innerBlocks = getBlocks(clientId);
  31795. /**
  31796. * Show the `paginationArrow` control only if a
  31797. * `QueryPaginationNext/Previous` block exists.
  31798. */
  31799. return innerBlocks === null || innerBlocks === void 0 ? void 0 : innerBlocks.find(innerBlock => {
  31800. return ['core/query-pagination-next', 'core/query-pagination-previous'].includes(innerBlock.name);
  31801. });
  31802. }, []);
  31803. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  31804. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  31805. template: query_pagination_edit_TEMPLATE,
  31806. allowedBlocks: ['core/query-pagination-previous', 'core/query-pagination-numbers', 'core/query-pagination-next'],
  31807. __experimentalLayout: usedLayout
  31808. });
  31809. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, hasNextPreviousBlocks && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  31810. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  31811. }, (0,external_wp_element_namespaceObject.createElement)(QueryPaginationArrowControls, {
  31812. value: paginationArrow,
  31813. onChange: value => {
  31814. setAttributes({
  31815. paginationArrow: value
  31816. });
  31817. }
  31818. }))), (0,external_wp_element_namespaceObject.createElement)("nav", innerBlocksProps));
  31819. }
  31820. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/save.js
  31821. /**
  31822. * WordPress dependencies
  31823. */
  31824. function query_pagination_save_save() {
  31825. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  31826. }
  31827. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/deprecated.js
  31828. /**
  31829. * WordPress dependencies
  31830. */
  31831. const query_pagination_deprecated_deprecated = [// Version with wrapper `div` element.
  31832. {
  31833. save() {
  31834. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  31835. }
  31836. }];
  31837. /* harmony default export */ var query_pagination_deprecated = (query_pagination_deprecated_deprecated);
  31838. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js
  31839. /**
  31840. * WordPress dependencies
  31841. */
  31842. /**
  31843. * Internal dependencies
  31844. */
  31845. const query_pagination_metadata = {
  31846. $schema: "https://schemas.wp.org/trunk/block.json",
  31847. apiVersion: 2,
  31848. name: "core/query-pagination",
  31849. title: "Pagination",
  31850. category: "theme",
  31851. parent: ["core/query"],
  31852. description: "Displays a paginated navigation to next/previous set of posts, when applicable.",
  31853. textdomain: "default",
  31854. attributes: {
  31855. paginationArrow: {
  31856. type: "string",
  31857. "default": "none"
  31858. }
  31859. },
  31860. usesContext: ["queryId", "query"],
  31861. providesContext: {
  31862. paginationArrow: "paginationArrow"
  31863. },
  31864. supports: {
  31865. align: true,
  31866. reusable: false,
  31867. html: false,
  31868. color: {
  31869. gradients: true,
  31870. link: true,
  31871. __experimentalDefaultControls: {
  31872. background: true,
  31873. text: true,
  31874. link: true
  31875. }
  31876. },
  31877. __experimentalLayout: {
  31878. allowSwitching: false,
  31879. allowInheriting: false,
  31880. "default": {
  31881. type: "flex"
  31882. }
  31883. }
  31884. },
  31885. editorStyle: "wp-block-query-pagination-editor",
  31886. style: "wp-block-query-pagination"
  31887. };
  31888. const {
  31889. name: query_pagination_name
  31890. } = query_pagination_metadata;
  31891. const query_pagination_settings = {
  31892. icon: query_pagination,
  31893. edit: edit_QueryPaginationEdit,
  31894. save: query_pagination_save_save,
  31895. deprecated: query_pagination_deprecated
  31896. };
  31897. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/edit.js
  31898. /**
  31899. * WordPress dependencies
  31900. */
  31901. const query_pagination_next_edit_arrowMap = {
  31902. none: '',
  31903. arrow: '→',
  31904. chevron: '»'
  31905. };
  31906. function QueryPaginationNextEdit(_ref) {
  31907. let {
  31908. attributes: {
  31909. label
  31910. },
  31911. setAttributes,
  31912. context: {
  31913. paginationArrow
  31914. }
  31915. } = _ref;
  31916. const displayArrow = query_pagination_next_edit_arrowMap[paginationArrow];
  31917. return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
  31918. href: "#pagination-next-pseudo-link",
  31919. onClick: event => event.preventDefault()
  31920. }, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  31921. __experimentalVersion: 2,
  31922. tagName: "span",
  31923. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Next page link'),
  31924. placeholder: (0,external_wp_i18n_namespaceObject.__)('Next Page'),
  31925. value: label,
  31926. onChange: newLabel => setAttributes({
  31927. label: newLabel
  31928. })
  31929. }), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
  31930. className: `wp-block-query-pagination-next-arrow is-arrow-${paginationArrow}`
  31931. }, displayArrow));
  31932. }
  31933. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js
  31934. /**
  31935. * WordPress dependencies
  31936. */
  31937. /**
  31938. * Internal dependencies
  31939. */
  31940. const query_pagination_next_metadata = {
  31941. $schema: "https://schemas.wp.org/trunk/block.json",
  31942. apiVersion: 2,
  31943. name: "core/query-pagination-next",
  31944. title: "Next Page",
  31945. category: "theme",
  31946. parent: ["core/query-pagination"],
  31947. description: "Displays the next posts page link.",
  31948. textdomain: "default",
  31949. attributes: {
  31950. label: {
  31951. type: "string"
  31952. }
  31953. },
  31954. usesContext: ["queryId", "query", "paginationArrow"],
  31955. supports: {
  31956. reusable: false,
  31957. html: false,
  31958. color: {
  31959. gradients: true,
  31960. text: false,
  31961. __experimentalDefaultControls: {
  31962. background: true
  31963. }
  31964. },
  31965. typography: {
  31966. fontSize: true,
  31967. lineHeight: true,
  31968. __experimentalFontStyle: true,
  31969. __experimentalFontWeight: true,
  31970. __experimentalLetterSpacing: true,
  31971. __experimentalTextTransform: true,
  31972. __experimentalDefaultControls: {
  31973. fontSize: true
  31974. }
  31975. }
  31976. }
  31977. };
  31978. const {
  31979. name: query_pagination_next_name
  31980. } = query_pagination_next_metadata;
  31981. const query_pagination_next_settings = {
  31982. icon: query_pagination_next,
  31983. edit: QueryPaginationNextEdit
  31984. };
  31985. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/edit.js
  31986. /**
  31987. * WordPress dependencies
  31988. */
  31989. const createPaginationItem = function (content) {
  31990. let Tag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'a';
  31991. let extraClass = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  31992. return (0,external_wp_element_namespaceObject.createElement)(Tag, {
  31993. className: `page-numbers ${extraClass}`
  31994. }, content);
  31995. };
  31996. const previewPaginationNumbers = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, createPaginationItem(1), createPaginationItem(2), createPaginationItem(3, 'span', 'current'), createPaginationItem(4), createPaginationItem(5), createPaginationItem('...', 'span', 'dots'), createPaginationItem(8));
  31997. function QueryPaginationNumbersEdit() {
  31998. const paginationNumbers = previewPaginationNumbers();
  31999. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), paginationNumbers);
  32000. }
  32001. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js
  32002. /**
  32003. * WordPress dependencies
  32004. */
  32005. /**
  32006. * Internal dependencies
  32007. */
  32008. const query_pagination_numbers_metadata = {
  32009. $schema: "https://schemas.wp.org/trunk/block.json",
  32010. apiVersion: 2,
  32011. name: "core/query-pagination-numbers",
  32012. title: "Page Numbers",
  32013. category: "theme",
  32014. parent: ["core/query-pagination"],
  32015. description: "Displays a list of page numbers for pagination",
  32016. textdomain: "default",
  32017. usesContext: ["queryId", "query"],
  32018. supports: {
  32019. reusable: false,
  32020. html: false,
  32021. color: {
  32022. gradients: true,
  32023. text: false,
  32024. __experimentalDefaultControls: {
  32025. background: true
  32026. }
  32027. },
  32028. typography: {
  32029. fontSize: true,
  32030. lineHeight: true,
  32031. __experimentalFontStyle: true,
  32032. __experimentalFontWeight: true,
  32033. __experimentalLetterSpacing: true,
  32034. __experimentalTextTransform: true,
  32035. __experimentalDefaultControls: {
  32036. fontSize: true
  32037. }
  32038. }
  32039. },
  32040. editorStyle: "query-pagination-numbers-editor"
  32041. };
  32042. const {
  32043. name: query_pagination_numbers_name
  32044. } = query_pagination_numbers_metadata;
  32045. const query_pagination_numbers_settings = {
  32046. icon: query_pagination_numbers,
  32047. edit: QueryPaginationNumbersEdit
  32048. };
  32049. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/edit.js
  32050. /**
  32051. * WordPress dependencies
  32052. */
  32053. const query_pagination_previous_edit_arrowMap = {
  32054. none: '',
  32055. arrow: '←',
  32056. chevron: '«'
  32057. };
  32058. function QueryPaginationPreviousEdit(_ref) {
  32059. let {
  32060. attributes: {
  32061. label
  32062. },
  32063. setAttributes,
  32064. context: {
  32065. paginationArrow
  32066. }
  32067. } = _ref;
  32068. const displayArrow = query_pagination_previous_edit_arrowMap[paginationArrow];
  32069. return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
  32070. href: "#pagination-previous-pseudo-link",
  32071. onClick: event => event.preventDefault()
  32072. }, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
  32073. className: `wp-block-query-pagination-previous-arrow is-arrow-${paginationArrow}`
  32074. }, displayArrow), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  32075. __experimentalVersion: 2,
  32076. tagName: "span",
  32077. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Previous page link'),
  32078. placeholder: (0,external_wp_i18n_namespaceObject.__)('Previous Page'),
  32079. value: label,
  32080. onChange: newLabel => setAttributes({
  32081. label: newLabel
  32082. })
  32083. }));
  32084. }
  32085. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js
  32086. /**
  32087. * WordPress dependencies
  32088. */
  32089. /**
  32090. * Internal dependencies
  32091. */
  32092. const query_pagination_previous_metadata = {
  32093. $schema: "https://schemas.wp.org/trunk/block.json",
  32094. apiVersion: 2,
  32095. name: "core/query-pagination-previous",
  32096. title: "Previous Page",
  32097. category: "theme",
  32098. parent: ["core/query-pagination"],
  32099. description: "Displays the previous posts page link.",
  32100. textdomain: "default",
  32101. attributes: {
  32102. label: {
  32103. type: "string"
  32104. }
  32105. },
  32106. usesContext: ["queryId", "query", "paginationArrow"],
  32107. supports: {
  32108. reusable: false,
  32109. html: false,
  32110. color: {
  32111. gradients: true,
  32112. text: false,
  32113. __experimentalDefaultControls: {
  32114. background: true
  32115. }
  32116. },
  32117. typography: {
  32118. fontSize: true,
  32119. lineHeight: true,
  32120. __experimentalFontStyle: true,
  32121. __experimentalFontWeight: true,
  32122. __experimentalLetterSpacing: true,
  32123. __experimentalTextTransform: true,
  32124. __experimentalDefaultControls: {
  32125. fontSize: true
  32126. }
  32127. }
  32128. }
  32129. };
  32130. const {
  32131. name: query_pagination_previous_name
  32132. } = query_pagination_previous_metadata;
  32133. const query_pagination_previous_settings = {
  32134. icon: query_pagination_previous,
  32135. edit: QueryPaginationPreviousEdit
  32136. };
  32137. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/edit.js
  32138. /**
  32139. * External dependencies
  32140. */
  32141. /**
  32142. * WordPress dependencies
  32143. */
  32144. /**
  32145. * Internal dependencies
  32146. */
  32147. const SUPPORTED_TYPES = ['archive'];
  32148. function QueryTitleEdit(_ref) {
  32149. let {
  32150. attributes: {
  32151. type,
  32152. level,
  32153. textAlign
  32154. },
  32155. setAttributes
  32156. } = _ref;
  32157. const TagName = `h${level}`;
  32158. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  32159. className: classnames_default()({
  32160. [`has-text-align-${textAlign}`]: textAlign,
  32161. 'wp-block-query-title__placeholder': type === 'archive'
  32162. })
  32163. }); // The plan is to augment this block with more
  32164. // block variations like `Search Title`.
  32165. if (!SUPPORTED_TYPES.includes(type)) {
  32166. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Provided type is not supported.')));
  32167. }
  32168. let titleElement;
  32169. if (type === 'archive') {
  32170. titleElement = (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_i18n_namespaceObject.__)('Archive title'));
  32171. }
  32172. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  32173. group: "block"
  32174. }, (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
  32175. selectedLevel: level,
  32176. onChange: newLevel => setAttributes({
  32177. level: newLevel
  32178. })
  32179. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  32180. value: textAlign,
  32181. onChange: nextAlign => {
  32182. setAttributes({
  32183. textAlign: nextAlign
  32184. });
  32185. }
  32186. })), titleElement);
  32187. }
  32188. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/archive-title.js
  32189. /**
  32190. * WordPress dependencies
  32191. */
  32192. const archiveTitle = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  32193. viewBox: "0 0 24 24",
  32194. xmlns: "http://www.w3.org/2000/svg"
  32195. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  32196. d: "M6.08 10.103h2.914L9.657 12h1.417L8.23 4H6.846L4 12h1.417l.663-1.897Zm1.463-4.137.994 2.857h-2l1.006-2.857ZM20 16H4v-1.5h16V16Zm-7 4H4v-1.5h9V20Z"
  32197. }));
  32198. /* harmony default export */ var archive_title = (archiveTitle);
  32199. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/variations.js
  32200. /**
  32201. * WordPress dependencies
  32202. */
  32203. const query_title_variations_variations = [{
  32204. isDefault: true,
  32205. name: 'archive-title',
  32206. title: (0,external_wp_i18n_namespaceObject.__)('Archive Title'),
  32207. description: (0,external_wp_i18n_namespaceObject.__)('Display the archive title based on the queried object.'),
  32208. icon: archive_title,
  32209. attributes: {
  32210. type: 'archive'
  32211. },
  32212. scope: ['inserter']
  32213. }];
  32214. /**
  32215. * Add `isActive` function to all `query-title` variations, if not defined.
  32216. * `isActive` function is used to find a variation match from a created
  32217. * Block by providing its attributes.
  32218. */
  32219. query_title_variations_variations.forEach(variation => {
  32220. if (variation.isActive) return;
  32221. variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type;
  32222. });
  32223. /* harmony default export */ var query_title_variations = (query_title_variations_variations);
  32224. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/deprecated.js
  32225. /**
  32226. * Internal dependencies
  32227. */
  32228. const query_title_deprecated_v1 = {
  32229. attributes: {
  32230. type: {
  32231. type: 'string'
  32232. },
  32233. textAlign: {
  32234. type: 'string'
  32235. },
  32236. level: {
  32237. type: 'number',
  32238. default: 1
  32239. }
  32240. },
  32241. supports: {
  32242. align: ['wide', 'full'],
  32243. html: false,
  32244. color: {
  32245. gradients: true
  32246. },
  32247. spacing: {
  32248. margin: true
  32249. },
  32250. typography: {
  32251. fontSize: true,
  32252. lineHeight: true,
  32253. __experimentalFontFamily: true
  32254. }
  32255. },
  32256. save() {
  32257. return null;
  32258. },
  32259. migrate: migrate_font_family,
  32260. isEligible(_ref) {
  32261. var _style$typography;
  32262. let {
  32263. style
  32264. } = _ref;
  32265. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  32266. }
  32267. };
  32268. /**
  32269. * New deprecations need to be placed first
  32270. * for them to have higher priority.
  32271. *
  32272. * Old deprecations may need to be updated as well.
  32273. *
  32274. * See block-deprecation.md
  32275. */
  32276. /* harmony default export */ var query_title_deprecated = ([query_title_deprecated_v1]);
  32277. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-title.js
  32278. /**
  32279. * WordPress dependencies
  32280. */
  32281. const queryTitle = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  32282. viewBox: "0 0 24 24",
  32283. xmlns: "http://www.w3.org/2000/svg"
  32284. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  32285. d: "M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm1.3-2.9c.6.3 1.3.5 2 .5.8 0 1.4-.2 2-.5.1 0 .1-.1.2-.2l.8.7.9-1-.8-.7.3-.3a5.09 5.09 0 0 0 0-4.4c-.2-.6-.7-1-1.3-1.4-.6-.3-1.3-.5-2-.5-.8 0-1.4.2-2 .5-.7.4-1.1.8-1.5 1.5-.3.6-.5 1.3-.5 2.2 0 .8.2 1.6.5 2.2.4.6.8 1.1 1.4 1.4zm-.1-5c.2-.4.5-.7.8-1s.8-.4 1.3-.4 1 .1 1.3.4.6.6.8 1c.3.4.4.8.4 1.4 0 .5-.1 1-.3 1.4v.1l-1-.9-.9 1 .9.9c-.3.2-.7.3-1.2.3s-1-.1-1.3-.4c-.4-.2-.6-.6-.8-1C5 9 4.9 8.5 4.9 8c0-.6.1-1 .3-1.4z"
  32286. }));
  32287. /* harmony default export */ var query_title = (queryTitle);
  32288. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/index.js
  32289. /**
  32290. * Internal dependencies
  32291. */
  32292. const query_title_metadata = {
  32293. $schema: "https://schemas.wp.org/trunk/block.json",
  32294. apiVersion: 2,
  32295. name: "core/query-title",
  32296. title: "Query Title",
  32297. category: "theme",
  32298. description: "Display the query title.",
  32299. textdomain: "default",
  32300. attributes: {
  32301. type: {
  32302. type: "string"
  32303. },
  32304. textAlign: {
  32305. type: "string"
  32306. },
  32307. level: {
  32308. type: "number",
  32309. "default": 1
  32310. }
  32311. },
  32312. supports: {
  32313. align: ["wide", "full"],
  32314. html: false,
  32315. color: {
  32316. gradients: true,
  32317. __experimentalDefaultControls: {
  32318. background: true,
  32319. text: true
  32320. }
  32321. },
  32322. spacing: {
  32323. margin: true
  32324. },
  32325. typography: {
  32326. fontSize: true,
  32327. lineHeight: true,
  32328. __experimentalFontFamily: true,
  32329. __experimentalFontStyle: true,
  32330. __experimentalFontWeight: true,
  32331. __experimentalLetterSpacing: true,
  32332. __experimentalTextTransform: true,
  32333. __experimentalDefaultControls: {
  32334. fontSize: true,
  32335. fontAppearance: true,
  32336. textTransform: true
  32337. }
  32338. }
  32339. },
  32340. editorStyle: "wp-block-query-title-editor"
  32341. };
  32342. /**
  32343. * WordPress dependencies
  32344. */
  32345. const {
  32346. name: query_title_name
  32347. } = query_title_metadata;
  32348. const query_title_settings = {
  32349. icon: query_title,
  32350. edit: QueryTitleEdit,
  32351. variations: query_title_variations,
  32352. deprecated: query_title_deprecated
  32353. };
  32354. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/quote.js
  32355. /**
  32356. * WordPress dependencies
  32357. */
  32358. const quote = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  32359. viewBox: "0 0 24 24",
  32360. xmlns: "http://www.w3.org/2000/svg"
  32361. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  32362. d: "M13 6v6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H13zm-9 6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H4v6z"
  32363. }));
  32364. /* harmony default export */ var library_quote = (quote);
  32365. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/deprecated.js
  32366. /**
  32367. * External dependencies
  32368. */
  32369. /**
  32370. * WordPress dependencies
  32371. */
  32372. const quote_deprecated_blockAttributes = {
  32373. value: {
  32374. type: 'string',
  32375. source: 'html',
  32376. selector: 'blockquote',
  32377. multiline: 'p',
  32378. default: ''
  32379. },
  32380. citation: {
  32381. type: 'string',
  32382. source: 'html',
  32383. selector: 'cite',
  32384. default: ''
  32385. },
  32386. align: {
  32387. type: 'string'
  32388. }
  32389. };
  32390. const quote_deprecated_deprecated = [{
  32391. attributes: quote_deprecated_blockAttributes,
  32392. save(_ref) {
  32393. let {
  32394. attributes
  32395. } = _ref;
  32396. const {
  32397. align,
  32398. value,
  32399. citation
  32400. } = attributes;
  32401. return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  32402. style: {
  32403. textAlign: align ? align : null
  32404. }
  32405. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  32406. multiline: true,
  32407. value: value
  32408. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  32409. tagName: "cite",
  32410. value: citation
  32411. }));
  32412. }
  32413. }, {
  32414. attributes: { ...quote_deprecated_blockAttributes,
  32415. style: {
  32416. type: 'number',
  32417. default: 1
  32418. }
  32419. },
  32420. migrate(attributes) {
  32421. if (attributes.style === 2) {
  32422. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['style']),
  32423. className: attributes.className ? attributes.className + ' is-style-large' : 'is-style-large'
  32424. };
  32425. }
  32426. return attributes;
  32427. },
  32428. save(_ref2) {
  32429. let {
  32430. attributes
  32431. } = _ref2;
  32432. const {
  32433. align,
  32434. value,
  32435. citation,
  32436. style
  32437. } = attributes;
  32438. return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  32439. className: style === 2 ? 'is-large' : '',
  32440. style: {
  32441. textAlign: align ? align : null
  32442. }
  32443. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  32444. multiline: true,
  32445. value: value
  32446. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  32447. tagName: "cite",
  32448. value: citation
  32449. }));
  32450. }
  32451. }, {
  32452. attributes: { ...quote_deprecated_blockAttributes,
  32453. citation: {
  32454. type: 'string',
  32455. source: 'html',
  32456. selector: 'footer',
  32457. default: ''
  32458. },
  32459. style: {
  32460. type: 'number',
  32461. default: 1
  32462. }
  32463. },
  32464. migrate(attributes) {
  32465. if (!isNaN(parseInt(attributes.style))) {
  32466. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['style'])
  32467. };
  32468. }
  32469. return attributes;
  32470. },
  32471. save(_ref3) {
  32472. let {
  32473. attributes
  32474. } = _ref3;
  32475. const {
  32476. align,
  32477. value,
  32478. citation,
  32479. style
  32480. } = attributes;
  32481. return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  32482. className: `blocks-quote-style-${style}`,
  32483. style: {
  32484. textAlign: align ? align : null
  32485. }
  32486. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  32487. multiline: true,
  32488. value: value
  32489. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  32490. tagName: "footer",
  32491. value: citation
  32492. }));
  32493. }
  32494. }];
  32495. /* harmony default export */ var quote_deprecated = (quote_deprecated_deprecated);
  32496. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/edit.js
  32497. /**
  32498. * External dependencies
  32499. */
  32500. /**
  32501. * WordPress dependencies
  32502. */
  32503. const edit_isWebPlatform = external_wp_element_namespaceObject.Platform.OS === 'web';
  32504. function QuoteEdit(_ref) {
  32505. let {
  32506. attributes,
  32507. setAttributes,
  32508. isSelected,
  32509. mergeBlocks,
  32510. onReplace,
  32511. className,
  32512. insertBlocksAfter,
  32513. style
  32514. } = _ref;
  32515. const {
  32516. align,
  32517. value,
  32518. citation
  32519. } = attributes;
  32520. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  32521. className: classnames_default()(className, {
  32522. [`has-text-align-${align}`]: align
  32523. }),
  32524. style
  32525. });
  32526. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  32527. group: "block"
  32528. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  32529. value: align,
  32530. onChange: nextAlign => {
  32531. setAttributes({
  32532. align: nextAlign
  32533. });
  32534. }
  32535. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BlockQuotation, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  32536. identifier: "value",
  32537. multiline: true,
  32538. value: value,
  32539. onChange: nextValue => setAttributes({
  32540. value: nextValue
  32541. }),
  32542. onMerge: mergeBlocks,
  32543. onRemove: forward => {
  32544. const hasEmptyCitation = !citation || citation.length === 0;
  32545. if (!forward && hasEmptyCitation) {
  32546. onReplace([]);
  32547. }
  32548. },
  32549. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Quote text'),
  32550. placeholder: // translators: placeholder text used for the quote
  32551. (0,external_wp_i18n_namespaceObject.__)('Add quote'),
  32552. onReplace: onReplace,
  32553. onSplit: piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', { ...attributes,
  32554. value: piece
  32555. }),
  32556. __unstableOnSplitMiddle: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'),
  32557. textAlign: align
  32558. }), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  32559. identifier: "citation",
  32560. tagName: edit_isWebPlatform ? 'cite' : undefined,
  32561. style: {
  32562. display: 'block'
  32563. },
  32564. value: citation,
  32565. onChange: nextCitation => setAttributes({
  32566. citation: nextCitation
  32567. }),
  32568. __unstableMobileNoFocusOnMount: true,
  32569. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Quote citation text'),
  32570. placeholder: // translators: placeholder text used for the citation
  32571. (0,external_wp_i18n_namespaceObject.__)('Add citation'),
  32572. className: "wp-block-quote__citation",
  32573. textAlign: align,
  32574. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
  32575. })));
  32576. }
  32577. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/save.js
  32578. /**
  32579. * External dependencies
  32580. */
  32581. /**
  32582. * WordPress dependencies
  32583. */
  32584. function quote_save_save(_ref) {
  32585. let {
  32586. attributes
  32587. } = _ref;
  32588. const {
  32589. align,
  32590. value,
  32591. citation
  32592. } = attributes;
  32593. const className = classnames_default()({
  32594. [`has-text-align-${align}`]: align
  32595. });
  32596. return (0,external_wp_element_namespaceObject.createElement)("blockquote", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  32597. className
  32598. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  32599. multiline: true,
  32600. value: value
  32601. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  32602. tagName: "cite",
  32603. value: citation
  32604. }));
  32605. }
  32606. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/transforms.js
  32607. /**
  32608. * WordPress dependencies
  32609. */
  32610. const quote_transforms_transforms = {
  32611. from: [{
  32612. type: 'block',
  32613. isMultiBlock: true,
  32614. blocks: ['core/paragraph'],
  32615. transform: attributes => {
  32616. return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
  32617. value: (0,external_wp_richText_namespaceObject.toHTMLString)({
  32618. value: (0,external_wp_richText_namespaceObject.join)(attributes.map(_ref => {
  32619. let {
  32620. content
  32621. } = _ref;
  32622. return (0,external_wp_richText_namespaceObject.create)({
  32623. html: content
  32624. });
  32625. }), '\u2028'),
  32626. multilineTag: 'p'
  32627. }),
  32628. anchor: attributes.anchor
  32629. });
  32630. }
  32631. }, {
  32632. type: 'block',
  32633. blocks: ['core/heading'],
  32634. transform: _ref2 => {
  32635. let {
  32636. content,
  32637. anchor
  32638. } = _ref2;
  32639. return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
  32640. value: `<p>${content}</p>`,
  32641. anchor
  32642. });
  32643. }
  32644. }, {
  32645. type: 'block',
  32646. blocks: ['core/pullquote'],
  32647. transform: _ref3 => {
  32648. let {
  32649. value,
  32650. citation,
  32651. anchor
  32652. } = _ref3;
  32653. return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
  32654. value,
  32655. citation,
  32656. anchor
  32657. });
  32658. }
  32659. }, {
  32660. type: 'prefix',
  32661. prefix: '>',
  32662. transform: content => {
  32663. return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
  32664. value: `<p>${content}</p>`
  32665. });
  32666. }
  32667. }, {
  32668. type: 'raw',
  32669. isMatch: node => {
  32670. const isParagraphOrSingleCite = (() => {
  32671. let hasCitation = false;
  32672. return child => {
  32673. // Child is a paragraph.
  32674. if (child.nodeName === 'P') {
  32675. return true;
  32676. } // Child is a cite and no other cite child exists before it.
  32677. if (!hasCitation && child.nodeName === 'CITE') {
  32678. hasCitation = true;
  32679. return true;
  32680. }
  32681. };
  32682. })();
  32683. return node.nodeName === 'BLOCKQUOTE' && // The quote block can only handle multiline paragraph
  32684. // content with an optional cite child.
  32685. Array.from(node.childNodes).every(isParagraphOrSingleCite);
  32686. },
  32687. schema: _ref4 => {
  32688. let {
  32689. phrasingContentSchema
  32690. } = _ref4;
  32691. return {
  32692. blockquote: {
  32693. children: {
  32694. p: {
  32695. children: phrasingContentSchema
  32696. },
  32697. cite: {
  32698. children: phrasingContentSchema
  32699. }
  32700. }
  32701. }
  32702. };
  32703. }
  32704. }],
  32705. to: [{
  32706. type: 'block',
  32707. blocks: ['core/paragraph'],
  32708. transform: _ref5 => {
  32709. let {
  32710. value,
  32711. citation
  32712. } = _ref5;
  32713. const paragraphs = [];
  32714. if (value && value !== '<p></p>') {
  32715. paragraphs.push(...(0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
  32716. html: value,
  32717. multilineTag: 'p'
  32718. }), '\u2028').map(piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  32719. content: (0,external_wp_richText_namespaceObject.toHTMLString)({
  32720. value: piece
  32721. })
  32722. })));
  32723. }
  32724. if (citation && citation !== '<p></p>') {
  32725. paragraphs.push((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  32726. content: citation
  32727. }));
  32728. }
  32729. if (paragraphs.length === 0) {
  32730. return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  32731. content: ''
  32732. });
  32733. }
  32734. return paragraphs;
  32735. }
  32736. }, {
  32737. type: 'block',
  32738. blocks: ['core/heading'],
  32739. transform: _ref6 => {
  32740. let {
  32741. value,
  32742. citation,
  32743. ...attrs
  32744. } = _ref6;
  32745. // If there is no quote content, use the citation as the
  32746. // content of the resulting heading. A nonexistent citation
  32747. // will result in an empty heading.
  32748. if (value === '<p></p>') {
  32749. return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
  32750. content: citation
  32751. });
  32752. }
  32753. const pieces = (0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
  32754. html: value,
  32755. multilineTag: 'p'
  32756. }), '\u2028');
  32757. const headingBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
  32758. content: (0,external_wp_richText_namespaceObject.toHTMLString)({
  32759. value: pieces[0]
  32760. })
  32761. });
  32762. if (!citation && pieces.length === 1) {
  32763. return headingBlock;
  32764. }
  32765. const quotePieces = pieces.slice(1);
  32766. const quoteBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', { ...attrs,
  32767. citation,
  32768. value: (0,external_wp_richText_namespaceObject.toHTMLString)({
  32769. value: quotePieces.length ? (0,external_wp_richText_namespaceObject.join)(pieces.slice(1), '\u2028') : (0,external_wp_richText_namespaceObject.create)(),
  32770. multilineTag: 'p'
  32771. })
  32772. });
  32773. return [headingBlock, quoteBlock];
  32774. }
  32775. }, {
  32776. type: 'block',
  32777. blocks: ['core/pullquote'],
  32778. transform: _ref7 => {
  32779. let {
  32780. value,
  32781. citation,
  32782. anchor
  32783. } = _ref7;
  32784. return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
  32785. value,
  32786. citation,
  32787. anchor
  32788. });
  32789. }
  32790. }]
  32791. };
  32792. /* harmony default export */ var quote_transforms = (quote_transforms_transforms);
  32793. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/index.js
  32794. /**
  32795. * WordPress dependencies
  32796. */
  32797. /**
  32798. * Internal dependencies
  32799. */
  32800. const quote_metadata = {
  32801. $schema: "https://schemas.wp.org/trunk/block.json",
  32802. apiVersion: 2,
  32803. name: "core/quote",
  32804. title: "Quote",
  32805. category: "text",
  32806. description: "Give quoted text visual emphasis. \"In quoting others, we cite ourselves.\" \u2014 Julio Cort\xE1zar",
  32807. keywords: ["blockquote", "cite"],
  32808. textdomain: "default",
  32809. attributes: {
  32810. value: {
  32811. type: "string",
  32812. source: "html",
  32813. selector: "blockquote",
  32814. multiline: "p",
  32815. "default": "",
  32816. __experimentalRole: "content"
  32817. },
  32818. citation: {
  32819. type: "string",
  32820. source: "html",
  32821. selector: "cite",
  32822. "default": "",
  32823. __experimentalRole: "content"
  32824. },
  32825. align: {
  32826. type: "string"
  32827. }
  32828. },
  32829. supports: {
  32830. anchor: true,
  32831. __experimentalSlashInserter: true,
  32832. typography: {
  32833. fontSize: true,
  32834. lineHeight: true,
  32835. __experimentalFontStyle: true,
  32836. __experimentalFontWeight: true,
  32837. __experimentalLetterSpacing: true,
  32838. __experimentalTextTransform: true,
  32839. __experimentalDefaultControls: {
  32840. fontSize: true,
  32841. fontAppearance: true
  32842. }
  32843. },
  32844. color: {
  32845. gradients: true,
  32846. link: true,
  32847. __experimentalDefaultControls: {
  32848. background: true,
  32849. text: true
  32850. }
  32851. }
  32852. },
  32853. styles: [{
  32854. name: "default",
  32855. label: "Default",
  32856. isDefault: true
  32857. }, {
  32858. name: "plain",
  32859. label: "Plain"
  32860. }],
  32861. editorStyle: "wp-block-quote-editor",
  32862. style: "wp-block-quote"
  32863. };
  32864. const {
  32865. name: quote_name
  32866. } = quote_metadata;
  32867. const quote_settingsV1 = {
  32868. icon: library_quote,
  32869. example: {
  32870. attributes: {
  32871. value: '<p>' + (0,external_wp_i18n_namespaceObject.__)('In quoting others, we cite ourselves.') + '</p>',
  32872. citation: 'Julio Cortázar'
  32873. }
  32874. },
  32875. transforms: quote_transforms,
  32876. edit: QuoteEdit,
  32877. save: quote_save_save,
  32878. merge(attributes, _ref) {
  32879. let {
  32880. value,
  32881. citation
  32882. } = _ref;
  32883. // Quote citations cannot be merged. Pick the second one unless it's
  32884. // empty.
  32885. if (!citation) {
  32886. citation = attributes.citation;
  32887. }
  32888. if (!value || value === '<p></p>') {
  32889. return { ...attributes,
  32890. citation
  32891. };
  32892. }
  32893. return { ...attributes,
  32894. value: attributes.value + value,
  32895. citation
  32896. };
  32897. },
  32898. deprecated: quote_deprecated
  32899. };
  32900. let quote_settings = quote_settingsV1;
  32901. if (false) { var quote_window; }
  32902. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol.js
  32903. /**
  32904. * WordPress dependencies
  32905. */
  32906. const symbol = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  32907. xmlns: "http://www.w3.org/2000/svg",
  32908. viewBox: "0 0 24 24"
  32909. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  32910. d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"
  32911. }));
  32912. /* harmony default export */ var library_symbol = (symbol);
  32913. ;// CONCATENATED MODULE: external ["wp","reusableBlocks"]
  32914. var external_wp_reusableBlocks_namespaceObject = window["wp"]["reusableBlocks"];
  32915. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/ungroup.js
  32916. /**
  32917. * WordPress dependencies
  32918. */
  32919. const ungroup = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  32920. xmlns: "http://www.w3.org/2000/svg",
  32921. viewBox: "0 0 24 24"
  32922. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  32923. d: "M18 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z"
  32924. }));
  32925. /* harmony default export */ var library_ungroup = (ungroup);
  32926. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/block/edit.js
  32927. /**
  32928. * WordPress dependencies
  32929. */
  32930. function ReusableBlockEdit(_ref) {
  32931. let {
  32932. attributes: {
  32933. ref
  32934. },
  32935. clientId
  32936. } = _ref;
  32937. const [hasAlreadyRendered, RecursionProvider] = (0,external_wp_blockEditor_namespaceObject.__experimentalUseNoRecursiveRenders)(ref);
  32938. const {
  32939. record,
  32940. hasResolved
  32941. } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecord)('postType', 'wp_block', ref);
  32942. const isMissing = hasResolved && !record;
  32943. const canRemove = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).canRemoveBlock(clientId), [clientId]);
  32944. const {
  32945. __experimentalConvertBlockToStatic: convertBlockToStatic
  32946. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_reusableBlocks_namespaceObject.store);
  32947. const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_block', {
  32948. id: ref
  32949. });
  32950. const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_block', 'title', ref);
  32951. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  32952. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({}, {
  32953. value: blocks,
  32954. onInput,
  32955. onChange,
  32956. renderAppender: blocks !== null && blocks !== void 0 && blocks.length ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender
  32957. });
  32958. if (hasAlreadyRendered) {
  32959. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
  32960. }
  32961. if (isMissing) {
  32962. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block has been deleted or is unavailable.')));
  32963. }
  32964. if (!hasResolved) {
  32965. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)));
  32966. }
  32967. return (0,external_wp_element_namespaceObject.createElement)(RecursionProvider, null, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, canRemove && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  32968. onClick: () => convertBlockToStatic(clientId),
  32969. label: (0,external_wp_i18n_namespaceObject.__)('Convert to regular blocks'),
  32970. icon: library_ungroup,
  32971. showTooltip: true
  32972. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  32973. label: (0,external_wp_i18n_namespaceObject.__)('Name'),
  32974. value: title,
  32975. onChange: setTitle
  32976. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockContentOverlay, {
  32977. clientId: clientId,
  32978. wrapperProps: innerBlocksProps,
  32979. className: "block-library-block__reusable-block-container"
  32980. })));
  32981. }
  32982. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/block/index.js
  32983. /**
  32984. * WordPress dependencies
  32985. */
  32986. /**
  32987. * Internal dependencies
  32988. */
  32989. const block_metadata = {
  32990. $schema: "https://schemas.wp.org/trunk/block.json",
  32991. apiVersion: 2,
  32992. name: "core/block",
  32993. title: "Reusable block",
  32994. category: "reusable",
  32995. description: "Create and save content to reuse across your site. Update the block, and the changes apply everywhere it\u2019s used.",
  32996. textdomain: "default",
  32997. attributes: {
  32998. ref: {
  32999. type: "number"
  33000. }
  33001. },
  33002. supports: {
  33003. customClassName: false,
  33004. html: false,
  33005. inserter: false
  33006. },
  33007. editorStyle: "wp-block-editor"
  33008. };
  33009. const {
  33010. name: block_name
  33011. } = block_metadata;
  33012. const block_settings = {
  33013. edit: ReusableBlockEdit,
  33014. icon: library_symbol
  33015. };
  33016. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/read-more/edit.js
  33017. /**
  33018. * WordPress dependencies
  33019. */
  33020. function ReadMore(_ref) {
  33021. let {
  33022. attributes: {
  33023. content,
  33024. linkTarget
  33025. },
  33026. setAttributes,
  33027. insertBlocksAfter
  33028. } = _ref;
  33029. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  33030. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  33031. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  33032. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  33033. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  33034. onChange: value => setAttributes({
  33035. linkTarget: value ? '_blank' : '_self'
  33036. }),
  33037. checked: linkTarget === '_blank'
  33038. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  33039. tagName: "a",
  33040. "aria-label": (0,external_wp_i18n_namespaceObject.__)('"Read more" link text'),
  33041. placeholder: (0,external_wp_i18n_namespaceObject.__)('Read more'),
  33042. value: content,
  33043. onChange: newValue => setAttributes({
  33044. content: newValue
  33045. }),
  33046. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())),
  33047. withoutInteractiveFormatting: true
  33048. }, blockProps)));
  33049. }
  33050. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/read-more/index.js
  33051. /**
  33052. * WordPress dependencies
  33053. */
  33054. /**
  33055. * Internal dependencies
  33056. */
  33057. const read_more_metadata = {
  33058. $schema: "https://schemas.wp.org/trunk/block.json",
  33059. apiVersion: 2,
  33060. name: "core/read-more",
  33061. title: "Read More",
  33062. category: "theme",
  33063. description: "Displays the link of a post, page, or any other content-type.",
  33064. textdomain: "default",
  33065. attributes: {
  33066. content: {
  33067. type: "string"
  33068. },
  33069. linkTarget: {
  33070. type: "string",
  33071. "default": "_self"
  33072. }
  33073. },
  33074. usesContext: ["postId"],
  33075. supports: {
  33076. html: false,
  33077. color: {
  33078. gradients: true,
  33079. text: true
  33080. },
  33081. typography: {
  33082. fontSize: true,
  33083. lineHeight: true,
  33084. __experimentalFontFamily: true,
  33085. __experimentalFontWeight: true,
  33086. __experimentalFontStyle: true,
  33087. __experimentalTextTransform: true,
  33088. __experimentalLetterSpacing: true,
  33089. __experimentalTextDecoration: true,
  33090. __experimentalDefaultControls: {
  33091. fontSize: true,
  33092. textDecoration: true
  33093. }
  33094. },
  33095. spacing: {
  33096. margin: ["top", "bottom"],
  33097. padding: true,
  33098. __experimentalDefaultControls: {
  33099. padding: true
  33100. }
  33101. },
  33102. __experimentalBorder: {
  33103. color: true,
  33104. radius: true,
  33105. width: true,
  33106. __experimentalDefaultControls: {
  33107. width: true
  33108. }
  33109. }
  33110. },
  33111. style: "wp-block-read-more"
  33112. };
  33113. const {
  33114. name: read_more_name
  33115. } = read_more_metadata;
  33116. const read_more_settings = {
  33117. icon: library_link,
  33118. edit: ReadMore
  33119. };
  33120. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/rss.js
  33121. /**
  33122. * WordPress dependencies
  33123. */
  33124. const rss = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  33125. xmlns: "http://www.w3.org/2000/svg",
  33126. viewBox: "0 0 24 24"
  33127. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  33128. d: "M5 10.2h-.8v1.5H5c1.9 0 3.8.8 5.1 2.1 1.4 1.4 2.1 3.2 2.1 5.1v.8h1.5V19c0-2.3-.9-4.5-2.6-6.2-1.6-1.6-3.8-2.6-6.1-2.6zm10.4-1.6C12.6 5.8 8.9 4.2 5 4.2h-.8v1.5H5c3.5 0 6.9 1.4 9.4 3.9s3.9 5.8 3.9 9.4v.8h1.5V19c0-3.9-1.6-7.6-4.4-10.4zM4 20h3v-3H4v3z"
  33129. }));
  33130. /* harmony default export */ var library_rss = (rss);
  33131. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/rss/edit.js
  33132. /**
  33133. * WordPress dependencies
  33134. */
  33135. const DEFAULT_MIN_ITEMS = 1;
  33136. const DEFAULT_MAX_ITEMS = 20;
  33137. function RSSEdit(_ref) {
  33138. let {
  33139. attributes,
  33140. setAttributes
  33141. } = _ref;
  33142. const [isEditing, setIsEditing] = (0,external_wp_element_namespaceObject.useState)(!attributes.feedURL);
  33143. const {
  33144. blockLayout,
  33145. columns,
  33146. displayAuthor,
  33147. displayDate,
  33148. displayExcerpt,
  33149. excerptLength,
  33150. feedURL,
  33151. itemsToShow
  33152. } = attributes;
  33153. function toggleAttribute(propName) {
  33154. return () => {
  33155. const value = attributes[propName];
  33156. setAttributes({
  33157. [propName]: !value
  33158. });
  33159. };
  33160. }
  33161. function onSubmitURL(event) {
  33162. event.preventDefault();
  33163. if (feedURL) {
  33164. setAttributes({
  33165. feedURL: (0,external_wp_url_namespaceObject.prependHTTP)(feedURL)
  33166. });
  33167. setIsEditing(false);
  33168. }
  33169. }
  33170. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  33171. if (isEditing) {
  33172. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  33173. icon: library_rss,
  33174. label: "RSS"
  33175. }, (0,external_wp_element_namespaceObject.createElement)("form", {
  33176. onSubmit: onSubmitURL,
  33177. className: "wp-block-rss__placeholder-form"
  33178. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  33179. placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter URL here…'),
  33180. value: feedURL,
  33181. onChange: value => setAttributes({
  33182. feedURL: value
  33183. }),
  33184. className: "wp-block-rss__placeholder-input"
  33185. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  33186. variant: "primary",
  33187. type: "submit"
  33188. }, (0,external_wp_i18n_namespaceObject.__)('Use URL')))));
  33189. }
  33190. const toolbarControls = [{
  33191. icon: library_edit,
  33192. title: (0,external_wp_i18n_namespaceObject.__)('Edit RSS URL'),
  33193. onClick: () => setIsEditing(true)
  33194. }, {
  33195. icon: library_list,
  33196. title: (0,external_wp_i18n_namespaceObject.__)('List view'),
  33197. onClick: () => setAttributes({
  33198. blockLayout: 'list'
  33199. }),
  33200. isActive: blockLayout === 'list'
  33201. }, {
  33202. icon: library_grid,
  33203. title: (0,external_wp_i18n_namespaceObject.__)('Grid view'),
  33204. onClick: () => setAttributes({
  33205. blockLayout: 'grid'
  33206. }),
  33207. isActive: blockLayout === 'grid'
  33208. }];
  33209. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
  33210. controls: toolbarControls
  33211. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  33212. title: (0,external_wp_i18n_namespaceObject.__)('RSS settings')
  33213. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  33214. label: (0,external_wp_i18n_namespaceObject.__)('Number of items'),
  33215. value: itemsToShow,
  33216. onChange: value => setAttributes({
  33217. itemsToShow: value
  33218. }),
  33219. min: DEFAULT_MIN_ITEMS,
  33220. max: DEFAULT_MAX_ITEMS,
  33221. required: true
  33222. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  33223. label: (0,external_wp_i18n_namespaceObject.__)('Display author'),
  33224. checked: displayAuthor,
  33225. onChange: toggleAttribute('displayAuthor')
  33226. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  33227. label: (0,external_wp_i18n_namespaceObject.__)('Display date'),
  33228. checked: displayDate,
  33229. onChange: toggleAttribute('displayDate')
  33230. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  33231. label: (0,external_wp_i18n_namespaceObject.__)('Display excerpt'),
  33232. checked: displayExcerpt,
  33233. onChange: toggleAttribute('displayExcerpt')
  33234. }), displayExcerpt && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  33235. label: (0,external_wp_i18n_namespaceObject.__)('Max number of words in excerpt'),
  33236. value: excerptLength,
  33237. onChange: value => setAttributes({
  33238. excerptLength: value
  33239. }),
  33240. min: 10,
  33241. max: 100,
  33242. required: true
  33243. }), blockLayout === 'grid' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  33244. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  33245. value: columns,
  33246. onChange: value => setAttributes({
  33247. columns: value
  33248. }),
  33249. min: 2,
  33250. max: 6,
  33251. required: true
  33252. }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
  33253. block: "core/rss",
  33254. attributes: attributes
  33255. }))));
  33256. }
  33257. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/rss/index.js
  33258. /**
  33259. * WordPress dependencies
  33260. */
  33261. /**
  33262. * Internal dependencies
  33263. */
  33264. const rss_metadata = {
  33265. $schema: "https://schemas.wp.org/trunk/block.json",
  33266. apiVersion: 2,
  33267. name: "core/rss",
  33268. title: "RSS",
  33269. category: "widgets",
  33270. description: "Display entries from any RSS or Atom feed.",
  33271. keywords: ["atom", "feed"],
  33272. textdomain: "default",
  33273. attributes: {
  33274. columns: {
  33275. type: "number",
  33276. "default": 2
  33277. },
  33278. blockLayout: {
  33279. type: "string",
  33280. "default": "list"
  33281. },
  33282. feedURL: {
  33283. type: "string",
  33284. "default": ""
  33285. },
  33286. itemsToShow: {
  33287. type: "number",
  33288. "default": 5
  33289. },
  33290. displayExcerpt: {
  33291. type: "boolean",
  33292. "default": false
  33293. },
  33294. displayAuthor: {
  33295. type: "boolean",
  33296. "default": false
  33297. },
  33298. displayDate: {
  33299. type: "boolean",
  33300. "default": false
  33301. },
  33302. excerptLength: {
  33303. type: "number",
  33304. "default": 55
  33305. }
  33306. },
  33307. supports: {
  33308. align: true,
  33309. html: false
  33310. },
  33311. editorStyle: "wp-block-rss-editor",
  33312. style: "wp-block-rss"
  33313. };
  33314. const {
  33315. name: rss_name
  33316. } = rss_metadata;
  33317. const rss_settings = {
  33318. icon: library_rss,
  33319. example: {
  33320. attributes: {
  33321. feedURL: 'https://wordpress.org'
  33322. }
  33323. },
  33324. edit: RSSEdit
  33325. };
  33326. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js
  33327. /**
  33328. * WordPress dependencies
  33329. */
  33330. const search = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  33331. xmlns: "http://www.w3.org/2000/svg",
  33332. viewBox: "0 0 24 24"
  33333. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  33334. d: "M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"
  33335. }));
  33336. /* harmony default export */ var library_search = (search);
  33337. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/icons.js
  33338. /**
  33339. * WordPress dependencies
  33340. */
  33341. const buttonOnly = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  33342. xmlns: "http://www.w3.org/2000/svg",
  33343. viewBox: "0 0 24 24"
  33344. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33345. x: "7",
  33346. y: "10",
  33347. width: "10",
  33348. height: "4",
  33349. rx: "1",
  33350. fill: "currentColor"
  33351. }));
  33352. const buttonOutside = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  33353. xmlns: "http://www.w3.org/2000/svg",
  33354. viewBox: "0 0 24 24"
  33355. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33356. x: "4.75",
  33357. y: "15.25",
  33358. width: "6.5",
  33359. height: "9.5",
  33360. transform: "rotate(-90 4.75 15.25)",
  33361. stroke: "currentColor",
  33362. strokeWidth: "1.5",
  33363. fill: "none"
  33364. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33365. x: "16",
  33366. y: "10",
  33367. width: "4",
  33368. height: "4",
  33369. rx: "1",
  33370. fill: "currentColor"
  33371. }));
  33372. const buttonInside = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  33373. xmlns: "http://www.w3.org/2000/svg",
  33374. viewBox: "0 0 24 24"
  33375. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33376. x: "4.75",
  33377. y: "15.25",
  33378. width: "6.5",
  33379. height: "14.5",
  33380. transform: "rotate(-90 4.75 15.25)",
  33381. stroke: "currentColor",
  33382. strokeWidth: "1.5",
  33383. fill: "none"
  33384. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33385. x: "14",
  33386. y: "10",
  33387. width: "4",
  33388. height: "4",
  33389. rx: "1",
  33390. fill: "currentColor"
  33391. }));
  33392. const noButton = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  33393. xmlns: "http://www.w3.org/2000/svg",
  33394. viewBox: "0 0 24 24"
  33395. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33396. x: "4.75",
  33397. y: "15.25",
  33398. width: "6.5",
  33399. height: "14.5",
  33400. transform: "rotate(-90 4.75 15.25)",
  33401. stroke: "currentColor",
  33402. fill: "none",
  33403. strokeWidth: "1.5"
  33404. }));
  33405. const buttonWithIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  33406. xmlns: "http://www.w3.org/2000/svg",
  33407. viewBox: "0 0 24 24"
  33408. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33409. x: "4.75",
  33410. y: "7.75",
  33411. width: "14.5",
  33412. height: "8.5",
  33413. rx: "1.25",
  33414. stroke: "currentColor",
  33415. fill: "none",
  33416. strokeWidth: "1.5"
  33417. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33418. x: "8",
  33419. y: "11",
  33420. width: "8",
  33421. height: "2",
  33422. fill: "currentColor"
  33423. }));
  33424. const toggleLabel = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  33425. xmlns: "http://www.w3.org/2000/svg",
  33426. viewBox: "0 0 24 24"
  33427. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33428. x: "4.75",
  33429. y: "17.25",
  33430. width: "5.5",
  33431. height: "14.5",
  33432. transform: "rotate(-90 4.75 17.25)",
  33433. stroke: "currentColor",
  33434. fill: "none",
  33435. strokeWidth: "1.5"
  33436. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33437. x: "4",
  33438. y: "7",
  33439. width: "10",
  33440. height: "2",
  33441. fill: "currentColor"
  33442. }));
  33443. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/utils.js
  33444. /**
  33445. * Constants
  33446. */
  33447. const PC_WIDTH_DEFAULT = 50;
  33448. const PX_WIDTH_DEFAULT = 350;
  33449. const MIN_WIDTH = 220;
  33450. const MIN_WIDTH_UNIT = 'px';
  33451. /**
  33452. * Returns a boolean whether passed unit is percentage
  33453. *
  33454. * @param {string} unit Block width unit.
  33455. *
  33456. * @return {boolean} Whether unit is '%'.
  33457. */
  33458. function utils_isPercentageUnit(unit) {
  33459. return unit === '%';
  33460. }
  33461. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/edit.js
  33462. /**
  33463. * External dependencies
  33464. */
  33465. /**
  33466. * WordPress dependencies
  33467. */
  33468. /**
  33469. * Internal dependencies
  33470. */
  33471. // Used to calculate border radius adjustment to avoid "fat" corners when
  33472. // button is placed inside wrapper.
  33473. const DEFAULT_INNER_PADDING = '4px';
  33474. function SearchEdit(_ref) {
  33475. var _style$border, _style$border2, _style$border3;
  33476. let {
  33477. className,
  33478. attributes,
  33479. setAttributes,
  33480. toggleSelection,
  33481. isSelected,
  33482. clientId
  33483. } = _ref;
  33484. const {
  33485. label,
  33486. showLabel,
  33487. placeholder,
  33488. width,
  33489. widthUnit,
  33490. align,
  33491. buttonText,
  33492. buttonPosition,
  33493. buttonUseIcon,
  33494. style
  33495. } = attributes;
  33496. const insertedInNavigationBlock = (0,external_wp_data_namespaceObject.useSelect)(select => {
  33497. var _getBlockParentsByBlo;
  33498. const {
  33499. getBlockParentsByBlockName,
  33500. wasBlockJustInserted
  33501. } = select(external_wp_blockEditor_namespaceObject.store);
  33502. return !!((_getBlockParentsByBlo = getBlockParentsByBlockName(clientId, 'core/navigation')) !== null && _getBlockParentsByBlo !== void 0 && _getBlockParentsByBlo.length) && wasBlockJustInserted(clientId);
  33503. }, [clientId]);
  33504. const {
  33505. __unstableMarkNextChangeAsNotPersistent
  33506. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  33507. (0,external_wp_element_namespaceObject.useEffect)(() => {
  33508. if (!insertedInNavigationBlock) return; // This side-effect should not create an undo level.
  33509. __unstableMarkNextChangeAsNotPersistent();
  33510. setAttributes({
  33511. showLabel: false,
  33512. buttonUseIcon: true,
  33513. buttonPosition: 'button-inside'
  33514. });
  33515. }, [insertedInNavigationBlock]);
  33516. const borderRadius = style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius;
  33517. const borderColor = style === null || style === void 0 ? void 0 : (_style$border2 = style.border) === null || _style$border2 === void 0 ? void 0 : _style$border2.color;
  33518. const borderWidth = style === null || style === void 0 ? void 0 : (_style$border3 = style.border) === null || _style$border3 === void 0 ? void 0 : _style$border3.width;
  33519. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); // Check for old deprecated numerical border radius. Done as a separate
  33520. // check so that a borderRadius style won't overwrite the longhand
  33521. // per-corner styles.
  33522. if (typeof borderRadius === 'number') {
  33523. borderProps.style.borderRadius = `${borderRadius}px`;
  33524. }
  33525. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
  33526. const unitControlInstanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl);
  33527. const unitControlInputId = `wp-block-search__width-${unitControlInstanceId}`;
  33528. const isButtonPositionInside = 'button-inside' === buttonPosition;
  33529. const isButtonPositionOutside = 'button-outside' === buttonPosition;
  33530. const hasNoButton = 'no-button' === buttonPosition;
  33531. const hasOnlyButton = 'button-only' === buttonPosition;
  33532. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  33533. availableUnits: ['%', 'px'],
  33534. defaultValues: {
  33535. '%': PC_WIDTH_DEFAULT,
  33536. px: PX_WIDTH_DEFAULT
  33537. }
  33538. });
  33539. const getBlockClassNames = () => {
  33540. return classnames_default()(className, isButtonPositionInside ? 'wp-block-search__button-inside' : undefined, isButtonPositionOutside ? 'wp-block-search__button-outside' : undefined, hasNoButton ? 'wp-block-search__no-button' : undefined, hasOnlyButton ? 'wp-block-search__button-only' : undefined, !buttonUseIcon && !hasNoButton ? 'wp-block-search__text-button' : undefined, buttonUseIcon && !hasNoButton ? 'wp-block-search__icon-button' : undefined);
  33541. };
  33542. const buttonPositionControls = [{
  33543. role: 'menuitemradio',
  33544. title: (0,external_wp_i18n_namespaceObject.__)('Button outside'),
  33545. isActive: buttonPosition === 'button-outside',
  33546. icon: buttonOutside,
  33547. onClick: () => {
  33548. setAttributes({
  33549. buttonPosition: 'button-outside'
  33550. });
  33551. }
  33552. }, {
  33553. role: 'menuitemradio',
  33554. title: (0,external_wp_i18n_namespaceObject.__)('Button inside'),
  33555. isActive: buttonPosition === 'button-inside',
  33556. icon: buttonInside,
  33557. onClick: () => {
  33558. setAttributes({
  33559. buttonPosition: 'button-inside'
  33560. });
  33561. }
  33562. }, {
  33563. role: 'menuitemradio',
  33564. title: (0,external_wp_i18n_namespaceObject.__)('No button'),
  33565. isActive: buttonPosition === 'no-button',
  33566. icon: noButton,
  33567. onClick: () => {
  33568. setAttributes({
  33569. buttonPosition: 'no-button'
  33570. });
  33571. }
  33572. }];
  33573. const getButtonPositionIcon = () => {
  33574. switch (buttonPosition) {
  33575. case 'button-inside':
  33576. return buttonInside;
  33577. case 'button-outside':
  33578. return buttonOutside;
  33579. case 'no-button':
  33580. return noButton;
  33581. case 'button-only':
  33582. return buttonOnly;
  33583. }
  33584. };
  33585. const getResizableSides = () => {
  33586. if (hasOnlyButton) {
  33587. return {};
  33588. }
  33589. return {
  33590. right: align !== 'right',
  33591. left: align === 'right'
  33592. };
  33593. };
  33594. const renderTextField = () => {
  33595. // If the input is inside the wrapper, the wrapper gets the border color styles/classes, not the input control.
  33596. const textFieldClasses = classnames_default()('wp-block-search__input', isButtonPositionInside ? undefined : borderProps.className);
  33597. const textFieldStyles = isButtonPositionInside ? {
  33598. borderRadius
  33599. } : borderProps.style;
  33600. return (0,external_wp_element_namespaceObject.createElement)("input", {
  33601. className: textFieldClasses,
  33602. style: textFieldStyles,
  33603. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Optional placeholder text') // We hide the placeholder field's placeholder when there is a value. This
  33604. // stops screen readers from reading the placeholder field's placeholder
  33605. // which is confusing.
  33606. ,
  33607. placeholder: placeholder ? undefined : (0,external_wp_i18n_namespaceObject.__)('Optional placeholder…'),
  33608. value: placeholder,
  33609. onChange: event => setAttributes({
  33610. placeholder: event.target.value
  33611. })
  33612. });
  33613. };
  33614. const renderButton = () => {
  33615. // If the button is inside the wrapper, the wrapper gets the border color styles/classes, not the button.
  33616. const buttonClasses = classnames_default()('wp-block-search__button', colorProps.className, isButtonPositionInside ? undefined : borderProps.className, buttonUseIcon ? 'has-icon' : undefined);
  33617. const buttonStyles = { ...colorProps.style,
  33618. ...(isButtonPositionInside ? {
  33619. borderRadius
  33620. } : borderProps.style)
  33621. };
  33622. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, buttonUseIcon && (0,external_wp_element_namespaceObject.createElement)("button", {
  33623. type: "button",
  33624. className: buttonClasses,
  33625. style: buttonStyles,
  33626. "aria-label": buttonText ? (0,external_wp_dom_namespaceObject.__unstableStripHTML)(buttonText) : (0,external_wp_i18n_namespaceObject.__)('Search')
  33627. }, (0,external_wp_element_namespaceObject.createElement)(icon, {
  33628. icon: library_search
  33629. })), !buttonUseIcon && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  33630. className: buttonClasses,
  33631. style: buttonStyles,
  33632. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button text'),
  33633. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add button text…'),
  33634. withoutInteractiveFormatting: true,
  33635. value: buttonText,
  33636. onChange: html => setAttributes({
  33637. buttonText: html
  33638. })
  33639. }));
  33640. };
  33641. const controls = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  33642. title: (0,external_wp_i18n_namespaceObject.__)('Toggle search label'),
  33643. icon: toggleLabel,
  33644. onClick: () => {
  33645. setAttributes({
  33646. showLabel: !showLabel
  33647. });
  33648. },
  33649. className: showLabel ? 'is-pressed' : undefined
  33650. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
  33651. icon: getButtonPositionIcon(),
  33652. label: (0,external_wp_i18n_namespaceObject.__)('Change button position'),
  33653. controls: buttonPositionControls
  33654. }), !hasNoButton && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  33655. title: (0,external_wp_i18n_namespaceObject.__)('Use button with icon'),
  33656. icon: buttonWithIcon,
  33657. onClick: () => {
  33658. setAttributes({
  33659. buttonUseIcon: !buttonUseIcon
  33660. });
  33661. },
  33662. className: buttonUseIcon ? 'is-pressed' : undefined
  33663. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  33664. title: (0,external_wp_i18n_namespaceObject.__)('Display Settings')
  33665. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  33666. label: (0,external_wp_i18n_namespaceObject.__)('Width'),
  33667. id: unitControlInputId
  33668. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  33669. id: unitControlInputId,
  33670. min: `${MIN_WIDTH}${MIN_WIDTH_UNIT}`,
  33671. onChange: newWidth => {
  33672. const filteredWidth = widthUnit === '%' && parseInt(newWidth, 10) > 100 ? 100 : newWidth;
  33673. setAttributes({
  33674. width: parseInt(filteredWidth, 10)
  33675. });
  33676. },
  33677. onUnitChange: newUnit => {
  33678. setAttributes({
  33679. width: '%' === newUnit ? PC_WIDTH_DEFAULT : PX_WIDTH_DEFAULT,
  33680. widthUnit: newUnit
  33681. });
  33682. },
  33683. style: {
  33684. maxWidth: 80
  33685. },
  33686. value: `${width}${widthUnit}`,
  33687. units: units
  33688. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, {
  33689. className: "wp-block-search__components-button-group",
  33690. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Percentage Width')
  33691. }, [25, 50, 75, 100].map(widthValue => {
  33692. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  33693. key: widthValue,
  33694. isSmall: true,
  33695. variant: `${widthValue}%` === `${width}${widthUnit}` ? 0 : undefined,
  33696. onClick: () => setAttributes({
  33697. width: widthValue,
  33698. widthUnit: '%'
  33699. })
  33700. }, widthValue, "%");
  33701. }))))));
  33702. const padBorderRadius = radius => radius ? `calc(${radius} + ${DEFAULT_INNER_PADDING})` : undefined;
  33703. const getWrapperStyles = () => {
  33704. const styles = {
  33705. borderColor,
  33706. borderWidth: isButtonPositionInside ? borderWidth : undefined
  33707. };
  33708. const isNonZeroBorderRadius = borderRadius !== undefined && parseInt(borderRadius, 10) !== 0;
  33709. if (isButtonPositionInside && isNonZeroBorderRadius) {
  33710. // We have button inside wrapper and a border radius value to apply.
  33711. // Add default padding so we don't get "fat" corners.
  33712. //
  33713. // CSS calc() is used here to support non-pixel units. The inline
  33714. // style using calc() will only apply if both values have units.
  33715. if (typeof borderRadius === 'object') {
  33716. // Individual corner border radii present.
  33717. const {
  33718. topLeft,
  33719. topRight,
  33720. bottomLeft,
  33721. bottomRight
  33722. } = borderRadius;
  33723. return {
  33724. borderTopLeftRadius: padBorderRadius(topLeft),
  33725. borderTopRightRadius: padBorderRadius(topRight),
  33726. borderBottomLeftRadius: padBorderRadius(bottomLeft),
  33727. borderBottomRightRadius: padBorderRadius(bottomRight),
  33728. ...styles
  33729. };
  33730. } // The inline style using calc() will only apply if both values
  33731. // supplied to calc() have units. Deprecated block's may have
  33732. // unitless integer.
  33733. const radius = Number.isInteger(borderRadius) ? `${borderRadius}px` : borderRadius;
  33734. styles.borderRadius = `calc(${radius} + ${DEFAULT_INNER_PADDING})`;
  33735. }
  33736. return styles;
  33737. };
  33738. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  33739. className: getBlockClassNames()
  33740. });
  33741. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, controls, showLabel && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  33742. className: "wp-block-search__label",
  33743. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Label text'),
  33744. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add label…'),
  33745. withoutInteractiveFormatting: true,
  33746. value: label,
  33747. onChange: html => setAttributes({
  33748. label: html
  33749. })
  33750. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
  33751. size: {
  33752. width: `${width}${widthUnit}`
  33753. },
  33754. className: classnames_default()('wp-block-search__inside-wrapper', isButtonPositionInside ? borderProps.className : undefined),
  33755. style: getWrapperStyles(),
  33756. minWidth: MIN_WIDTH,
  33757. enable: getResizableSides(),
  33758. onResizeStart: (event, direction, elt) => {
  33759. setAttributes({
  33760. width: parseInt(elt.offsetWidth, 10),
  33761. widthUnit: 'px'
  33762. });
  33763. toggleSelection(false);
  33764. },
  33765. onResizeStop: (event, direction, elt, delta) => {
  33766. setAttributes({
  33767. width: parseInt(width + delta.width, 10)
  33768. });
  33769. toggleSelection(true);
  33770. },
  33771. showHandle: isSelected
  33772. }, (isButtonPositionInside || isButtonPositionOutside) && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, renderTextField(), renderButton()), hasOnlyButton && renderButton(), hasNoButton && renderTextField()));
  33773. }
  33774. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/variations.js
  33775. /**
  33776. * WordPress dependencies
  33777. */
  33778. const search_variations_variations = [{
  33779. name: 'default',
  33780. isDefault: true,
  33781. attributes: {
  33782. buttonText: (0,external_wp_i18n_namespaceObject.__)('Search'),
  33783. label: (0,external_wp_i18n_namespaceObject.__)('Search')
  33784. }
  33785. }];
  33786. /* harmony default export */ var search_variations = (search_variations_variations);
  33787. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/index.js
  33788. /**
  33789. * WordPress dependencies
  33790. */
  33791. /**
  33792. * Internal dependencies
  33793. */
  33794. const search_metadata = {
  33795. $schema: "https://schemas.wp.org/trunk/block.json",
  33796. apiVersion: 2,
  33797. name: "core/search",
  33798. title: "Search",
  33799. category: "widgets",
  33800. description: "Help visitors find your content.",
  33801. keywords: ["find"],
  33802. textdomain: "default",
  33803. attributes: {
  33804. label: {
  33805. type: "string",
  33806. __experimentalRole: "content"
  33807. },
  33808. showLabel: {
  33809. type: "boolean",
  33810. "default": true
  33811. },
  33812. placeholder: {
  33813. type: "string",
  33814. "default": "",
  33815. __experimentalRole: "content"
  33816. },
  33817. width: {
  33818. type: "number"
  33819. },
  33820. widthUnit: {
  33821. type: "string"
  33822. },
  33823. buttonText: {
  33824. type: "string",
  33825. __experimentalRole: "content"
  33826. },
  33827. buttonPosition: {
  33828. type: "string",
  33829. "default": "button-outside"
  33830. },
  33831. buttonUseIcon: {
  33832. type: "boolean",
  33833. "default": false
  33834. }
  33835. },
  33836. supports: {
  33837. align: ["left", "center", "right"],
  33838. color: {
  33839. gradients: true,
  33840. __experimentalSkipSerialization: true,
  33841. __experimentalDefaultControls: {
  33842. background: true,
  33843. text: true
  33844. }
  33845. },
  33846. __experimentalBorder: {
  33847. color: true,
  33848. radius: true,
  33849. width: true,
  33850. __experimentalSkipSerialization: true,
  33851. __experimentalDefaultControls: {
  33852. color: true,
  33853. radius: true,
  33854. width: true
  33855. }
  33856. },
  33857. html: false
  33858. },
  33859. editorStyle: "wp-block-search-editor",
  33860. style: "wp-block-search"
  33861. };
  33862. const {
  33863. name: search_name
  33864. } = search_metadata;
  33865. const search_settings = {
  33866. icon: library_search,
  33867. example: {},
  33868. variations: search_variations,
  33869. edit: SearchEdit
  33870. };
  33871. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/separator.js
  33872. /**
  33873. * WordPress dependencies
  33874. */
  33875. const separator = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  33876. viewBox: "0 0 24 24",
  33877. xmlns: "http://www.w3.org/2000/svg"
  33878. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  33879. d: "M20.2 7v4H3.8V7H2.2v9h1.6v-3.5h16.4V16h1.6V7z"
  33880. }));
  33881. /* harmony default export */ var library_separator = (separator);
  33882. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/use-deprecated-opacity.js
  33883. /**
  33884. * WordPress dependencies
  33885. */
  33886. function useDeprecatedOpacity(opacity, currentColor, setAttributes) {
  33887. const [deprecatedOpacityWithNoColor, setDeprecatedOpacityWithNoColor] = (0,external_wp_element_namespaceObject.useState)(false);
  33888. const previousColor = (0,external_wp_compose_namespaceObject.usePrevious)(currentColor); // A separator with no color set will always have previousColor set to undefined,
  33889. // and we need to differentiate these from those with color set that will return
  33890. // previousColor as undefined on the first render.
  33891. (0,external_wp_element_namespaceObject.useEffect)(() => {
  33892. if (opacity === 'css' && !currentColor && !previousColor) {
  33893. setDeprecatedOpacityWithNoColor(true);
  33894. }
  33895. }, [currentColor, previousColor, opacity]); // For deprecated blocks, that have a default 0.4 css opacity set, we
  33896. // need to remove this if the current color is changed, or a color is added.
  33897. // In these instances the opacity attribute is set back to the default of
  33898. // alpha-channel which allows a new custom opacity to be set via the color picker.
  33899. (0,external_wp_element_namespaceObject.useEffect)(() => {
  33900. if (opacity === 'css' && (deprecatedOpacityWithNoColor && currentColor || previousColor && currentColor !== previousColor)) {
  33901. setAttributes({
  33902. opacity: 'alpha-channel'
  33903. });
  33904. setDeprecatedOpacityWithNoColor(false);
  33905. }
  33906. }, [deprecatedOpacityWithNoColor, currentColor, previousColor]);
  33907. }
  33908. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/edit.js
  33909. /**
  33910. * External dependencies
  33911. */
  33912. /**
  33913. * WordPress dependencies
  33914. */
  33915. /**
  33916. * Internal dependencies
  33917. */
  33918. function SeparatorEdit(_ref) {
  33919. var _colorProps$style, _style$color;
  33920. let {
  33921. attributes,
  33922. setAttributes
  33923. } = _ref;
  33924. const {
  33925. backgroundColor,
  33926. opacity,
  33927. style
  33928. } = attributes;
  33929. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
  33930. const currentColor = colorProps === null || colorProps === void 0 ? void 0 : (_colorProps$style = colorProps.style) === null || _colorProps$style === void 0 ? void 0 : _colorProps$style.backgroundColor;
  33931. const hasCustomColor = !!(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.background);
  33932. useDeprecatedOpacity(opacity, currentColor, setAttributes); // The dots styles uses text for the dots, to change those dots color is
  33933. // using color, not backgroundColor.
  33934. const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', backgroundColor);
  33935. const className = classnames_default()({
  33936. 'has-text-color': backgroundColor || currentColor,
  33937. [colorClass]: colorClass,
  33938. 'has-css-opacity': opacity === 'css',
  33939. 'has-alpha-channel-opacity': opacity === 'alpha-channel'
  33940. }, colorProps.classname);
  33941. const styles = {
  33942. color: currentColor,
  33943. backgroundColor: currentColor
  33944. };
  33945. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.HorizontalRule, (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  33946. className,
  33947. style: hasCustomColor ? styles : undefined
  33948. })));
  33949. }
  33950. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/save.js
  33951. /**
  33952. * External dependencies
  33953. */
  33954. /**
  33955. * WordPress dependencies
  33956. */
  33957. function separatorSave(_ref) {
  33958. var _style$color, _colorProps$style;
  33959. let {
  33960. attributes
  33961. } = _ref;
  33962. const {
  33963. backgroundColor,
  33964. style,
  33965. opacity
  33966. } = attributes;
  33967. const customColor = style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.background;
  33968. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); // The hr support changing color using border-color, since border-color
  33969. // is not yet supported in the color palette, we use background-color.
  33970. // The dots styles uses text for the dots, to change those dots color is
  33971. // using color, not backgroundColor.
  33972. const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', backgroundColor);
  33973. const className = classnames_default()({
  33974. 'has-text-color': backgroundColor || customColor,
  33975. [colorClass]: colorClass,
  33976. 'has-css-opacity': opacity === 'css',
  33977. 'has-alpha-channel-opacity': opacity === 'alpha-channel'
  33978. }, colorProps.className);
  33979. const styles = {
  33980. backgroundColor: colorProps === null || colorProps === void 0 ? void 0 : (_colorProps$style = colorProps.style) === null || _colorProps$style === void 0 ? void 0 : _colorProps$style.backgroundColor,
  33981. color: colorClass ? undefined : customColor
  33982. };
  33983. return (0,external_wp_element_namespaceObject.createElement)("hr", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  33984. className,
  33985. style: styles
  33986. }));
  33987. }
  33988. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/transforms.js
  33989. /**
  33990. * WordPress dependencies
  33991. */
  33992. const separator_transforms_transforms = {
  33993. from: [{
  33994. type: 'enter',
  33995. regExp: /^-{3,}$/,
  33996. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/separator')
  33997. }, {
  33998. type: 'raw',
  33999. selector: 'hr',
  34000. schema: {
  34001. hr: {}
  34002. }
  34003. }]
  34004. };
  34005. /* harmony default export */ var separator_transforms = (separator_transforms_transforms);
  34006. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/deprecated.js
  34007. /**
  34008. * External dependencies
  34009. */
  34010. /**
  34011. * WordPress dependencies
  34012. */
  34013. const separator_deprecated_v1 = {
  34014. attributes: {
  34015. color: {
  34016. type: 'string'
  34017. },
  34018. customColor: {
  34019. type: 'string'
  34020. }
  34021. },
  34022. save(_ref) {
  34023. let {
  34024. attributes
  34025. } = _ref;
  34026. const {
  34027. color,
  34028. customColor
  34029. } = attributes; // the hr support changing color using border-color, since border-color
  34030. // is not yet supported in the color palette, we use background-color
  34031. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', color); // the dots styles uses text for the dots, to change those dots color is
  34032. // using color, not backgroundColor
  34033. const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', color);
  34034. const className = classnames_default()({
  34035. 'has-text-color has-background': color || customColor,
  34036. [backgroundClass]: backgroundClass,
  34037. [colorClass]: colorClass
  34038. });
  34039. const style = {
  34040. backgroundColor: backgroundClass ? undefined : customColor,
  34041. color: colorClass ? undefined : customColor
  34042. };
  34043. return (0,external_wp_element_namespaceObject.createElement)("hr", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  34044. className,
  34045. style
  34046. }));
  34047. },
  34048. migrate(attributes) {
  34049. const {
  34050. color,
  34051. customColor
  34052. } = attributes;
  34053. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['color', 'customColor']),
  34054. backgroundColor: color ? color : undefined,
  34055. opacity: 'css',
  34056. style: customColor ? {
  34057. color: {
  34058. background: customColor
  34059. }
  34060. } : undefined
  34061. };
  34062. }
  34063. };
  34064. /* harmony default export */ var separator_deprecated = ([separator_deprecated_v1]);
  34065. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/index.js
  34066. /**
  34067. * WordPress dependencies
  34068. */
  34069. /**
  34070. * Internal dependencies
  34071. */
  34072. const separator_metadata = {
  34073. $schema: "https://schemas.wp.org/trunk/block.json",
  34074. apiVersion: 2,
  34075. name: "core/separator",
  34076. title: "Separator",
  34077. category: "design",
  34078. description: "Create a break between ideas or sections with a horizontal separator.",
  34079. keywords: ["horizontal-line", "hr", "divider"],
  34080. textdomain: "default",
  34081. attributes: {
  34082. opacity: {
  34083. type: "string",
  34084. "default": "alpha-channel"
  34085. }
  34086. },
  34087. supports: {
  34088. anchor: true,
  34089. align: ["center", "wide", "full"],
  34090. color: {
  34091. __experimentalSkipSerialization: true,
  34092. gradients: true,
  34093. background: true,
  34094. text: false,
  34095. __experimentalDefaultControls: {
  34096. background: true
  34097. }
  34098. }
  34099. },
  34100. styles: [{
  34101. name: "default",
  34102. label: "Default",
  34103. isDefault: true
  34104. }, {
  34105. name: "wide",
  34106. label: "Wide Line"
  34107. }, {
  34108. name: "dots",
  34109. label: "Dots"
  34110. }],
  34111. editorStyle: "wp-block-separator-editor",
  34112. style: "wp-block-separator"
  34113. };
  34114. const {
  34115. name: separator_name
  34116. } = separator_metadata;
  34117. const separator_settings = {
  34118. icon: library_separator,
  34119. example: {
  34120. attributes: {
  34121. customColor: '#065174',
  34122. className: 'is-style-wide'
  34123. }
  34124. },
  34125. transforms: separator_transforms,
  34126. edit: SeparatorEdit,
  34127. save: separatorSave,
  34128. deprecated: separator_deprecated
  34129. };
  34130. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/shortcode.js
  34131. /**
  34132. * WordPress dependencies
  34133. */
  34134. const shortcode = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  34135. viewBox: "0 0 24 24",
  34136. xmlns: "http://www.w3.org/2000/svg"
  34137. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  34138. d: "M16 4.2v1.5h2.5v12.5H16v1.5h4V4.2h-4zM4.2 19.8h4v-1.5H5.8V5.8h2.5V4.2h-4l-.1 15.6zm5.1-3.1l1.4.6 4-10-1.4-.6-4 10z"
  34139. }));
  34140. /* harmony default export */ var library_shortcode = (shortcode);
  34141. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/edit.js
  34142. /**
  34143. * WordPress dependencies
  34144. */
  34145. function ShortcodeEdit(_ref) {
  34146. let {
  34147. attributes,
  34148. setAttributes
  34149. } = _ref;
  34150. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ShortcodeEdit);
  34151. const inputId = `blocks-shortcode-input-${instanceId}`;
  34152. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  34153. className: 'components-placeholder'
  34154. }), (0,external_wp_element_namespaceObject.createElement)("label", {
  34155. htmlFor: inputId,
  34156. className: "components-placeholder__label"
  34157. }, (0,external_wp_element_namespaceObject.createElement)(icon, {
  34158. icon: library_shortcode
  34159. }), (0,external_wp_i18n_namespaceObject.__)('Shortcode')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  34160. className: "blocks-shortcode__textarea",
  34161. id: inputId,
  34162. value: attributes.text,
  34163. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Shortcode text'),
  34164. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write shortcode here…'),
  34165. onChange: text => setAttributes({
  34166. text
  34167. })
  34168. }));
  34169. }
  34170. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/save.js
  34171. /**
  34172. * WordPress dependencies
  34173. */
  34174. function shortcode_save_save(_ref) {
  34175. let {
  34176. attributes
  34177. } = _ref;
  34178. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.text);
  34179. }
  34180. ;// CONCATENATED MODULE: external ["wp","autop"]
  34181. var external_wp_autop_namespaceObject = window["wp"]["autop"];
  34182. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/transforms.js
  34183. /**
  34184. * WordPress dependencies
  34185. */
  34186. const shortcode_transforms_transforms = {
  34187. from: [{
  34188. type: 'shortcode',
  34189. // Per "Shortcode names should be all lowercase and use all
  34190. // letters, but numbers and underscores should work fine too.
  34191. // Be wary of using hyphens (dashes), you'll be better off not
  34192. // using them." in https://codex.wordpress.org/Shortcode_API
  34193. // Require that the first character be a letter. This notably
  34194. // prevents footnote markings ([1]) from being caught as
  34195. // shortcodes.
  34196. tag: '[a-z][a-z0-9_-]*',
  34197. attributes: {
  34198. text: {
  34199. type: 'string',
  34200. shortcode: (attrs, _ref) => {
  34201. let {
  34202. content
  34203. } = _ref;
  34204. return (0,external_wp_autop_namespaceObject.removep)((0,external_wp_autop_namespaceObject.autop)(content));
  34205. }
  34206. }
  34207. },
  34208. priority: 20
  34209. }]
  34210. };
  34211. /* harmony default export */ var shortcode_transforms = (shortcode_transforms_transforms);
  34212. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/index.js
  34213. /**
  34214. * WordPress dependencies
  34215. */
  34216. /**
  34217. * Internal dependencies
  34218. */
  34219. const shortcode_metadata = {
  34220. $schema: "https://schemas.wp.org/trunk/block.json",
  34221. apiVersion: 2,
  34222. name: "core/shortcode",
  34223. title: "Shortcode",
  34224. category: "widgets",
  34225. description: "Insert additional custom elements with a WordPress shortcode.",
  34226. textdomain: "default",
  34227. attributes: {
  34228. text: {
  34229. type: "string",
  34230. source: "html"
  34231. }
  34232. },
  34233. supports: {
  34234. className: false,
  34235. customClassName: false,
  34236. html: false
  34237. },
  34238. editorStyle: "wp-block-shortcode-editor"
  34239. };
  34240. const {
  34241. name: shortcode_name
  34242. } = shortcode_metadata;
  34243. const shortcode_settings = {
  34244. icon: library_shortcode,
  34245. transforms: shortcode_transforms,
  34246. edit: ShortcodeEdit,
  34247. save: shortcode_save_save
  34248. };
  34249. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/site-logo.js
  34250. /**
  34251. * WordPress dependencies
  34252. */
  34253. const siteLogo = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  34254. xmlns: "http://www.w3.org/2000/svg",
  34255. viewBox: "0 0 24 24"
  34256. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  34257. d: "M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 1.5c4.1 0 7.5 3.4 7.5 7.5v.1c-1.4-.8-3.3-1.7-3.4-1.8-.2-.1-.5-.1-.8.1l-2.9 2.1L9 11.3c-.2-.1-.4 0-.6.1l-3.7 2.2c-.1-.5-.2-1-.2-1.5 0-4.2 3.4-7.6 7.5-7.6zm0 15c-3.1 0-5.7-1.9-6.9-4.5l3.7-2.2 3.5 1.2c.2.1.5 0 .7-.1l2.9-2.1c.8.4 2.5 1.2 3.5 1.9-.9 3.3-3.9 5.8-7.4 5.8z"
  34258. }));
  34259. /* harmony default export */ var site_logo = (siteLogo);
  34260. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-logo/edit.js
  34261. /**
  34262. * External dependencies
  34263. */
  34264. /**
  34265. * WordPress dependencies
  34266. */
  34267. /**
  34268. * Internal dependencies
  34269. */
  34270. /**
  34271. * Module constants
  34272. */
  34273. const site_logo_edit_ALLOWED_MEDIA_TYPES = ['image'];
  34274. const ACCEPT_MEDIA_STRING = 'image/*';
  34275. const SiteLogo = _ref => {
  34276. let {
  34277. alt,
  34278. attributes: {
  34279. align,
  34280. width,
  34281. height,
  34282. isLink,
  34283. linkTarget,
  34284. shouldSyncIcon
  34285. },
  34286. containerRef,
  34287. isSelected,
  34288. setAttributes,
  34289. setLogo,
  34290. logoUrl,
  34291. siteUrl,
  34292. logoId,
  34293. iconId,
  34294. setIcon,
  34295. canUserEdit
  34296. } = _ref;
  34297. const clientWidth = useClientWidth(containerRef, [align]);
  34298. const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
  34299. const isWideAligned = (0,external_lodash_namespaceObject.includes)(['wide', 'full'], align);
  34300. const isResizable = !isWideAligned && isLargeViewport;
  34301. const [{
  34302. naturalWidth,
  34303. naturalHeight
  34304. }, setNaturalSize] = (0,external_wp_element_namespaceObject.useState)({});
  34305. const [isEditingImage, setIsEditingImage] = (0,external_wp_element_namespaceObject.useState)(false);
  34306. const {
  34307. toggleSelection
  34308. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  34309. const classes = classnames_default()('custom-logo-link', {
  34310. 'is-transient': (0,external_wp_blob_namespaceObject.isBlobURL)(logoUrl)
  34311. });
  34312. const {
  34313. imageEditing,
  34314. maxWidth,
  34315. title
  34316. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  34317. const {
  34318. getSettings
  34319. } = select(external_wp_blockEditor_namespaceObject.store);
  34320. const siteEntities = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('root', 'site');
  34321. return {
  34322. title: siteEntities.title,
  34323. ...(0,external_lodash_namespaceObject.pick)(getSettings(), ['imageEditing', 'maxWidth'])
  34324. };
  34325. }, []);
  34326. (0,external_wp_element_namespaceObject.useEffect)(() => {
  34327. // Turn the `Use as site icon` toggle off if it is on but the logo and icon have
  34328. // fallen out of sync. This can happen if the toggle is saved in the `on` position,
  34329. // but changes are later made to the site icon in the Customizer.
  34330. if (shouldSyncIcon && logoId !== iconId) {
  34331. setAttributes({
  34332. shouldSyncIcon: false
  34333. });
  34334. }
  34335. }, []);
  34336. (0,external_wp_element_namespaceObject.useEffect)(() => {
  34337. if (!isSelected) {
  34338. setIsEditingImage(false);
  34339. }
  34340. }, [isSelected]);
  34341. function onResizeStart() {
  34342. toggleSelection(false);
  34343. }
  34344. function onResizeStop() {
  34345. toggleSelection(true);
  34346. }
  34347. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  34348. className: "custom-logo",
  34349. src: logoUrl,
  34350. alt: alt,
  34351. onLoad: event => {
  34352. setNaturalSize((0,external_lodash_namespaceObject.pick)(event.target, ['naturalWidth', 'naturalHeight']));
  34353. }
  34354. });
  34355. let imgWrapper = img; // Disable reason: Image itself is not meant to be interactive, but
  34356. // should direct focus to block.
  34357. if (isLink) {
  34358. imgWrapper =
  34359. /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
  34360. (0,external_wp_element_namespaceObject.createElement)("a", {
  34361. href: siteUrl,
  34362. className: classes,
  34363. rel: "home",
  34364. title: title,
  34365. onClick: event => event.preventDefault()
  34366. }, img)
  34367. /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
  34368. ;
  34369. }
  34370. let imageWidthWithinContainer;
  34371. if (clientWidth && naturalWidth && naturalHeight) {
  34372. const exceedMaxWidth = naturalWidth > clientWidth;
  34373. imageWidthWithinContainer = exceedMaxWidth ? clientWidth : naturalWidth;
  34374. }
  34375. if (!isResizable || !imageWidthWithinContainer) {
  34376. return (0,external_wp_element_namespaceObject.createElement)("div", {
  34377. style: {
  34378. width,
  34379. height
  34380. }
  34381. }, imgWrapper);
  34382. } // Set the default width to a responsible size.
  34383. // Note that this width is also set in the attached frontend CSS file.
  34384. const defaultWidth = 120;
  34385. const currentWidth = width || defaultWidth;
  34386. const ratio = naturalWidth / naturalHeight;
  34387. const currentHeight = currentWidth / ratio;
  34388. const minWidth = naturalWidth < naturalHeight ? MIN_SIZE : Math.ceil(MIN_SIZE * ratio);
  34389. const minHeight = naturalHeight < naturalWidth ? MIN_SIZE : Math.ceil(MIN_SIZE / ratio); // With the current implementation of ResizableBox, an image needs an
  34390. // explicit pixel value for the max-width. In absence of being able to
  34391. // set the content-width, this max-width is currently dictated by the
  34392. // vanilla editor style. The following variable adds a buffer to this
  34393. // vanilla style, so 3rd party themes have some wiggleroom. This does,
  34394. // in most cases, allow you to scale the image beyond the width of the
  34395. // main column, though not infinitely.
  34396. // @todo It would be good to revisit this once a content-width variable
  34397. // becomes available.
  34398. const maxWidthBuffer = maxWidth * 2.5;
  34399. let showRightHandle = false;
  34400. let showLeftHandle = false;
  34401. /* eslint-disable no-lonely-if */
  34402. // See https://github.com/WordPress/gutenberg/issues/7584.
  34403. if (align === 'center') {
  34404. // When the image is centered, show both handles.
  34405. showRightHandle = true;
  34406. showLeftHandle = true;
  34407. } else if ((0,external_wp_i18n_namespaceObject.isRTL)()) {
  34408. // In RTL mode the image is on the right by default.
  34409. // Show the right handle and hide the left handle only when it is
  34410. // aligned left. Otherwise always show the left handle.
  34411. if (align === 'left') {
  34412. showRightHandle = true;
  34413. } else {
  34414. showLeftHandle = true;
  34415. }
  34416. } else {
  34417. // Show the left handle and hide the right handle only when the
  34418. // image is aligned right. Otherwise always show the right handle.
  34419. if (align === 'right') {
  34420. showLeftHandle = true;
  34421. } else {
  34422. showRightHandle = true;
  34423. }
  34424. }
  34425. /* eslint-enable no-lonely-if */
  34426. const canEditImage = logoId && naturalWidth && naturalHeight && imageEditing;
  34427. const imgEdit = canEditImage && isEditingImage ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditingProvider, {
  34428. id: logoId,
  34429. url: logoUrl,
  34430. naturalWidth: naturalWidth,
  34431. naturalHeight: naturalHeight,
  34432. clientWidth: clientWidth,
  34433. onSaveImage: imageAttributes => {
  34434. setLogo(imageAttributes.id);
  34435. },
  34436. isEditing: isEditingImage,
  34437. onFinishEditing: () => setIsEditingImage(false)
  34438. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditor, {
  34439. url: logoUrl,
  34440. width: currentWidth,
  34441. height: currentHeight,
  34442. clientWidth: clientWidth,
  34443. naturalHeight: naturalHeight,
  34444. naturalWidth: naturalWidth
  34445. })) : (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
  34446. size: {
  34447. width: currentWidth,
  34448. height: currentHeight
  34449. },
  34450. showHandle: isSelected,
  34451. minWidth: minWidth,
  34452. maxWidth: maxWidthBuffer,
  34453. minHeight: minHeight,
  34454. maxHeight: maxWidthBuffer / ratio,
  34455. lockAspectRatio: true,
  34456. enable: {
  34457. top: false,
  34458. right: showRightHandle,
  34459. bottom: true,
  34460. left: showLeftHandle
  34461. },
  34462. onResizeStart: onResizeStart,
  34463. onResizeStop: (event, direction, elt, delta) => {
  34464. onResizeStop();
  34465. setAttributes({
  34466. width: parseInt(currentWidth + delta.width, 10),
  34467. height: parseInt(currentHeight + delta.height, 10)
  34468. });
  34469. }
  34470. }, imgWrapper);
  34471. const syncSiteIconHelpText = (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. To use a custom icon that is different from your site logo, use the <a>Site Icon settings</a>.'), {
  34472. a: // eslint-disable-next-line jsx-a11y/anchor-has-content
  34473. (0,external_wp_element_namespaceObject.createElement)("a", {
  34474. href: siteUrl + '/wp-admin/customize.php?autofocus[section]=title_tagline',
  34475. target: "_blank",
  34476. rel: "noopener noreferrer"
  34477. })
  34478. });
  34479. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  34480. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  34481. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  34482. label: (0,external_wp_i18n_namespaceObject.__)('Image width'),
  34483. onChange: newWidth => setAttributes({
  34484. width: newWidth
  34485. }),
  34486. min: minWidth,
  34487. max: maxWidthBuffer,
  34488. initialPosition: Math.min(defaultWidth, maxWidthBuffer),
  34489. value: width || '',
  34490. disabled: !isResizable
  34491. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  34492. label: (0,external_wp_i18n_namespaceObject.__)('Link image to home'),
  34493. onChange: () => setAttributes({
  34494. isLink: !isLink
  34495. }),
  34496. checked: isLink
  34497. }), isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  34498. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  34499. onChange: value => setAttributes({
  34500. linkTarget: value ? '_blank' : '_self'
  34501. }),
  34502. checked: linkTarget === '_blank'
  34503. })), canUserEdit && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  34504. label: (0,external_wp_i18n_namespaceObject.__)('Use as site icon'),
  34505. onChange: value => {
  34506. setAttributes({
  34507. shouldSyncIcon: value
  34508. });
  34509. setIcon(value ? logoId : undefined);
  34510. },
  34511. checked: !!shouldSyncIcon,
  34512. help: syncSiteIconHelpText
  34513. })))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  34514. group: "block"
  34515. }, canEditImage && !isEditingImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  34516. onClick: () => setIsEditingImage(true),
  34517. icon: library_crop,
  34518. label: (0,external_wp_i18n_namespaceObject.__)('Crop')
  34519. })), imgEdit);
  34520. };
  34521. function LogoEdit(_ref2) {
  34522. let {
  34523. attributes,
  34524. className,
  34525. setAttributes,
  34526. isSelected
  34527. } = _ref2;
  34528. const {
  34529. width,
  34530. shouldSyncIcon
  34531. } = attributes;
  34532. const [logoUrl, setLogoUrl] = (0,external_wp_element_namespaceObject.useState)();
  34533. const ref = (0,external_wp_element_namespaceObject.useRef)();
  34534. const {
  34535. siteLogoId,
  34536. canUserEdit,
  34537. url,
  34538. siteIconId,
  34539. mediaItemData,
  34540. isRequestingMediaItem
  34541. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  34542. const {
  34543. canUser,
  34544. getEntityRecord,
  34545. getEditedEntityRecord
  34546. } = select(external_wp_coreData_namespaceObject.store);
  34547. const siteSettings = getEditedEntityRecord('root', 'site');
  34548. const siteData = getEntityRecord('root', '__unstableBase');
  34549. const _siteLogo = siteSettings === null || siteSettings === void 0 ? void 0 : siteSettings.site_logo;
  34550. const _readOnlyLogo = siteData === null || siteData === void 0 ? void 0 : siteData.site_logo;
  34551. const _canUserEdit = canUser('update', 'settings');
  34552. const _siteLogoId = _canUserEdit ? _siteLogo : _readOnlyLogo;
  34553. const _siteIconId = siteSettings === null || siteSettings === void 0 ? void 0 : siteSettings.site_icon;
  34554. const mediaItem = _siteLogoId && select(external_wp_coreData_namespaceObject.store).getMedia(_siteLogoId, {
  34555. context: 'view'
  34556. });
  34557. const _isRequestingMediaItem = _siteLogoId && !select(external_wp_coreData_namespaceObject.store).hasFinishedResolution('getMedia', [_siteLogoId, {
  34558. context: 'view'
  34559. }]);
  34560. return {
  34561. siteLogoId: _siteLogoId,
  34562. canUserEdit: _canUserEdit,
  34563. url: siteData === null || siteData === void 0 ? void 0 : siteData.url,
  34564. mediaItemData: mediaItem,
  34565. isRequestingMediaItem: _isRequestingMediaItem,
  34566. siteIconId: _siteIconId
  34567. };
  34568. }, []);
  34569. const {
  34570. editEntityRecord
  34571. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  34572. const setLogo = function (newValue) {
  34573. let shouldForceSync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  34574. // `shouldForceSync` is used to force syncing when the attribute
  34575. // may not have updated yet.
  34576. if (shouldSyncIcon || shouldForceSync) {
  34577. setIcon(newValue);
  34578. }
  34579. editEntityRecord('root', 'site', undefined, {
  34580. site_logo: newValue
  34581. });
  34582. };
  34583. const setIcon = newValue => // The new value needs to be `null` to reset the Site Icon.
  34584. editEntityRecord('root', 'site', undefined, {
  34585. site_icon: newValue !== null && newValue !== void 0 ? newValue : null
  34586. });
  34587. let alt = null;
  34588. if (mediaItemData) {
  34589. alt = mediaItemData.alt_text;
  34590. if (logoUrl !== mediaItemData.source_url) {
  34591. setLogoUrl(mediaItemData.source_url);
  34592. }
  34593. }
  34594. const onInitialSelectLogo = media => {
  34595. // Initialize the syncSiteIcon toggle. If we currently have no Site logo and no
  34596. // site icon, automatically sync the logo to the icon.
  34597. if (shouldSyncIcon === undefined) {
  34598. const shouldForceSync = !siteIconId;
  34599. setAttributes({
  34600. shouldSyncIcon: shouldForceSync
  34601. }); // Because we cannot rely on the `shouldSyncIcon` attribute to have updated by
  34602. // the time `setLogo` is called, pass an argument to force the syncing.
  34603. onSelectLogo(media, shouldForceSync);
  34604. return;
  34605. }
  34606. onSelectLogo(media);
  34607. };
  34608. const onSelectLogo = function (media) {
  34609. let shouldForceSync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  34610. if (!media) {
  34611. return;
  34612. }
  34613. if (!media.id && media.url) {
  34614. // This is a temporary blob image.
  34615. setLogo(undefined);
  34616. setLogoUrl(media.url);
  34617. return;
  34618. }
  34619. setLogo(media.id, shouldForceSync);
  34620. };
  34621. const onRemoveLogo = () => {
  34622. setLogo(null);
  34623. setLogoUrl(undefined);
  34624. setAttributes({
  34625. width: undefined
  34626. });
  34627. };
  34628. const {
  34629. createErrorNotice
  34630. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  34631. const onUploadError = message => {
  34632. createErrorNotice(message[2], {
  34633. type: 'snackbar'
  34634. });
  34635. };
  34636. const controls = canUserEdit && logoUrl && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  34637. group: "other"
  34638. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  34639. mediaURL: logoUrl,
  34640. allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES,
  34641. accept: ACCEPT_MEDIA_STRING,
  34642. onSelect: onSelectLogo,
  34643. onError: onUploadError
  34644. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  34645. onClick: onRemoveLogo
  34646. }, (0,external_wp_i18n_namespaceObject.__)('Reset'))));
  34647. let logoImage;
  34648. const isLoading = siteLogoId === undefined || isRequestingMediaItem;
  34649. if (isLoading) {
  34650. logoImage = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null);
  34651. }
  34652. if (!!logoUrl) {
  34653. logoImage = (0,external_wp_element_namespaceObject.createElement)(SiteLogo, {
  34654. alt: alt,
  34655. attributes: attributes,
  34656. className: className,
  34657. containerRef: ref,
  34658. isSelected: isSelected,
  34659. setAttributes: setAttributes,
  34660. logoUrl: logoUrl,
  34661. setLogo: setLogo,
  34662. logoId: (mediaItemData === null || mediaItemData === void 0 ? void 0 : mediaItemData.id) || siteLogoId,
  34663. siteUrl: url,
  34664. setIcon: setIcon,
  34665. iconId: siteIconId,
  34666. canUserEdit: canUserEdit
  34667. });
  34668. }
  34669. const placeholder = content => {
  34670. const placeholderClassName = classnames_default()('block-editor-media-placeholder', className);
  34671. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  34672. className: placeholderClassName,
  34673. preview: logoImage
  34674. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  34675. className: "components-placeholder__illustration",
  34676. fill: "none",
  34677. xmlns: "http://www.w3.org/2000/svg",
  34678. viewBox: "0 0 60 60"
  34679. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  34680. vectorEffect: "non-scaling-stroke",
  34681. d: "m61 32.622-13.555-9.137-15.888 9.859a5 5 0 0 1-5.386-.073l-9.095-5.989L1 37.5"
  34682. })), content);
  34683. };
  34684. const classes = classnames_default()(className, {
  34685. 'is-default-size': !width
  34686. });
  34687. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  34688. ref,
  34689. className: classes
  34690. });
  34691. const label = (0,external_wp_i18n_namespaceObject.__)('Add a site logo');
  34692. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, controls, !!logoUrl && logoImage, !logoUrl && !canUserEdit && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  34693. className: "site-logo_placeholder"
  34694. }, isLoading && (0,external_wp_element_namespaceObject.createElement)("span", {
  34695. className: "components-placeholder__preview"
  34696. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null))), !logoUrl && canUserEdit && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  34697. onSelect: onInitialSelectLogo,
  34698. accept: ACCEPT_MEDIA_STRING,
  34699. allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES,
  34700. onError: onUploadError,
  34701. placeholder: placeholder,
  34702. mediaLibraryButton: _ref3 => {
  34703. let {
  34704. open
  34705. } = _ref3;
  34706. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  34707. icon: library_upload,
  34708. variant: "primary",
  34709. label: label,
  34710. showTooltip: true,
  34711. tooltipPosition: "top center",
  34712. onClick: () => {
  34713. open();
  34714. }
  34715. });
  34716. }
  34717. }));
  34718. }
  34719. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-logo/transforms.js
  34720. /**
  34721. * WordPress dependencies
  34722. */
  34723. const site_logo_transforms_transforms = {
  34724. to: [{
  34725. type: 'block',
  34726. blocks: ['core/site-title'],
  34727. transform: _ref => {
  34728. let {
  34729. isLink,
  34730. linkTarget
  34731. } = _ref;
  34732. return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-title', {
  34733. isLink,
  34734. linkTarget
  34735. });
  34736. }
  34737. }]
  34738. };
  34739. /* harmony default export */ var site_logo_transforms = (site_logo_transforms_transforms);
  34740. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-logo/index.js
  34741. /**
  34742. * WordPress dependencies
  34743. */
  34744. /**
  34745. * Internal dependencies
  34746. */
  34747. const site_logo_metadata = {
  34748. $schema: "https://schemas.wp.org/trunk/block.json",
  34749. apiVersion: 2,
  34750. name: "core/site-logo",
  34751. title: "Site Logo",
  34752. category: "theme",
  34753. description: "Display a graphic to represent this site. Update the block, and the changes apply everywhere it\u2019s used. This is different than the site icon, which is the smaller image visible in your dashboard, browser tabs, etc used to help others recognize this site.",
  34754. textdomain: "default",
  34755. attributes: {
  34756. width: {
  34757. type: "number"
  34758. },
  34759. isLink: {
  34760. type: "boolean",
  34761. "default": true
  34762. },
  34763. linkTarget: {
  34764. type: "string",
  34765. "default": "_self"
  34766. },
  34767. shouldSyncIcon: {
  34768. type: "boolean"
  34769. }
  34770. },
  34771. example: {
  34772. viewportWidth: 500,
  34773. attributes: {
  34774. width: 350,
  34775. className: "block-editor-block-types-list__site-logo-example"
  34776. }
  34777. },
  34778. supports: {
  34779. html: false,
  34780. align: true,
  34781. alignWide: false,
  34782. color: {
  34783. __experimentalDuotone: "img, .components-placeholder__illustration, .components-placeholder::before",
  34784. text: false,
  34785. background: false
  34786. }
  34787. },
  34788. styles: [{
  34789. name: "default",
  34790. label: "Default",
  34791. isDefault: true
  34792. }, {
  34793. name: "rounded",
  34794. label: "Rounded"
  34795. }],
  34796. editorStyle: "wp-block-site-logo-editor",
  34797. style: "wp-block-site-logo"
  34798. };
  34799. const {
  34800. name: site_logo_name
  34801. } = site_logo_metadata;
  34802. const site_logo_settings = {
  34803. icon: site_logo,
  34804. edit: LogoEdit,
  34805. transforms: site_logo_transforms
  34806. };
  34807. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/edit.js
  34808. /**
  34809. * External dependencies
  34810. */
  34811. /**
  34812. * WordPress dependencies
  34813. */
  34814. function SiteTaglineEdit(_ref) {
  34815. let {
  34816. attributes,
  34817. setAttributes,
  34818. insertBlocksAfter
  34819. } = _ref;
  34820. const {
  34821. textAlign
  34822. } = attributes;
  34823. const [siteTagline, setSiteTagline] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'description');
  34824. const {
  34825. canUserEdit,
  34826. readOnlySiteTagLine
  34827. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  34828. const {
  34829. canUser,
  34830. getEntityRecord
  34831. } = select(external_wp_coreData_namespaceObject.store);
  34832. const siteData = getEntityRecord('root', '__unstableBase');
  34833. return {
  34834. canUserEdit: canUser('update', 'settings'),
  34835. readOnlySiteTagLine: siteData === null || siteData === void 0 ? void 0 : siteData.description
  34836. };
  34837. }, []);
  34838. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  34839. className: classnames_default()({
  34840. [`has-text-align-${textAlign}`]: textAlign,
  34841. 'wp-block-site-tagline__placeholder': !canUserEdit && !readOnlySiteTagLine
  34842. })
  34843. });
  34844. const siteTaglineContent = canUserEdit ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  34845. allowedFormats: [],
  34846. onChange: setSiteTagline,
  34847. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Site tagline text'),
  34848. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write site tagline…'),
  34849. tagName: "p",
  34850. value: siteTagline,
  34851. disableLineBreaks: true,
  34852. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
  34853. }, blockProps)) : (0,external_wp_element_namespaceObject.createElement)("p", blockProps, readOnlySiteTagLine || (0,external_wp_i18n_namespaceObject.__)('Site Tagline placeholder'));
  34854. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  34855. group: "block"
  34856. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  34857. onChange: newAlign => setAttributes({
  34858. textAlign: newAlign
  34859. }),
  34860. value: textAlign
  34861. })), siteTaglineContent);
  34862. }
  34863. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/icon.js
  34864. /**
  34865. * WordPress dependencies
  34866. */
  34867. /* harmony default export */ var site_tagline_icon = ((0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  34868. xmlns: "http://www.w3.org/2000/svg",
  34869. width: "24",
  34870. height: "24"
  34871. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  34872. fill: "none",
  34873. d: "M0 0h24v24H0z"
  34874. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  34875. d: "M4 9h16v2H4V9zm0 4h10v2H4v-2z"
  34876. })));
  34877. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/deprecated.js
  34878. /**
  34879. * Internal dependencies
  34880. */
  34881. const site_tagline_deprecated_v1 = {
  34882. attributes: {
  34883. textAlign: {
  34884. type: 'string'
  34885. }
  34886. },
  34887. supports: {
  34888. align: ['wide', 'full'],
  34889. html: false,
  34890. color: {
  34891. gradients: true
  34892. },
  34893. spacing: {
  34894. margin: true,
  34895. padding: true
  34896. },
  34897. typography: {
  34898. fontSize: true,
  34899. lineHeight: true,
  34900. __experimentalFontFamily: true,
  34901. __experimentalTextTransform: true,
  34902. __experimentalFontStyle: true,
  34903. __experimentalFontWeight: true,
  34904. __experimentalLetterSpacing: true
  34905. }
  34906. },
  34907. save() {
  34908. return null;
  34909. },
  34910. migrate: migrate_font_family,
  34911. isEligible(_ref) {
  34912. var _style$typography;
  34913. let {
  34914. style
  34915. } = _ref;
  34916. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  34917. }
  34918. };
  34919. /**
  34920. * New deprecations need to be placed first
  34921. * for them to have higher priority.
  34922. *
  34923. * Old deprecations may need to be updated as well.
  34924. *
  34925. * See block-deprecation.md
  34926. */
  34927. /* harmony default export */ var site_tagline_deprecated = ([site_tagline_deprecated_v1]);
  34928. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js
  34929. /**
  34930. * Internal dependencies
  34931. */
  34932. const site_tagline_metadata = {
  34933. $schema: "https://schemas.wp.org/trunk/block.json",
  34934. apiVersion: 2,
  34935. name: "core/site-tagline",
  34936. title: "Site Tagline",
  34937. category: "theme",
  34938. description: "Describe in a few words what the site is about. The tagline can be used in search results or when sharing on social networks even if it's not displayed in the theme design.",
  34939. keywords: ["description"],
  34940. textdomain: "default",
  34941. attributes: {
  34942. textAlign: {
  34943. type: "string"
  34944. }
  34945. },
  34946. supports: {
  34947. align: ["wide", "full"],
  34948. html: false,
  34949. color: {
  34950. gradients: true,
  34951. __experimentalDefaultControls: {
  34952. background: true,
  34953. text: true
  34954. }
  34955. },
  34956. spacing: {
  34957. margin: true,
  34958. padding: true
  34959. },
  34960. typography: {
  34961. fontSize: true,
  34962. lineHeight: true,
  34963. __experimentalFontFamily: true,
  34964. __experimentalTextTransform: true,
  34965. __experimentalFontStyle: true,
  34966. __experimentalFontWeight: true,
  34967. __experimentalLetterSpacing: true,
  34968. __experimentalDefaultControls: {
  34969. fontSize: true
  34970. }
  34971. }
  34972. },
  34973. editorStyle: "wp-block-site-tagline-editor"
  34974. };
  34975. const {
  34976. name: site_tagline_name
  34977. } = site_tagline_metadata;
  34978. const site_tagline_settings = {
  34979. icon: site_tagline_icon,
  34980. edit: SiteTaglineEdit,
  34981. deprecated: site_tagline_deprecated
  34982. };
  34983. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/map-marker.js
  34984. /**
  34985. * WordPress dependencies
  34986. */
  34987. const mapMarker = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  34988. xmlns: "https://www.w3.org/2000/svg",
  34989. viewBox: "0 0 24 24"
  34990. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  34991. d: "M12 9c-.8 0-1.5.7-1.5 1.5S11.2 12 12 12s1.5-.7 1.5-1.5S12.8 9 12 9zm0-5c-3.6 0-6.5 2.8-6.5 6.2 0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C18.5 6.8 15.6 4 12 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4z"
  34992. }));
  34993. /* harmony default export */ var map_marker = (mapMarker);
  34994. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/edit/level-icon.js
  34995. /**
  34996. * WordPress dependencies
  34997. */
  34998. function LevelIcon(_ref) {
  34999. let {
  35000. level,
  35001. isPressed = false
  35002. } = _ref;
  35003. if (level === 0) return library_paragraph;
  35004. const levelToPath = {
  35005. 1: 'M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z',
  35006. 2: 'M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z',
  35007. 3: 'M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z',
  35008. 4: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z',
  35009. 5: 'M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z',
  35010. 6: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z'
  35011. };
  35012. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  35013. width: "20",
  35014. height: "20",
  35015. viewBox: "0 0 20 20",
  35016. xmlns: "http://www.w3.org/2000/svg",
  35017. isPressed: isPressed
  35018. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  35019. d: levelToPath[level]
  35020. }));
  35021. }
  35022. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/edit/level-toolbar.js
  35023. /**
  35024. * WordPress dependencies
  35025. */
  35026. /**
  35027. * Internal dependencies
  35028. */
  35029. function LevelControl(_ref) {
  35030. let {
  35031. level,
  35032. onChange
  35033. } = _ref;
  35034. const allControls = [1, 2, 3, 4, 5, 6, 0].map(currentLevel => {
  35035. const isActive = currentLevel === level;
  35036. return {
  35037. icon: (0,external_wp_element_namespaceObject.createElement)(LevelIcon, {
  35038. level: currentLevel,
  35039. isPressed: isActive
  35040. }),
  35041. title: currentLevel === 0 ? (0,external_wp_i18n_namespaceObject.__)('Paragraph') : // translators: %s: heading level e.g: "1", "2", "3"
  35042. (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Heading %d'), currentLevel),
  35043. isActive,
  35044. onClick: () => onChange(currentLevel)
  35045. };
  35046. });
  35047. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
  35048. label: (0,external_wp_i18n_namespaceObject.__)('Change heading level'),
  35049. icon: (0,external_wp_element_namespaceObject.createElement)(LevelIcon, {
  35050. level: level
  35051. }),
  35052. controls: allControls
  35053. });
  35054. }
  35055. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/edit/index.js
  35056. /**
  35057. * External dependencies
  35058. */
  35059. /**
  35060. * WordPress dependencies
  35061. */
  35062. /**
  35063. * Internal dependencies
  35064. */
  35065. function SiteTitleEdit(_ref) {
  35066. let {
  35067. attributes,
  35068. setAttributes,
  35069. insertBlocksAfter
  35070. } = _ref;
  35071. const {
  35072. level,
  35073. textAlign,
  35074. isLink,
  35075. linkTarget
  35076. } = attributes;
  35077. const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'title');
  35078. const {
  35079. canUserEdit,
  35080. readOnlyTitle
  35081. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  35082. const {
  35083. canUser,
  35084. getEntityRecord
  35085. } = select(external_wp_coreData_namespaceObject.store);
  35086. const siteData = getEntityRecord('root', '__unstableBase');
  35087. return {
  35088. canUserEdit: canUser('update', 'settings'),
  35089. readOnlyTitle: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(siteData === null || siteData === void 0 ? void 0 : siteData.name)
  35090. };
  35091. }, []);
  35092. const TagName = level === 0 ? 'p' : `h${level}`;
  35093. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  35094. className: classnames_default()({
  35095. [`has-text-align-${textAlign}`]: textAlign,
  35096. 'wp-block-site-title__placeholder': !canUserEdit && !readOnlyTitle
  35097. })
  35098. });
  35099. const siteTitleContent = canUserEdit ? (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  35100. tagName: isLink ? 'a' : 'span',
  35101. href: isLink ? '#site-title-pseudo-link' : undefined,
  35102. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Site title text'),
  35103. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write site title…'),
  35104. value: title,
  35105. onChange: setTitle,
  35106. allowedFormats: [],
  35107. disableLineBreaks: true,
  35108. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
  35109. })) : (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, isLink ? (0,external_wp_element_namespaceObject.createElement)("a", {
  35110. href: "#site-title-pseudo-link",
  35111. onClick: event => event.preventDefault()
  35112. }, readOnlyTitle || (0,external_wp_i18n_namespaceObject.__)('Site Title placeholder')) : (0,external_wp_element_namespaceObject.createElement)("span", null, title || readOnlyTitle));
  35113. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  35114. group: "block"
  35115. }, (0,external_wp_element_namespaceObject.createElement)(LevelControl, {
  35116. level: level,
  35117. onChange: newLevel => setAttributes({
  35118. level: newLevel
  35119. })
  35120. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  35121. value: textAlign,
  35122. onChange: nextAlign => {
  35123. setAttributes({
  35124. textAlign: nextAlign
  35125. });
  35126. }
  35127. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  35128. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  35129. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  35130. label: (0,external_wp_i18n_namespaceObject.__)('Make title link to home'),
  35131. onChange: () => setAttributes({
  35132. isLink: !isLink
  35133. }),
  35134. checked: isLink
  35135. }), isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  35136. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  35137. onChange: value => setAttributes({
  35138. linkTarget: value ? '_blank' : '_self'
  35139. }),
  35140. checked: linkTarget === '_blank'
  35141. }))), siteTitleContent);
  35142. }
  35143. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/deprecated.js
  35144. /**
  35145. * Internal dependencies
  35146. */
  35147. const site_title_deprecated_v1 = {
  35148. attributes: {
  35149. level: {
  35150. type: 'number',
  35151. default: 1
  35152. },
  35153. textAlign: {
  35154. type: 'string'
  35155. },
  35156. isLink: {
  35157. type: 'boolean',
  35158. default: true
  35159. },
  35160. linkTarget: {
  35161. type: 'string',
  35162. default: '_self'
  35163. }
  35164. },
  35165. supports: {
  35166. align: ['wide', 'full'],
  35167. html: false,
  35168. color: {
  35169. gradients: true,
  35170. link: true
  35171. },
  35172. spacing: {
  35173. padding: true,
  35174. margin: true
  35175. },
  35176. typography: {
  35177. fontSize: true,
  35178. lineHeight: true,
  35179. __experimentalFontFamily: true,
  35180. __experimentalTextTransform: true,
  35181. __experimentalFontStyle: true,
  35182. __experimentalFontWeight: true,
  35183. __experimentalLetterSpacing: true
  35184. }
  35185. },
  35186. save() {
  35187. return null;
  35188. },
  35189. migrate: migrate_font_family,
  35190. isEligible(_ref) {
  35191. var _style$typography;
  35192. let {
  35193. style
  35194. } = _ref;
  35195. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  35196. }
  35197. };
  35198. /**
  35199. * New deprecations need to be placed first
  35200. * for them to have higher priority.
  35201. *
  35202. * Old deprecations may need to be updated as well.
  35203. *
  35204. * See block-deprecation.md
  35205. */
  35206. /* harmony default export */ var site_title_deprecated = ([site_title_deprecated_v1]);
  35207. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/transforms.js
  35208. /**
  35209. * WordPress dependencies
  35210. */
  35211. const site_title_transforms_transforms = {
  35212. to: [{
  35213. type: 'block',
  35214. blocks: ['core/site-logo'],
  35215. transform: _ref => {
  35216. let {
  35217. isLink,
  35218. linkTarget
  35219. } = _ref;
  35220. return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo', {
  35221. isLink,
  35222. linkTarget
  35223. });
  35224. }
  35225. }]
  35226. };
  35227. /* harmony default export */ var site_title_transforms = (site_title_transforms_transforms);
  35228. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/index.js
  35229. /**
  35230. * WordPress dependencies
  35231. */
  35232. /**
  35233. * Internal dependencies
  35234. */
  35235. const site_title_metadata = {
  35236. $schema: "https://schemas.wp.org/trunk/block.json",
  35237. apiVersion: 2,
  35238. name: "core/site-title",
  35239. title: "Site Title",
  35240. category: "theme",
  35241. description: "Displays the name of this site. Update the block, and the changes apply everywhere it\u2019s used. This will also appear in the browser title bar and in search results.",
  35242. textdomain: "default",
  35243. attributes: {
  35244. level: {
  35245. type: "number",
  35246. "default": 1
  35247. },
  35248. textAlign: {
  35249. type: "string"
  35250. },
  35251. isLink: {
  35252. type: "boolean",
  35253. "default": true
  35254. },
  35255. linkTarget: {
  35256. type: "string",
  35257. "default": "_self"
  35258. }
  35259. },
  35260. example: {
  35261. viewportWidth: 500
  35262. },
  35263. supports: {
  35264. align: ["wide", "full"],
  35265. html: false,
  35266. color: {
  35267. gradients: true,
  35268. link: true,
  35269. __experimentalDefaultControls: {
  35270. background: true,
  35271. text: true,
  35272. link: true
  35273. }
  35274. },
  35275. spacing: {
  35276. padding: true,
  35277. margin: true
  35278. },
  35279. typography: {
  35280. fontSize: true,
  35281. lineHeight: true,
  35282. __experimentalFontFamily: true,
  35283. __experimentalTextTransform: true,
  35284. __experimentalFontStyle: true,
  35285. __experimentalFontWeight: true,
  35286. __experimentalLetterSpacing: true,
  35287. __experimentalDefaultControls: {
  35288. fontSize: true,
  35289. lineHeight: true,
  35290. fontAppearance: true,
  35291. letterSpacing: true,
  35292. textTransform: true
  35293. }
  35294. }
  35295. },
  35296. editorStyle: "wp-block-site-title-editor"
  35297. };
  35298. const {
  35299. name: site_title_name
  35300. } = site_title_metadata;
  35301. const site_title_settings = {
  35302. icon: map_marker,
  35303. edit: SiteTitleEdit,
  35304. transforms: site_title_transforms,
  35305. deprecated: site_title_deprecated
  35306. };
  35307. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/share.js
  35308. /**
  35309. * WordPress dependencies
  35310. */
  35311. const share = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35312. viewBox: "0 0 24 24",
  35313. xmlns: "http://www.w3.org/2000/svg"
  35314. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35315. d: "M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"
  35316. }));
  35317. /* harmony default export */ var library_share = (share);
  35318. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/keyboard-return.js
  35319. /**
  35320. * WordPress dependencies
  35321. */
  35322. const keyboardReturn = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35323. xmlns: "http://www.w3.org/2000/svg",
  35324. viewBox: "-2 -2 24 24"
  35325. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35326. d: "M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"
  35327. }));
  35328. /* harmony default export */ var keyboard_return = (keyboardReturn);
  35329. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/wordpress.js
  35330. /**
  35331. * WordPress dependencies
  35332. */
  35333. const WordPressIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35334. width: "24",
  35335. height: "24",
  35336. viewBox: "0 0 24 24",
  35337. version: "1.1",
  35338. xmlns: "http://www.w3.org/2000/svg"
  35339. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35340. d: "M12.158,12.786L9.46,20.625c0.806,0.237,1.657,0.366,2.54,0.366c1.047,0,2.051-0.181,2.986-0.51 c-0.024-0.038-0.046-0.079-0.065-0.124L12.158,12.786z M3.009,12c0,3.559,2.068,6.634,5.067,8.092L3.788,8.341 C3.289,9.459,3.009,10.696,3.009,12z M18.069,11.546c0-1.112-0.399-1.881-0.741-2.48c-0.456-0.741-0.883-1.368-0.883-2.109 c0-0.826,0.627-1.596,1.51-1.596c0.04,0,0.078,0.005,0.116,0.007C16.472,3.904,14.34,3.009,12,3.009 c-3.141,0-5.904,1.612-7.512,4.052c0.211,0.007,0.41,0.011,0.579,0.011c0.94,0,2.396-0.114,2.396-0.114 C7.947,6.93,8.004,7.642,7.52,7.699c0,0-0.487,0.057-1.029,0.085l3.274,9.739l1.968-5.901l-1.401-3.838 C9.848,7.756,9.389,7.699,9.389,7.699C8.904,7.67,8.961,6.93,9.446,6.958c0,0,1.484,0.114,2.368,0.114 c0.94,0,2.397-0.114,2.397-0.114c0.485-0.028,0.542,0.684,0.057,0.741c0,0-0.488,0.057-1.029,0.085l3.249,9.665l0.897-2.996 C17.841,13.284,18.069,12.316,18.069,11.546z M19.889,7.686c0.039,0.286,0.06,0.593,0.06,0.924c0,0.912-0.171,1.938-0.684,3.22 l-2.746,7.94c2.673-1.558,4.47-4.454,4.47-7.771C20.991,10.436,20.591,8.967,19.889,7.686z M12,22C6.486,22,2,17.514,2,12 C2,6.486,6.486,2,12,2c5.514,0,10,4.486,10,10C22,17.514,17.514,22,12,22z"
  35341. }));
  35342. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/fivehundredpx.js
  35343. /**
  35344. * WordPress dependencies
  35345. */
  35346. const FivehundredpxIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35347. width: "24",
  35348. height: "24",
  35349. viewBox: "0 0 24 24",
  35350. version: "1.1"
  35351. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35352. d: "M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z"
  35353. }));
  35354. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/amazon.js
  35355. /**
  35356. * WordPress dependencies
  35357. */
  35358. const AmazonIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35359. width: "24",
  35360. height: "24",
  35361. viewBox: "0 0 24 24",
  35362. version: "1.1"
  35363. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35364. d: "M13.582,8.182C11.934,8.367,9.78,8.49,8.238,9.166c-1.781,0.769-3.03,2.337-3.03,4.644 c0,2.953,1.86,4.429,4.253,4.429c2.02,0,3.125-0.477,4.685-2.065c0.516,0.747,0.685,1.109,1.629,1.894 c0.212,0.114,0.483,0.103,0.672-0.066l0.006,0.006c0.567-0.505,1.599-1.401,2.18-1.888c0.231-0.188,0.19-0.496,0.009-0.754 c-0.52-0.718-1.072-1.303-1.072-2.634V8.305c0-1.876,0.133-3.599-1.249-4.891C15.23,2.369,13.422,2,12.04,2 C9.336,2,6.318,3.01,5.686,6.351C5.618,6.706,5.877,6.893,6.109,6.945l2.754,0.298C9.121,7.23,9.308,6.977,9.357,6.72 c0.236-1.151,1.2-1.706,2.284-1.706c0.584,0,1.249,0.215,1.595,0.738c0.398,0.584,0.346,1.384,0.346,2.061V8.182z M13.049,14.088 c-0.451,0.8-1.169,1.291-1.967,1.291c-1.09,0-1.728-0.83-1.728-2.061c0-2.42,2.171-2.86,4.227-2.86v0.615 C13.582,12.181,13.608,13.104,13.049,14.088z M20.683,19.339C18.329,21.076,14.917,22,11.979,22c-4.118,0-7.826-1.522-10.632-4.057 c-0.22-0.199-0.024-0.471,0.241-0.317c3.027,1.762,6.771,2.823,10.639,2.823c2.608,0,5.476-0.541,8.115-1.66 C20.739,18.62,21.072,19.051,20.683,19.339z M21.336,21.043c-0.194,0.163-0.379,0.076-0.293-0.139 c0.284-0.71,0.92-2.298,0.619-2.684c-0.301-0.386-1.99-0.183-2.749-0.092c-0.23,0.027-0.266-0.173-0.059-0.319 c1.348-0.946,3.555-0.673,3.811-0.356C22.925,17.773,22.599,19.986,21.336,21.043z"
  35365. }));
  35366. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/bandcamp.js
  35367. /**
  35368. * WordPress dependencies
  35369. */
  35370. const BandcampIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35371. width: "24",
  35372. height: "24",
  35373. viewBox: "0 0 24 24",
  35374. version: "1.1"
  35375. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35376. d: "M15.27 17.289 3 17.289 8.73 6.711 21 6.711 15.27 17.289"
  35377. }));
  35378. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/behance.js
  35379. /**
  35380. * WordPress dependencies
  35381. */
  35382. const BehanceIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35383. width: "24",
  35384. height: "24",
  35385. viewBox: "0 0 24 24",
  35386. version: "1.1"
  35387. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35388. d: "M7.799,5.698c0.589,0,1.12,0.051,1.606,0.156c0.482,0.102,0.894,0.273,1.241,0.507c0.344,0.235,0.612,0.546,0.804,0.938 c0.188,0.387,0.281,0.871,0.281,1.443c0,0.619-0.141,1.137-0.421,1.551c-0.284,0.413-0.7,0.751-1.255,1.014 c0.756,0.218,1.317,0.601,1.689,1.146c0.374,0.549,0.557,1.205,0.557,1.975c0,0.623-0.12,1.161-0.359,1.612 c-0.241,0.457-0.569,0.828-0.973,1.114c-0.408,0.288-0.876,0.5-1.399,0.637C9.052,17.931,8.514,18,7.963,18H2V5.698H7.799 M7.449,10.668c0.481,0,0.878-0.114,1.192-0.345c0.311-0.228,0.463-0.603,0.463-1.119c0-0.286-0.051-0.523-0.152-0.707 C8.848,8.315,8.711,8.171,8.536,8.07C8.362,7.966,8.166,7.894,7.94,7.854c-0.224-0.044-0.457-0.06-0.697-0.06H4.709v2.874H7.449z M7.6,15.905c0.267,0,0.521-0.024,0.759-0.077c0.243-0.053,0.457-0.137,0.637-0.261c0.182-0.12,0.332-0.283,0.441-0.491 C9.547,14.87,9.6,14.602,9.6,14.278c0-0.633-0.18-1.084-0.533-1.357c-0.356-0.27-0.83-0.404-1.413-0.404H4.709v3.388L7.6,15.905z M16.162,15.864c0.367,0.358,0.897,0.538,1.583,0.538c0.493,0,0.92-0.125,1.277-0.374c0.354-0.248,0.571-0.514,0.654-0.79h2.155 c-0.347,1.072-0.872,1.838-1.589,2.299C19.534,18,18.67,18.23,17.662,18.23c-0.701,0-1.332-0.113-1.899-0.337 c-0.567-0.227-1.041-0.544-1.439-0.958c-0.389-0.415-0.689-0.907-0.904-1.484c-0.213-0.574-0.32-1.21-0.32-1.899 c0-0.666,0.11-1.288,0.329-1.863c0.222-0.577,0.529-1.075,0.933-1.492c0.406-0.42,0.885-0.751,1.444-0.994 c0.558-0.241,1.175-0.363,1.857-0.363c0.754,0,1.414,0.145,1.98,0.44c0.563,0.291,1.026,0.686,1.389,1.181 c0.363,0.493,0.622,1.057,0.783,1.69c0.16,0.632,0.217,1.292,0.171,1.983h-6.428C15.557,14.84,15.795,15.506,16.162,15.864 M18.973,11.184c-0.291-0.321-0.783-0.496-1.384-0.496c-0.39,0-0.714,0.066-0.973,0.2c-0.254,0.132-0.461,0.297-0.621,0.491 c-0.157,0.197-0.265,0.405-0.328,0.628c-0.063,0.217-0.101,0.413-0.111,0.587h3.98C19.478,11.969,19.265,11.509,18.973,11.184z M15.057,7.738h4.985V6.524h-4.985L15.057,7.738z"
  35389. }));
  35390. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/chain.js
  35391. /**
  35392. * WordPress dependencies
  35393. */
  35394. const ChainIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35395. width: "24",
  35396. height: "24",
  35397. viewBox: "0 0 24 24",
  35398. version: "1.1"
  35399. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35400. d: "M19.647,16.706a1.134,1.134,0,0,0-.343-.833l-2.549-2.549a1.134,1.134,0,0,0-.833-.343,1.168,1.168,0,0,0-.883.392l.233.226q.2.189.264.264a2.922,2.922,0,0,1,.184.233.986.986,0,0,1,.159.312,1.242,1.242,0,0,1,.043.337,1.172,1.172,0,0,1-1.176,1.176,1.237,1.237,0,0,1-.337-.043,1,1,0,0,1-.312-.159,2.76,2.76,0,0,1-.233-.184q-.073-.068-.264-.264l-.226-.233a1.19,1.19,0,0,0-.4.895,1.134,1.134,0,0,0,.343.833L15.837,19.3a1.13,1.13,0,0,0,.833.331,1.18,1.18,0,0,0,.833-.318l1.8-1.789a1.12,1.12,0,0,0,.343-.821Zm-8.615-8.64a1.134,1.134,0,0,0-.343-.833L8.163,4.7a1.134,1.134,0,0,0-.833-.343,1.184,1.184,0,0,0-.833.331L4.7,6.473a1.12,1.12,0,0,0-.343.821,1.134,1.134,0,0,0,.343.833l2.549,2.549a1.13,1.13,0,0,0,.833.331,1.184,1.184,0,0,0,.883-.38L8.728,10.4q-.2-.189-.264-.264A2.922,2.922,0,0,1,8.28,9.9a.986.986,0,0,1-.159-.312,1.242,1.242,0,0,1-.043-.337A1.172,1.172,0,0,1,9.254,8.079a1.237,1.237,0,0,1,.337.043,1,1,0,0,1,.312.159,2.761,2.761,0,0,1,.233.184q.073.068.264.264l.226.233a1.19,1.19,0,0,0,.4-.895ZM22,16.706a3.343,3.343,0,0,1-1.042,2.488l-1.8,1.789a3.536,3.536,0,0,1-4.988-.025l-2.525-2.537a3.384,3.384,0,0,1-1.017-2.488,3.448,3.448,0,0,1,1.078-2.561l-1.078-1.078a3.434,3.434,0,0,1-2.549,1.078,3.4,3.4,0,0,1-2.5-1.029L3.029,9.794A3.4,3.4,0,0,1,2,7.294,3.343,3.343,0,0,1,3.042,4.806l1.8-1.789A3.384,3.384,0,0,1,7.331,2a3.357,3.357,0,0,1,2.5,1.042l2.525,2.537a3.384,3.384,0,0,1,1.017,2.488,3.448,3.448,0,0,1-1.078,2.561l1.078,1.078a3.551,3.551,0,0,1,5.049-.049l2.549,2.549A3.4,3.4,0,0,1,22,16.706Z"
  35401. }));
  35402. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/codepen.js
  35403. /**
  35404. * WordPress dependencies
  35405. */
  35406. const CodepenIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35407. width: "24",
  35408. height: "24",
  35409. viewBox: "0 0 24 24",
  35410. version: "1.1"
  35411. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35412. d: "M22.016,8.84c-0.002-0.013-0.005-0.025-0.007-0.037c-0.005-0.025-0.008-0.048-0.015-0.072 c-0.003-0.015-0.01-0.028-0.013-0.042c-0.008-0.02-0.015-0.04-0.023-0.062c-0.007-0.015-0.013-0.028-0.02-0.042 c-0.008-0.02-0.018-0.037-0.03-0.057c-0.007-0.013-0.017-0.027-0.025-0.038c-0.012-0.018-0.023-0.035-0.035-0.052 c-0.01-0.013-0.02-0.025-0.03-0.037c-0.015-0.017-0.028-0.032-0.043-0.045c-0.01-0.012-0.022-0.023-0.035-0.035 c-0.015-0.015-0.032-0.028-0.048-0.04c-0.012-0.01-0.025-0.02-0.037-0.03c-0.005-0.003-0.01-0.008-0.015-0.012l-9.161-6.096 c-0.289-0.192-0.666-0.192-0.955,0L2.359,8.237C2.354,8.24,2.349,8.245,2.344,8.249L2.306,8.277 c-0.017,0.013-0.033,0.027-0.048,0.04C2.246,8.331,2.234,8.342,2.222,8.352c-0.015,0.015-0.028,0.03-0.042,0.047 c-0.012,0.013-0.022,0.023-0.03,0.037C2.139,8.453,2.125,8.471,2.115,8.488C2.107,8.501,2.099,8.514,2.09,8.526 C2.079,8.548,2.069,8.565,2.06,8.585C2.054,8.6,2.047,8.613,2.04,8.626C2.032,8.648,2.025,8.67,2.019,8.69 c-0.005,0.013-0.01,0.027-0.013,0.042C1.999,8.755,1.995,8.778,1.99,8.803C1.989,8.817,1.985,8.828,1.984,8.84 C1.978,8.879,1.975,8.915,1.975,8.954v6.093c0,0.037,0.003,0.075,0.008,0.112c0.002,0.012,0.005,0.025,0.007,0.038 c0.005,0.023,0.008,0.047,0.015,0.072c0.003,0.015,0.008,0.028,0.013,0.04c0.007,0.022,0.013,0.042,0.022,0.063 c0.007,0.015,0.013,0.028,0.02,0.04c0.008,0.02,0.018,0.038,0.03,0.058c0.007,0.013,0.015,0.027,0.025,0.038 c0.012,0.018,0.023,0.035,0.035,0.052c0.01,0.013,0.02,0.025,0.03,0.037c0.013,0.015,0.028,0.032,0.042,0.045 c0.012,0.012,0.023,0.023,0.035,0.035c0.015,0.013,0.032,0.028,0.048,0.04l0.038,0.03c0.005,0.003,0.01,0.007,0.013,0.01 l9.163,6.095C11.668,21.953,11.833,22,12,22c0.167,0,0.332-0.047,0.478-0.144l9.163-6.095l0.015-0.01 c0.013-0.01,0.027-0.02,0.037-0.03c0.018-0.013,0.035-0.028,0.048-0.04c0.013-0.012,0.025-0.023,0.035-0.035 c0.017-0.015,0.03-0.032,0.043-0.045c0.01-0.013,0.02-0.025,0.03-0.037c0.013-0.018,0.025-0.035,0.035-0.052 c0.008-0.013,0.018-0.027,0.025-0.038c0.012-0.02,0.022-0.038,0.03-0.058c0.007-0.013,0.013-0.027,0.02-0.04 c0.008-0.022,0.015-0.042,0.023-0.063c0.003-0.013,0.01-0.027,0.013-0.04c0.007-0.025,0.01-0.048,0.015-0.072 c0.002-0.013,0.005-0.027,0.007-0.037c0.003-0.042,0.007-0.079,0.007-0.117V8.954C22.025,8.915,22.022,8.879,22.016,8.84z M12.862,4.464l6.751,4.49l-3.016,2.013l-3.735-2.492V4.464z M11.138,4.464v4.009l-3.735,2.494L4.389,8.954L11.138,4.464z M3.699,10.562L5.853,12l-2.155,1.438V10.562z M11.138,19.536l-6.749-4.491l3.015-2.011l3.735,2.492V19.536z M12,14.035L8.953,12 L12,9.966L15.047,12L12,14.035z M12.862,19.536v-4.009l3.735-2.492l3.016,2.011L12.862,19.536z M20.303,13.438L18.147,12 l2.156-1.438L20.303,13.438z"
  35413. }));
  35414. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/deviantart.js
  35415. /**
  35416. * WordPress dependencies
  35417. */
  35418. const DeviantArtIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35419. width: "24",
  35420. height: "24",
  35421. viewBox: "0 0 24 24",
  35422. version: "1.1"
  35423. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35424. d: "M 18.19 5.636 18.19 2 18.188 2 14.553 2 14.19 2.366 12.474 5.636 11.935 6 5.81 6 5.81 10.994 9.177 10.994 9.477 11.357 5.81 18.363 5.81 22 5.811 22 9.447 22 9.81 21.634 11.526 18.364 12.065 18 18.19 18 18.19 13.006 14.823 13.006 14.523 12.641 18.19 5.636z"
  35425. }));
  35426. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/dribbble.js
  35427. /**
  35428. * WordPress dependencies
  35429. */
  35430. const DribbbleIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35431. width: "24",
  35432. height: "24",
  35433. viewBox: "0 0 24 24",
  35434. version: "1.1"
  35435. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35436. d: "M12,22C6.486,22,2,17.514,2,12S6.486,2,12,2c5.514,0,10,4.486,10,10S17.514,22,12,22z M20.434,13.369 c-0.292-0.092-2.644-0.794-5.32-0.365c1.117,3.07,1.572,5.57,1.659,6.09C18.689,17.798,20.053,15.745,20.434,13.369z M15.336,19.876c-0.127-0.749-0.623-3.361-1.822-6.477c-0.019,0.006-0.038,0.013-0.056,0.019c-4.818,1.679-6.547,5.02-6.701,5.334 c1.448,1.129,3.268,1.803,5.243,1.803C13.183,20.555,14.311,20.313,15.336,19.876z M5.654,17.724 c0.193-0.331,2.538-4.213,6.943-5.637c0.111-0.036,0.224-0.07,0.337-0.102c-0.214-0.485-0.448-0.971-0.692-1.45 c-4.266,1.277-8.405,1.223-8.778,1.216c-0.003,0.087-0.004,0.174-0.004,0.261C3.458,14.207,4.29,16.21,5.654,17.724z M3.639,10.264 c0.382,0.005,3.901,0.02,7.897-1.041c-1.415-2.516-2.942-4.631-3.167-4.94C5.979,5.41,4.193,7.613,3.639,10.264z M9.998,3.709 c0.236,0.316,1.787,2.429,3.187,5c3.037-1.138,4.323-2.867,4.477-3.085C16.154,4.286,14.17,3.471,12,3.471 C11.311,3.471,10.641,3.554,9.998,3.709z M18.612,6.612C18.432,6.855,17,8.69,13.842,9.979c0.199,0.407,0.389,0.821,0.567,1.237 c0.063,0.148,0.124,0.295,0.184,0.441c2.842-0.357,5.666,0.215,5.948,0.275C20.522,9.916,19.801,8.065,18.612,6.612z"
  35437. }));
  35438. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/dropbox.js
  35439. /**
  35440. * WordPress dependencies
  35441. */
  35442. const DropboxIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35443. width: "24",
  35444. height: "24",
  35445. viewBox: "0 0 24 24",
  35446. version: "1.1"
  35447. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35448. d: "M12,6.134L6.069,9.797L2,6.54l5.883-3.843L12,6.134z M2,13.054l5.883,3.843L12,13.459L6.069,9.797L2,13.054z M12,13.459 l4.116,3.439L22,13.054l-4.069-3.257L12,13.459z M22,6.54l-5.884-3.843L12,6.134l5.931,3.663L22,6.54z M12.011,14.2l-4.129,3.426 l-1.767-1.153v1.291l5.896,3.539l5.897-3.539v-1.291l-1.769,1.153L12.011,14.2z"
  35449. }));
  35450. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/etsy.js
  35451. /**
  35452. * WordPress dependencies
  35453. */
  35454. const EtsyIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35455. width: "24",
  35456. height: "24",
  35457. viewBox: "0 0 24 24",
  35458. version: "1.1"
  35459. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35460. d: "M9.16033,4.038c0-.27174.02717-.43478.48913-.43478h6.22283c1.087,0,1.68478.92391,2.11957,2.663l.35326,1.38587h1.05978C19.59511,3.712,19.75815,2,19.75815,2s-2.663.29891-4.23913.29891h-7.962L3.29076,2.163v1.1413L4.731,3.57609c1.00543.19022,1.25.40761,1.33152,1.33152,0,0,.08152,2.71739.08152,7.20109s-.08152,7.17391-.08152,7.17391c0,.81522-.32609,1.11413-1.33152,1.30435l-1.44022.27174V22l4.2663-.13587h7.11957c1.60326,0,5.32609.13587,5.32609.13587.08152-.97826.625-5.40761.70652-5.89674H19.7038L18.644,18.52174c-.84239,1.90217-2.06522,2.038-3.42391,2.038H11.1712c-1.3587,0-2.01087-.54348-2.01087-1.712V12.65217s3.0163,0,3.99457.08152c.76087.05435,1.22283.27174,1.46739,1.33152l.32609,1.413h1.16848l-.08152-3.55978.163-3.587H15.02989l-.38043,1.57609c-.24457,1.03261-.40761,1.22283-1.46739,1.33152-1.38587.13587-4.02174.1087-4.02174.1087Z"
  35461. }));
  35462. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/facebook.js
  35463. /**
  35464. * WordPress dependencies
  35465. */
  35466. const FacebookIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35467. width: "24",
  35468. height: "24",
  35469. viewBox: "0 0 24 24",
  35470. version: "1.1"
  35471. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35472. d: "M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"
  35473. }));
  35474. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/feed.js
  35475. /**
  35476. * WordPress dependencies
  35477. */
  35478. const FeedIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35479. width: "24",
  35480. height: "24",
  35481. viewBox: "0 0 24 24",
  35482. version: "1.1"
  35483. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35484. d: "M2,8.667V12c5.515,0,10,4.485,10,10h3.333C15.333,14.637,9.363,8.667,2,8.667z M2,2v3.333 c9.19,0,16.667,7.477,16.667,16.667H22C22,10.955,13.045,2,2,2z M4.5,17C3.118,17,2,18.12,2,19.5S3.118,22,4.5,22S7,20.88,7,19.5 S5.882,17,4.5,17z"
  35485. }));
  35486. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/flickr.js
  35487. /**
  35488. * WordPress dependencies
  35489. */
  35490. const FlickrIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35491. width: "24",
  35492. height: "24",
  35493. viewBox: "0 0 24 24",
  35494. version: "1.1"
  35495. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35496. d: "M6.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5S9.25,7,6.5,7z M17.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5 S20.25,7,17.5,7z"
  35497. }));
  35498. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/foursquare.js
  35499. /**
  35500. * WordPress dependencies
  35501. */
  35502. const FoursquareIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35503. width: "24",
  35504. height: "24",
  35505. viewBox: "0 0 24 24",
  35506. version: "1.1"
  35507. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35508. d: "M17.573,2c0,0-9.197,0-10.668,0S5,3.107,5,3.805s0,16.948,0,16.948c0,0.785,0.422,1.077,0.66,1.172 c0.238,0.097,0.892,0.177,1.285-0.275c0,0,5.035-5.843,5.122-5.93c0.132-0.132,0.132-0.132,0.262-0.132h3.26 c1.368,0,1.588-0.977,1.732-1.552c0.078-0.318,0.692-3.428,1.225-6.122l0.675-3.368C19.56,2.893,19.14,2,17.573,2z M16.495,7.22 c-0.053,0.252-0.372,0.518-0.665,0.518c-0.293,0-4.157,0-4.157,0c-0.467,0-0.802,0.318-0.802,0.787v0.508 c0,0.467,0.337,0.798,0.805,0.798c0,0,3.197,0,3.528,0s0.655,0.362,0.583,0.715c-0.072,0.353-0.407,2.102-0.448,2.295 c-0.04,0.193-0.262,0.523-0.655,0.523c-0.33,0-2.88,0-2.88,0c-0.523,0-0.683,0.068-1.033,0.503 c-0.35,0.437-3.505,4.223-3.505,4.223c-0.032,0.035-0.063,0.027-0.063-0.015V4.852c0-0.298,0.26-0.648,0.648-0.648 c0,0,8.228,0,8.562,0c0.315,0,0.61,0.297,0.528,0.683L16.495,7.22z"
  35509. }));
  35510. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/goodreads.js
  35511. /**
  35512. * WordPress dependencies
  35513. */
  35514. const GoodreadsIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35515. width: "24",
  35516. height: "24",
  35517. viewBox: "0 0 24 24",
  35518. version: "1.1"
  35519. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35520. d: "M17.3,17.5c-0.2,0.8-0.5,1.4-1,1.9c-0.4,0.5-1,0.9-1.7,1.2C13.9,20.9,13.1,21,12,21c-0.6,0-1.3-0.1-1.9-0.2 c-0.6-0.1-1.1-0.4-1.6-0.7c-0.5-0.3-0.9-0.7-1.2-1.2c-0.3-0.5-0.5-1.1-0.5-1.7h1.5c0.1,0.5,0.2,0.9,0.5,1.2 c0.2,0.3,0.5,0.6,0.9,0.8c0.3,0.2,0.7,0.3,1.1,0.4c0.4,0.1,0.8,0.1,1.2,0.1c1.4,0,2.5-0.4,3.1-1.2c0.6-0.8,1-2,1-3.5v-1.7h0 c-0.4,0.8-0.9,1.4-1.6,1.9c-0.7,0.5-1.5,0.7-2.4,0.7c-1,0-1.9-0.2-2.6-0.5C8.7,15,8.1,14.5,7.7,14c-0.5-0.6-0.8-1.3-1-2.1 c-0.2-0.8-0.3-1.6-0.3-2.5c0-0.9,0.1-1.7,0.4-2.5c0.3-0.8,0.6-1.5,1.1-2c0.5-0.6,1.1-1,1.8-1.4C10.3,3.2,11.1,3,12,3 c0.5,0,0.9,0.1,1.3,0.2c0.4,0.1,0.8,0.3,1.1,0.5c0.3,0.2,0.6,0.5,0.9,0.8c0.3,0.3,0.5,0.6,0.6,1h0V3.4h1.5V15 C17.6,15.9,17.5,16.7,17.3,17.5z M13.8,14.1c0.5-0.3,0.9-0.7,1.3-1.1c0.3-0.5,0.6-1,0.8-1.6c0.2-0.6,0.3-1.2,0.3-1.9 c0-0.6-0.1-1.2-0.2-1.9c-0.1-0.6-0.4-1.2-0.7-1.7c-0.3-0.5-0.7-0.9-1.3-1.2c-0.5-0.3-1.1-0.5-1.9-0.5s-1.4,0.2-1.9,0.5 c-0.5,0.3-1,0.7-1.3,1.2C8.5,6.4,8.3,7,8.1,7.6C8,8.2,7.9,8.9,7.9,9.5c0,0.6,0.1,1.3,0.2,1.9C8.3,12,8.6,12.5,8.9,13 c0.3,0.5,0.8,0.8,1.3,1.1c0.5,0.3,1.1,0.4,1.9,0.4C12.7,14.5,13.3,14.4,13.8,14.1z"
  35521. }));
  35522. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/google.js
  35523. /**
  35524. * WordPress dependencies
  35525. */
  35526. const GoogleIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35527. width: "24",
  35528. height: "24",
  35529. viewBox: "0 0 24 24",
  35530. version: "1.1"
  35531. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35532. d: "M12.02,10.18v3.72v0.01h5.51c-0.26,1.57-1.67,4.22-5.5,4.22c-3.31,0-6.01-2.75-6.01-6.12s2.7-6.12,6.01-6.12 c1.87,0,3.13,0.8,3.85,1.48l2.84-2.76C16.99,2.99,14.73,2,12.03,2c-5.52,0-10,4.48-10,10s4.48,10,10,10c5.77,0,9.6-4.06,9.6-9.77 c0-0.83-0.11-1.42-0.25-2.05H12.02z"
  35533. }));
  35534. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/github.js
  35535. /**
  35536. * WordPress dependencies
  35537. */
  35538. const GitHubIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35539. width: "24",
  35540. height: "24",
  35541. viewBox: "0 0 24 24",
  35542. version: "1.1"
  35543. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35544. d: "M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"
  35545. }));
  35546. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/instagram.js
  35547. /**
  35548. * WordPress dependencies
  35549. */
  35550. const InstagramIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35551. width: "24",
  35552. height: "24",
  35553. viewBox: "0 0 24 24",
  35554. version: "1.1"
  35555. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35556. d: "M12,4.622c2.403,0,2.688,0.009,3.637,0.052c0.877,0.04,1.354,0.187,1.671,0.31c0.42,0.163,0.72,0.358,1.035,0.673 c0.315,0.315,0.51,0.615,0.673,1.035c0.123,0.317,0.27,0.794,0.31,1.671c0.043,0.949,0.052,1.234,0.052,3.637 s-0.009,2.688-0.052,3.637c-0.04,0.877-0.187,1.354-0.31,1.671c-0.163,0.42-0.358,0.72-0.673,1.035 c-0.315,0.315-0.615,0.51-1.035,0.673c-0.317,0.123-0.794,0.27-1.671,0.31c-0.949,0.043-1.233,0.052-3.637,0.052 s-2.688-0.009-3.637-0.052c-0.877-0.04-1.354-0.187-1.671-0.31c-0.42-0.163-0.72-0.358-1.035-0.673 c-0.315-0.315-0.51-0.615-0.673-1.035c-0.123-0.317-0.27-0.794-0.31-1.671C4.631,14.688,4.622,14.403,4.622,12 s0.009-2.688,0.052-3.637c0.04-0.877,0.187-1.354,0.31-1.671c0.163-0.42,0.358-0.72,0.673-1.035 c0.315-0.315,0.615-0.51,1.035-0.673c0.317-0.123,0.794-0.27,1.671-0.31C9.312,4.631,9.597,4.622,12,4.622 M12,3 C9.556,3,9.249,3.01,8.289,3.054C7.331,3.098,6.677,3.25,6.105,3.472C5.513,3.702,5.011,4.01,4.511,4.511 c-0.5,0.5-0.808,1.002-1.038,1.594C3.25,6.677,3.098,7.331,3.054,8.289C3.01,9.249,3,9.556,3,12c0,2.444,0.01,2.751,0.054,3.711 c0.044,0.958,0.196,1.612,0.418,2.185c0.23,0.592,0.538,1.094,1.038,1.594c0.5,0.5,1.002,0.808,1.594,1.038 c0.572,0.222,1.227,0.375,2.185,0.418C9.249,20.99,9.556,21,12,21s2.751-0.01,3.711-0.054c0.958-0.044,1.612-0.196,2.185-0.418 c0.592-0.23,1.094-0.538,1.594-1.038c0.5-0.5,0.808-1.002,1.038-1.594c0.222-0.572,0.375-1.227,0.418-2.185 C20.99,14.751,21,14.444,21,12s-0.01-2.751-0.054-3.711c-0.044-0.958-0.196-1.612-0.418-2.185c-0.23-0.592-0.538-1.094-1.038-1.594 c-0.5-0.5-1.002-0.808-1.594-1.038c-0.572-0.222-1.227-0.375-2.185-0.418C14.751,3.01,14.444,3,12,3L12,3z M12,7.378 c-2.552,0-4.622,2.069-4.622,4.622S9.448,16.622,12,16.622s4.622-2.069,4.622-4.622S14.552,7.378,12,7.378z M12,15 c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S13.657,15,12,15z M16.804,6.116c-0.596,0-1.08,0.484-1.08,1.08 s0.484,1.08,1.08,1.08c0.596,0,1.08-0.484,1.08-1.08S17.401,6.116,16.804,6.116z"
  35557. }));
  35558. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/lastfm.js
  35559. /**
  35560. * WordPress dependencies
  35561. */
  35562. const LastfmIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35563. width: "24",
  35564. height: "24",
  35565. viewBox: "0 0 24 24",
  35566. version: "1.1"
  35567. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35568. d: "M 12.0002 1.5 C 6.2006 1.5 1.5 6.2011 1.5 11.9998 C 1.5 17.799 6.2006 22.5 12.0002 22.5 C 17.799 22.5 22.5 17.799 22.5 11.9998 C 22.5 6.2011 17.799 1.5 12.0002 1.5 Z M 16.1974 16.2204 C 14.8164 16.2152 13.9346 15.587 13.3345 14.1859 L 13.1816 13.8451 L 11.8541 10.8101 C 11.4271 9.7688 10.3526 9.0712 9.1801 9.0712 C 7.5695 9.0712 6.2593 10.3851 6.2593 12.001 C 6.2593 13.6165 7.5695 14.9303 9.1801 14.9303 C 10.272 14.9303 11.2651 14.3275 11.772 13.3567 C 11.7893 13.3235 11.8239 13.302 11.863 13.3038 C 11.9007 13.3054 11.9353 13.3288 11.9504 13.3632 L 12.4865 14.6046 C 12.5016 14.639 12.4956 14.6778 12.4723 14.7069 C 11.6605 15.6995 10.4602 16.2683 9.1801 16.2683 C 6.8331 16.2683 4.9234 14.3536 4.9234 12.001 C 4.9234 9.6468 6.833 7.732 9.1801 7.732 C 10.9572 7.732 12.3909 8.6907 13.1138 10.3636 C 13.1206 10.3802 13.8412 12.0708 14.4744 13.5191 C 14.8486 14.374 15.1462 14.896 16.1288 14.9292 C 17.0663 14.9613 17.7538 14.4122 17.7538 13.6485 C 17.7538 12.9691 17.3321 12.8004 16.3803 12.4822 C 14.7365 11.9398 13.845 11.3861 13.845 10.0182 C 13.845 8.6809 14.7667 7.8162 16.192 7.8162 C 17.1288 7.8162 17.8155 8.2287 18.2921 9.0768 C 18.305 9.1006 18.3079 9.1281 18.3004 9.1542 C 18.2929 9.1803 18.2748 9.2021 18.2507 9.2138 L 17.3614 9.669 C 17.3178 9.692 17.2643 9.6781 17.2356 9.6385 C 16.9329 9.2135 16.5956 9.0251 16.1423 9.0251 C 15.5512 9.0251 15.122 9.429 15.122 9.9865 C 15.122 10.6738 15.6529 10.8414 16.5339 11.1192 C 16.6491 11.1558 16.7696 11.194 16.8939 11.2343 C 18.2763 11.6865 19.0768 12.2311 19.0768 13.6836 C 19.0769 15.1297 17.8389 16.2204 16.1974 16.2204 Z"
  35569. }));
  35570. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/linkedin.js
  35571. /**
  35572. * WordPress dependencies
  35573. */
  35574. const LinkedInIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35575. width: "24",
  35576. height: "24",
  35577. viewBox: "0 0 24 24",
  35578. version: "1.1"
  35579. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35580. d: "M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"
  35581. }));
  35582. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/mail.js
  35583. /**
  35584. * WordPress dependencies
  35585. */
  35586. const MailIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35587. width: "24",
  35588. height: "24",
  35589. viewBox: "0 0 24 24",
  35590. version: "1.1"
  35591. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35592. d: "M20,4H4C2.895,4,2,4.895,2,6v12c0,1.105,0.895,2,2,2h16c1.105,0,2-0.895,2-2V6C22,4.895,21.105,4,20,4z M20,8.236l-8,4.882 L4,8.236V6h16V8.236z"
  35593. }));
  35594. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/mastodon.js
  35595. /**
  35596. * WordPress dependencies
  35597. */
  35598. const MastodonIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35599. width: "24",
  35600. height: "24",
  35601. viewBox: "0 0 24 24",
  35602. version: "1.1"
  35603. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35604. d: "M23.193 7.879c0-5.206-3.411-6.732-3.411-6.732C18.062.357 15.108.025 12.041 0h-.076c-3.068.025-6.02.357-7.74 1.147 0 0-3.411 1.526-3.411 6.732 0 1.192-.023 2.618.015 4.129.124 5.092.934 10.109 5.641 11.355 2.17.574 4.034.695 5.535.612 2.722-.15 4.25-.972 4.25-.972l-.09-1.975s-1.945.613-4.129.539c-2.165-.074-4.449-.233-4.799-2.891a5.499 5.499 0 0 1-.048-.745s2.125.52 4.817.643c1.646.075 3.19-.097 4.758-.283 3.007-.359 5.625-2.212 5.954-3.905.517-2.665.475-6.507.475-6.507zm-4.024 6.709h-2.497V8.469c0-1.29-.543-1.944-1.628-1.944-1.2 0-1.802.776-1.802 2.312v3.349h-2.483v-3.35c0-1.536-.602-2.312-1.802-2.312-1.085 0-1.628.655-1.628 1.944v6.119H4.832V8.284c0-1.289.328-2.313.987-3.07.68-.758 1.569-1.146 2.674-1.146 1.278 0 2.246.491 2.886 1.474L12 6.585l.622-1.043c.64-.983 1.608-1.474 2.886-1.474 1.104 0 1.994.388 2.674 1.146.658.757.986 1.781.986 3.07v6.304z"
  35605. }));
  35606. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/meetup.js
  35607. /**
  35608. * WordPress dependencies
  35609. */
  35610. const MeetupIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35611. width: "24",
  35612. height: "24",
  35613. viewBox: "0 0 24 24",
  35614. version: "1.1"
  35615. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35616. d: "M19.24775,14.722a3.57032,3.57032,0,0,1-2.94457,3.52073,3.61886,3.61886,0,0,1-.64652.05634c-.07314-.0008-.10187.02846-.12507.09547A2.38881,2.38881,0,0,1,13.49453,20.094a2.33092,2.33092,0,0,1-1.827-.50716.13635.13635,0,0,0-.19878-.00408,3.191,3.191,0,0,1-2.104.60248,3.26309,3.26309,0,0,1-3.00324-2.71993,2.19076,2.19076,0,0,1-.03512-.30865c-.00156-.08579-.03413-.1189-.11608-.13493a2.86421,2.86421,0,0,1-1.23189-.56111,2.945,2.945,0,0,1-1.166-2.05749,2.97484,2.97484,0,0,1,.87524-2.50774.112.112,0,0,0,.02091-.16107,2.7213,2.7213,0,0,1-.36648-1.48A2.81256,2.81256,0,0,1,6.57673,7.58838a.35764.35764,0,0,0,.28869-.22819,4.2208,4.2208,0,0,1,6.02892-1.90111.25161.25161,0,0,0,.22023.0243,3.65608,3.65608,0,0,1,3.76031.90678A3.57244,3.57244,0,0,1,17.95918,8.626a2.97339,2.97339,0,0,1,.01829.57356.10637.10637,0,0,0,.0853.12792,1.97669,1.97669,0,0,1,1.27939,1.33733,2.00266,2.00266,0,0,1-.57112,2.12652c-.05284.05166-.04168.08328-.01173.13489A3.51189,3.51189,0,0,1,19.24775,14.722Zm-6.35959-.27836a1.6984,1.6984,0,0,0,1.14556,1.61113,3.82039,3.82039,0,0,0,1.036.17935,1.46888,1.46888,0,0,0,.73509-.12255.44082.44082,0,0,0,.26057-.44274.45312.45312,0,0,0-.29211-.43375.97191.97191,0,0,0-.20678-.063c-.21326-.03806-.42754-.0701-.63973-.11215a.54787.54787,0,0,1-.50172-.60926,2.75864,2.75864,0,0,1,.1773-.901c.1763-.535.414-1.045.64183-1.55913A12.686,12.686,0,0,0,15.85,10.47863a1.58461,1.58461,0,0,0,.04861-.87208,1.04531,1.04531,0,0,0-.85432-.83981,1.60658,1.60658,0,0,0-1.23654.16594.27593.27593,0,0,1-.36286-.03413c-.085-.0747-.16594-.15379-.24918-.23055a.98682.98682,0,0,0-1.33577-.04933,6.1468,6.1468,0,0,1-.4989.41615.47762.47762,0,0,1-.51535.03566c-.17448-.09307-.35512-.175-.53531-.25665a1.74949,1.74949,0,0,0-.56476-.2016,1.69943,1.69943,0,0,0-1.61654.91787,8.05815,8.05815,0,0,0-.32952.80126c-.45471,1.2557-.82507,2.53825-1.20838,3.81639a1.24151,1.24151,0,0,0,.51532,1.44389,1.42659,1.42659,0,0,0,1.22008.17166,1.09728,1.09728,0,0,0,.66994-.69764c.44145-1.04111.839-2.09989,1.25981-3.14926.11581-.28876.22792-.57874.35078-.86438a.44548.44548,0,0,1,.69189-.19539.50521.50521,0,0,1,.15044.43836,1.75625,1.75625,0,0,1-.14731.50453c-.27379.69219-.55265,1.38236-.82766,2.074a2.0836,2.0836,0,0,0-.14038.42876.50719.50719,0,0,0,.27082.57722.87236.87236,0,0,0,.66145.02739.99137.99137,0,0,0,.53406-.532q.61571-1.20914,1.228-2.42031.28423-.55863.57585-1.1133a.87189.87189,0,0,1,.29055-.35253.34987.34987,0,0,1,.37634-.01265.30291.30291,0,0,1,.12434.31459.56716.56716,0,0,1-.04655.1915c-.05318.12739-.10286.25669-.16183.38156-.34118.71775-.68754,1.43273-1.02568,2.152A2.00213,2.00213,0,0,0,12.88816,14.44366Zm4.78568,5.28972a.88573.88573,0,0,0-1.77139.00465.8857.8857,0,0,0,1.77139-.00465Zm-14.83838-7.296a.84329.84329,0,1,0,.00827-1.68655.8433.8433,0,0,0-.00827,1.68655Zm10.366-9.43673a.83506.83506,0,1,0-.0091,1.67.83505.83505,0,0,0,.0091-1.67Zm6.85014,5.22a.71651.71651,0,0,0-1.433.0093.71656.71656,0,0,0,1.433-.0093ZM5.37528,6.17908A.63823.63823,0,1,0,6.015,5.54483.62292.62292,0,0,0,5.37528,6.17908Zm6.68214,14.80843a.54949.54949,0,1,0-.55052.541A.54556.54556,0,0,0,12.05742,20.98752Zm8.53235-8.49689a.54777.54777,0,0,0-.54027.54023.53327.53327,0,0,0,.532.52293.51548.51548,0,0,0,.53272-.5237A.53187.53187,0,0,0,20.58977,12.49063ZM7.82846,2.4715a.44927.44927,0,1,0,.44484.44766A.43821.43821,0,0,0,7.82846,2.4715Zm13.775,7.60492a.41186.41186,0,0,0-.40065.39623.40178.40178,0,0,0,.40168.40168A.38994.38994,0,0,0,22,10.48172.39946.39946,0,0,0,21.60349,10.07642ZM5.79193,17.96207a.40469.40469,0,0,0-.397-.39646.399.399,0,0,0-.396.405.39234.39234,0,0,0,.39939.389A.39857.39857,0,0,0,5.79193,17.96207Z"
  35617. }));
  35618. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/medium.js
  35619. /**
  35620. * WordPress dependencies
  35621. */
  35622. const MediumIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35623. width: "24",
  35624. height: "24",
  35625. viewBox: "0 0 24 24",
  35626. version: "1.1"
  35627. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35628. d: "M20.962,7.257l-5.457,8.867l-3.923-6.375l3.126-5.08c0.112-0.182,0.319-0.286,0.527-0.286c0.05,0,0.1,0.008,0.149,0.02 c0.039,0.01,0.078,0.023,0.114,0.041l5.43,2.715l0.006,0.003c0.004,0.002,0.007,0.006,0.011,0.008 C20.971,7.191,20.98,7.227,20.962,7.257z M9.86,8.592v5.783l5.14,2.57L9.86,8.592z M15.772,17.331l4.231,2.115 C20.554,19.721,21,19.529,21,19.016V8.835L15.772,17.331z M8.968,7.178L3.665,4.527C3.569,4.479,3.478,4.456,3.395,4.456 C3.163,4.456,3,4.636,3,4.938v11.45c0,0.306,0.224,0.669,0.498,0.806l4.671,2.335c0.12,0.06,0.234,0.088,0.337,0.088 c0.29,0,0.494-0.225,0.494-0.602V7.231C9,7.208,8.988,7.188,8.968,7.178z"
  35629. }));
  35630. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/patreon.js
  35631. /**
  35632. * WordPress dependencies
  35633. */
  35634. const PatreonIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35635. width: "24",
  35636. height: "24",
  35637. viewBox: "0 0 569 546",
  35638. version: "1.1"
  35639. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Circle, {
  35640. cx: "363",
  35641. cy: "205",
  35642. r: "205"
  35643. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
  35644. width: "100",
  35645. height: "546",
  35646. x: "0",
  35647. y: "0"
  35648. }));
  35649. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/pinterest.js
  35650. /**
  35651. * WordPress dependencies
  35652. */
  35653. const PinterestIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35654. width: "24",
  35655. height: "24",
  35656. viewBox: "0 0 24 24",
  35657. version: "1.1"
  35658. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35659. d: "M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2"
  35660. }));
  35661. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/pocket.js
  35662. /**
  35663. * WordPress dependencies
  35664. */
  35665. const PocketIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35666. width: "24",
  35667. height: "24",
  35668. viewBox: "0 0 24 24",
  35669. version: "1.1"
  35670. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35671. d: "M21.927,4.194C21.667,3.48,20.982,3,20.222,3h-0.01h-1.721H3.839C3.092,3,2.411,3.47,2.145,4.17 C2.066,4.378,2.026,4.594,2.026,4.814v6.035l0.069,1.2c0.29,2.73,1.707,5.115,3.899,6.778c0.039,0.03,0.079,0.059,0.119,0.089 l0.025,0.018c1.175,0.859,2.491,1.441,3.91,1.727c0.655,0.132,1.325,0.2,1.991,0.2c0.615,0,1.232-0.057,1.839-0.17 c0.073-0.014,0.145-0.028,0.219-0.044c0.02-0.004,0.042-0.012,0.064-0.023c1.359-0.297,2.621-0.864,3.753-1.691l0.025-0.018 c0.04-0.029,0.08-0.058,0.119-0.089c2.192-1.664,3.609-4.049,3.898-6.778l0.069-1.2V4.814C22.026,4.605,22,4.398,21.927,4.194z M17.692,10.481l-4.704,4.512c-0.266,0.254-0.608,0.382-0.949,0.382c-0.342,0-0.684-0.128-0.949-0.382l-4.705-4.512 C5.838,9.957,5.82,9.089,6.344,8.542c0.524-0.547,1.392-0.565,1.939-0.04l3.756,3.601l3.755-3.601 c0.547-0.524,1.415-0.506,1.939,0.04C18.256,9.089,18.238,9.956,17.692,10.481z"
  35672. }));
  35673. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/reddit.js
  35674. /**
  35675. * WordPress dependencies
  35676. */
  35677. const RedditIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35678. width: "24",
  35679. height: "24",
  35680. viewBox: "0 0 24 24",
  35681. version: "1.1"
  35682. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35683. d: "M22,11.816c0-1.256-1.021-2.277-2.277-2.277c-0.593,0-1.122,0.24-1.526,0.614c-1.481-0.965-3.455-1.594-5.647-1.69 l1.171-3.702l3.18,0.748c0.008,1.028,0.846,1.862,1.876,1.862c1.035,0,1.877-0.842,1.877-1.878c0-1.035-0.842-1.877-1.877-1.877 c-0.769,0-1.431,0.466-1.72,1.13l-3.508-0.826c-0.203-0.047-0.399,0.067-0.46,0.261l-1.35,4.268 c-2.316,0.038-4.411,0.67-5.97,1.671C5.368,9.765,4.853,9.539,4.277,9.539C3.021,9.539,2,10.56,2,11.816 c0,0.814,0.433,1.523,1.078,1.925c-0.037,0.221-0.061,0.444-0.061,0.672c0,3.292,4.011,5.97,8.941,5.97s8.941-2.678,8.941-5.97 c0-0.214-0.02-0.424-0.053-0.632C21.533,13.39,22,12.661,22,11.816z M18.776,4.394c0.606,0,1.1,0.493,1.1,1.1s-0.493,1.1-1.1,1.1 s-1.1-0.494-1.1-1.1S18.169,4.394,18.776,4.394z M2.777,11.816c0-0.827,0.672-1.5,1.499-1.5c0.313,0,0.598,0.103,0.838,0.269 c-0.851,0.676-1.477,1.479-1.812,2.36C2.983,12.672,2.777,12.27,2.777,11.816z M11.959,19.606c-4.501,0-8.164-2.329-8.164-5.193 S7.457,9.22,11.959,9.22s8.164,2.329,8.164,5.193S16.46,19.606,11.959,19.606z M20.636,13.001c-0.326-0.89-0.948-1.701-1.797-2.384 c0.248-0.186,0.55-0.301,0.883-0.301c0.827,0,1.5,0.673,1.5,1.5C21.223,12.299,20.992,12.727,20.636,13.001z M8.996,14.704 c-0.76,0-1.397-0.616-1.397-1.376c0-0.76,0.637-1.397,1.397-1.397c0.76,0,1.376,0.637,1.376,1.397 C10.372,14.088,9.756,14.704,8.996,14.704z M16.401,13.328c0,0.76-0.616,1.376-1.376,1.376c-0.76,0-1.399-0.616-1.399-1.376 c0-0.76,0.639-1.397,1.399-1.397C15.785,11.931,16.401,12.568,16.401,13.328z M15.229,16.708c0.152,0.152,0.152,0.398,0,0.55 c-0.674,0.674-1.727,1.002-3.219,1.002c-0.004,0-0.007-0.002-0.011-0.002c-0.004,0-0.007,0.002-0.011,0.002 c-1.492,0-2.544-0.328-3.218-1.002c-0.152-0.152-0.152-0.398,0-0.55c0.152-0.152,0.399-0.151,0.55,0 c0.521,0.521,1.394,0.775,2.669,0.775c0.004,0,0.007,0.002,0.011,0.002c0.004,0,0.007-0.002,0.011-0.002 c1.275,0,2.148-0.253,2.669-0.775C14.831,16.556,15.078,16.556,15.229,16.708z"
  35684. }));
  35685. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/skype.js
  35686. /**
  35687. * WordPress dependencies
  35688. */
  35689. const SkypeIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35690. width: "24",
  35691. height: "24",
  35692. viewBox: "0 0 24 24",
  35693. version: "1.1"
  35694. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35695. d: "M10.113,2.699c0.033-0.006,0.067-0.013,0.1-0.02c0.033,0.017,0.066,0.033,0.098,0.051L10.113,2.699z M2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223z M21.275,13.771 c0.007-0.035,0.011-0.071,0.018-0.106c-0.018-0.031-0.033-0.064-0.052-0.095L21.275,13.771z M13.563,21.199 c0.032,0.019,0.065,0.035,0.096,0.053c0.036-0.006,0.071-0.011,0.105-0.017L13.563,21.199z M22,16.386 c0,1.494-0.581,2.898-1.637,3.953c-1.056,1.057-2.459,1.637-3.953,1.637c-0.967,0-1.914-0.251-2.75-0.725 c0.036-0.006,0.071-0.011,0.105-0.017l-0.202-0.035c0.032,0.019,0.065,0.035,0.096,0.053c-0.543,0.096-1.099,0.147-1.654,0.147 c-1.275,0-2.512-0.25-3.676-0.743c-1.125-0.474-2.135-1.156-3.002-2.023c-0.867-0.867-1.548-1.877-2.023-3.002 c-0.493-1.164-0.743-2.401-0.743-3.676c0-0.546,0.049-1.093,0.142-1.628c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103C2.244,9.5,2,8.566,2,7.615c0-1.493,0.582-2.898,1.637-3.953 c1.056-1.056,2.46-1.638,3.953-1.638c0.915,0,1.818,0.228,2.622,0.655c-0.033,0.007-0.067,0.013-0.1,0.02l0.199,0.031 c-0.032-0.018-0.066-0.034-0.098-0.051c0.002,0,0.003-0.001,0.004-0.001c0.586-0.112,1.187-0.169,1.788-0.169 c1.275,0,2.512,0.249,3.676,0.742c1.124,0.476,2.135,1.156,3.002,2.024c0.868,0.867,1.548,1.877,2.024,3.002 c0.493,1.164,0.743,2.401,0.743,3.676c0,0.575-0.054,1.15-0.157,1.712c-0.018-0.031-0.033-0.064-0.052-0.095l0.034,0.201 c0.007-0.035,0.011-0.071,0.018-0.106C21.754,14.494,22,15.432,22,16.386z M16.817,14.138c0-1.331-0.613-2.743-3.033-3.282 l-2.209-0.49c-0.84-0.192-1.807-0.444-1.807-1.237c0-0.794,0.679-1.348,1.903-1.348c2.468,0,2.243,1.696,3.468,1.696 c0.645,0,1.209-0.379,1.209-1.031c0-1.521-2.435-2.663-4.5-2.663c-2.242,0-4.63,0.952-4.63,3.488c0,1.221,0.436,2.521,2.839,3.123 l2.984,0.745c0.903,0.223,1.129,0.731,1.129,1.189c0,0.762-0.758,1.507-2.129,1.507c-2.679,0-2.307-2.062-3.743-2.062 c-0.645,0-1.113,0.444-1.113,1.078c0,1.236,1.501,2.886,4.856,2.886C15.236,17.737,16.817,16.199,16.817,14.138z"
  35696. }));
  35697. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/snapchat.js
  35698. /**
  35699. * WordPress dependencies
  35700. */
  35701. const SnapchatIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35702. width: "24",
  35703. height: "24",
  35704. viewBox: "0 0 24 24",
  35705. version: "1.1"
  35706. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35707. d: "M12.065,2a5.526,5.526,0,0,1,3.132.892A5.854,5.854,0,0,1,17.326,5.4a5.821,5.821,0,0,1,.351,2.33q0,.612-.117,2.487a.809.809,0,0,0,.365.091,1.93,1.93,0,0,0,.664-.176,1.93,1.93,0,0,1,.664-.176,1.3,1.3,0,0,1,.729.234.7.7,0,0,1,.351.6.839.839,0,0,1-.41.7,2.732,2.732,0,0,1-.9.41,3.192,3.192,0,0,0-.9.378.728.728,0,0,0-.41.618,1.575,1.575,0,0,0,.156.56,6.9,6.9,0,0,0,1.334,1.953,5.6,5.6,0,0,0,1.881,1.315,5.875,5.875,0,0,0,1.042.3.42.42,0,0,1,.365.456q0,.911-2.852,1.341a1.379,1.379,0,0,0-.143.507,1.8,1.8,0,0,1-.182.605.451.451,0,0,1-.429.241,5.878,5.878,0,0,1-.807-.085,5.917,5.917,0,0,0-.833-.085,4.217,4.217,0,0,0-.807.065,2.42,2.42,0,0,0-.82.293,6.682,6.682,0,0,0-.755.5q-.351.267-.755.527a3.886,3.886,0,0,1-.989.436A4.471,4.471,0,0,1,11.831,22a4.307,4.307,0,0,1-1.256-.176,3.784,3.784,0,0,1-.976-.436q-.4-.26-.749-.527a6.682,6.682,0,0,0-.755-.5,2.422,2.422,0,0,0-.807-.293,4.432,4.432,0,0,0-.82-.065,5.089,5.089,0,0,0-.853.1,5,5,0,0,1-.762.1.474.474,0,0,1-.456-.241,1.819,1.819,0,0,1-.182-.618,1.411,1.411,0,0,0-.143-.521q-2.852-.429-2.852-1.341a.42.42,0,0,1,.365-.456,5.793,5.793,0,0,0,1.042-.3,5.524,5.524,0,0,0,1.881-1.315,6.789,6.789,0,0,0,1.334-1.953A1.575,1.575,0,0,0,6,12.9a.728.728,0,0,0-.41-.618,3.323,3.323,0,0,0-.9-.384,2.912,2.912,0,0,1-.9-.41.814.814,0,0,1-.41-.684.71.71,0,0,1,.338-.593,1.208,1.208,0,0,1,.716-.241,1.976,1.976,0,0,1,.625.169,2.008,2.008,0,0,0,.69.169.919.919,0,0,0,.416-.091q-.117-1.849-.117-2.474A5.861,5.861,0,0,1,6.385,5.4,5.516,5.516,0,0,1,8.625,2.819,7.075,7.075,0,0,1,12.062,2Z"
  35708. }));
  35709. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/soundcloud.js
  35710. /**
  35711. * WordPress dependencies
  35712. */
  35713. const SoundCloudIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35714. width: "24",
  35715. height: "24",
  35716. viewBox: "0 0 24 24",
  35717. version: "1.1"
  35718. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35719. d: "M8.9,16.1L9,14L8.9,9.5c0-0.1,0-0.1-0.1-0.1c0,0-0.1-0.1-0.1-0.1c-0.1,0-0.1,0-0.1,0.1c0,0-0.1,0.1-0.1,0.1L8.3,14l0.1,2.1 c0,0.1,0,0.1,0.1,0.1c0,0,0.1,0.1,0.1,0.1C8.8,16.3,8.9,16.3,8.9,16.1z M11.4,15.9l0.1-1.8L11.4,9c0-0.1,0-0.2-0.1-0.2 c0,0-0.1,0-0.1,0s-0.1,0-0.1,0c-0.1,0-0.1,0.1-0.1,0.2l0,0.1l-0.1,5c0,0,0,0.7,0.1,2v0c0,0.1,0,0.1,0.1,0.1c0.1,0.1,0.1,0.1,0.2,0.1 c0.1,0,0.1,0,0.2-0.1c0.1,0,0.1-0.1,0.1-0.2L11.4,15.9z M2.4,12.9L2.5,14l-0.2,1.1c0,0.1,0,0.1-0.1,0.1c0,0-0.1,0-0.1-0.1L2.1,14 l0.1-1.1C2.2,12.9,2.3,12.9,2.4,12.9C2.3,12.9,2.4,12.9,2.4,12.9z M3.1,12.2L3.3,14l-0.2,1.8c0,0.1,0,0.1-0.1,0.1 c-0.1,0-0.1,0-0.1-0.1L2.8,14L3,12.2C3,12.2,3,12.2,3.1,12.2C3.1,12.2,3.1,12.2,3.1,12.2z M3.9,11.9L4.1,14l-0.2,2.1 c0,0.1,0,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L3.5,14l0.2-2.1c0-0.1,0-0.1,0.1-0.1C3.9,11.8,3.9,11.8,3.9,11.9z M4.7,11.9L4.9,14 l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L4.3,14l0.2-2.2c0-0.1,0-0.1,0.1-0.1C4.7,11.7,4.7,11.8,4.7,11.9z M5.6,12 l0.2,2l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c0,0-0.1,0-0.1,0c0,0,0-0.1,0-0.1L5.1,14l0.2-2c0,0,0-0.1,0-0.1s0.1,0,0.1,0 C5.5,11.9,5.5,11.9,5.6,12L5.6,12z M6.4,10.7L6.6,14l-0.2,2.1c0,0,0,0.1,0,0.1c0,0-0.1,0-0.1,0c-0.1,0-0.1-0.1-0.2-0.2L5.9,14 l0.2-3.3c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0C6.4,10.7,6.4,10.7,6.4,10.7z M7.2,10l0.2,4.1l-0.2,2.1c0,0,0,0.1,0,0.1 c0,0-0.1,0-0.1,0c-0.1,0-0.2-0.1-0.2-0.2l-0.1-2.1L6.8,10c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0S7.2,9.9,7.2,10z M8,9.6L8.2,14 L8,16.1c0,0.1-0.1,0.2-0.2,0.2c-0.1,0-0.2-0.1-0.2-0.2L7.5,14l0.1-4.4c0-0.1,0-0.1,0.1-0.1c0,0,0.1-0.1,0.1-0.1c0.1,0,0.1,0,0.1,0.1 C8,9.6,8,9.6,8,9.6z M11.4,16.1L11.4,16.1L11.4,16.1z M9.7,9.6L9.8,14l-0.1,2.1c0,0.1,0,0.1-0.1,0.2s-0.1,0.1-0.2,0.1 c-0.1,0-0.1,0-0.1-0.1s-0.1-0.1-0.1-0.2L9.2,14l0.1-4.4c0-0.1,0-0.1,0.1-0.2s0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S9.7,9.5,9.7,9.6 L9.7,9.6z M10.6,9.8l0.1,4.3l-0.1,2c0,0.1,0,0.1-0.1,0.2c0,0-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c0,0-0.1-0.1-0.1-0.2L10,14 l0.1-4.3c0-0.1,0-0.1,0.1-0.2c0,0,0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S10.6,9.7,10.6,9.8z M12.4,14l-0.1,2c0,0.1,0,0.1-0.1,0.2 c-0.1,0.1-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2l-0.1-1l-0.1-1l0.1-5.5v0c0-0.1,0-0.2,0.1-0.2 c0.1,0,0.1-0.1,0.2-0.1c0,0,0.1,0,0.1,0c0.1,0,0.1,0.1,0.1,0.2L12.4,14z M22.1,13.9c0,0.7-0.2,1.3-0.7,1.7c-0.5,0.5-1.1,0.7-1.7,0.7 h-6.8c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2V8.2c0-0.1,0.1-0.2,0.2-0.3c0.5-0.2,1-0.3,1.6-0.3c1.1,0,2.1,0.4,2.9,1.1 c0.8,0.8,1.3,1.7,1.4,2.8c0.3-0.1,0.6-0.2,1-0.2c0.7,0,1.3,0.2,1.7,0.7C21.8,12.6,22.1,13.2,22.1,13.9L22.1,13.9z"
  35720. }));
  35721. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/spotify.js
  35722. /**
  35723. * WordPress dependencies
  35724. */
  35725. const SpotifyIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35726. width: "24",
  35727. height: "24",
  35728. viewBox: "0 0 24 24",
  35729. version: "1.1"
  35730. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35731. d: "M12,2C6.477,2,2,6.477,2,12c0,5.523,4.477,10,10,10c5.523,0,10-4.477,10-10C22,6.477,17.523,2,12,2 M16.586,16.424 c-0.18,0.295-0.563,0.387-0.857,0.207c-2.348-1.435-5.304-1.76-8.785-0.964c-0.335,0.077-0.67-0.133-0.746-0.469 c-0.077-0.335,0.132-0.67,0.469-0.746c3.809-0.871,7.077-0.496,9.713,1.115C16.673,15.746,16.766,16.13,16.586,16.424 M17.81,13.7 c-0.226,0.367-0.706,0.482-1.072,0.257c-2.687-1.652-6.785-2.131-9.965-1.166C6.36,12.917,5.925,12.684,5.8,12.273 C5.675,11.86,5.908,11.425,6.32,11.3c3.632-1.102,8.147-0.568,11.234,1.328C17.92,12.854,18.035,13.335,17.81,13.7 M17.915,10.865 c-3.223-1.914-8.54-2.09-11.618-1.156C5.804,9.859,5.281,9.58,5.131,9.086C4.982,8.591,5.26,8.069,5.755,7.919 c3.532-1.072,9.404-0.865,13.115,1.338c0.445,0.264,0.59,0.838,0.327,1.282C18.933,10.983,18.359,11.129,17.915,10.865"
  35732. }));
  35733. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/telegram.js
  35734. /**
  35735. * WordPress dependencies
  35736. */
  35737. const TelegramIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35738. width: "24",
  35739. height: "24",
  35740. viewBox: "0 0 128 128",
  35741. version: "1.1"
  35742. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35743. d: "M28.9700376,63.3244248 C47.6273373,55.1957357 60.0684594,49.8368063 66.2934036,47.2476366 C84.0668845,39.855031 87.7600616,38.5708563 90.1672227,38.528 C90.6966555,38.5191258 91.8804274,38.6503351 92.6472251,39.2725385 C93.294694,39.7979149 93.4728387,40.5076237 93.5580865,41.0057381 C93.6433345,41.5038525 93.7494885,42.63857 93.6651041,43.5252052 C92.7019529,53.6451182 88.5344133,78.2034783 86.4142057,89.5379542 C85.5170662,94.3339958 83.750571,95.9420841 82.0403991,96.0994568 C78.3237996,96.4414641 75.5015827,93.6432685 71.9018743,91.2836143 C66.2690414,87.5912212 63.0868492,85.2926952 57.6192095,81.6896017 C51.3004058,77.5256038 55.3966232,75.2369981 58.9976911,71.4967761 C59.9401076,70.5179421 76.3155302,55.6232293 76.6324771,54.2720454 C76.6721165,54.1030573 76.7089039,53.4731496 76.3346867,53.1405352 C75.9604695,52.8079208 75.4081573,52.921662 75.0095933,53.0121213 C74.444641,53.1403447 65.4461175,59.0880351 48.0140228,70.8551922 C45.4598218,72.6091037 43.1463059,73.4636682 41.0734751,73.4188859 C38.7883453,73.3695169 34.3926725,72.1268388 31.1249416,71.0646282 C27.1169366,69.7617838 23.931454,69.0729605 24.208838,66.8603276 C24.3533167,65.7078514 25.9403832,64.5292172 28.9700376,63.3244248 Z"
  35744. }));
  35745. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/tiktok.js
  35746. /**
  35747. * WordPress dependencies
  35748. */
  35749. const TiktokIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35750. width: "24",
  35751. height: "24",
  35752. viewBox: "0 0 32 32",
  35753. version: "1.1"
  35754. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35755. d: "M16.708 0.027c1.745-0.027 3.48-0.011 5.213-0.027 0.105 2.041 0.839 4.12 2.333 5.563 1.491 1.479 3.6 2.156 5.652 2.385v5.369c-1.923-0.063-3.855-0.463-5.6-1.291-0.76-0.344-1.468-0.787-2.161-1.24-0.009 3.896 0.016 7.787-0.025 11.667-0.104 1.864-0.719 3.719-1.803 5.255-1.744 2.557-4.771 4.224-7.88 4.276-1.907 0.109-3.812-0.411-5.437-1.369-2.693-1.588-4.588-4.495-4.864-7.615-0.032-0.667-0.043-1.333-0.016-1.984 0.24-2.537 1.495-4.964 3.443-6.615 2.208-1.923 5.301-2.839 8.197-2.297 0.027 1.975-0.052 3.948-0.052 5.923-1.323-0.428-2.869-0.308-4.025 0.495-0.844 0.547-1.485 1.385-1.819 2.333-0.276 0.676-0.197 1.427-0.181 2.145 0.317 2.188 2.421 4.027 4.667 3.828 1.489-0.016 2.916-0.88 3.692-2.145 0.251-0.443 0.532-0.896 0.547-1.417 0.131-2.385 0.079-4.76 0.095-7.145 0.011-5.375-0.016-10.735 0.025-16.093z"
  35756. }));
  35757. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/tumblr.js
  35758. /**
  35759. * WordPress dependencies
  35760. */
  35761. const TumblrIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35762. width: "24",
  35763. height: "24",
  35764. viewBox: "0 0 24 24",
  35765. version: "1.1"
  35766. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35767. d: "M17.04 21.28h-3.28c-2.84 0-4.94-1.37-4.94-5.02v-5.67H6.08V7.5c2.93-.73 4.11-3.3 4.3-5.48h3.01v4.93h3.47v3.65H13.4v4.93c0 1.47.73 2.01 1.92 2.01h1.73v3.75z"
  35768. }));
  35769. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitch.js
  35770. /**
  35771. * WordPress dependencies
  35772. */
  35773. const TwitchIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35774. width: "24",
  35775. height: "24",
  35776. viewBox: "0 0 24 24",
  35777. version: "1.1"
  35778. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35779. d: "M16.499,8.089h-1.636v4.91h1.636V8.089z M12,8.089h-1.637v4.91H12V8.089z M4.228,3.178L3,6.451v13.092h4.499V22h2.456 l2.454-2.456h3.681L21,14.636V3.178H4.228z M19.364,13.816l-2.864,2.865H12l-2.453,2.453V16.68H5.863V4.814h13.501V13.816z"
  35780. }));
  35781. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitter.js
  35782. /**
  35783. * WordPress dependencies
  35784. */
  35785. const TwitterIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35786. width: "24",
  35787. height: "24",
  35788. viewBox: "0 0 24 24",
  35789. version: "1.1"
  35790. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35791. d: "M22.23,5.924c-0.736,0.326-1.527,0.547-2.357,0.646c0.847-0.508,1.498-1.312,1.804-2.27 c-0.793,0.47-1.671,0.812-2.606,0.996C18.324,4.498,17.257,4,16.077,4c-2.266,0-4.103,1.837-4.103,4.103 c0,0.322,0.036,0.635,0.106,0.935C8.67,8.867,5.647,7.234,3.623,4.751C3.27,5.357,3.067,6.062,3.067,6.814 c0,1.424,0.724,2.679,1.825,3.415c-0.673-0.021-1.305-0.206-1.859-0.513c0,0.017,0,0.034,0,0.052c0,1.988,1.414,3.647,3.292,4.023 c-0.344,0.094-0.707,0.144-1.081,0.144c-0.264,0-0.521-0.026-0.772-0.074c0.522,1.63,2.038,2.816,3.833,2.85 c-1.404,1.1-3.174,1.756-5.096,1.756c-0.331,0-0.658-0.019-0.979-0.057c1.816,1.164,3.973,1.843,6.29,1.843 c7.547,0,11.675-6.252,11.675-11.675c0-0.178-0.004-0.355-0.012-0.531C20.985,7.47,21.68,6.747,22.23,5.924z"
  35792. }));
  35793. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/vimeo.js
  35794. /**
  35795. * WordPress dependencies
  35796. */
  35797. const VimeoIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35798. width: "24",
  35799. height: "24",
  35800. viewBox: "0 0 24 24",
  35801. version: "1.1"
  35802. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35803. d: "M22.396,7.164c-0.093,2.026-1.507,4.799-4.245,8.32C15.322,19.161,12.928,21,10.97,21c-1.214,0-2.24-1.119-3.079-3.359 c-0.56-2.053-1.119-4.106-1.68-6.159C5.588,9.243,4.921,8.122,4.206,8.122c-0.156,0-0.701,0.328-1.634,0.98L1.594,7.841 c1.027-0.902,2.04-1.805,3.037-2.708C6.001,3.95,7.03,3.327,7.715,3.264c1.619-0.156,2.616,0.951,2.99,3.321 c0.404,2.557,0.685,4.147,0.841,4.769c0.467,2.121,0.981,3.181,1.542,3.181c0.435,0,1.09-0.688,1.963-2.065 c0.871-1.376,1.338-2.422,1.401-3.142c0.125-1.187-0.343-1.782-1.401-1.782c-0.498,0-1.012,0.115-1.541,0.341 c1.023-3.35,2.977-4.977,5.862-4.884C21.511,3.066,22.52,4.453,22.396,7.164z"
  35804. }));
  35805. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/vk.js
  35806. /**
  35807. * WordPress dependencies
  35808. */
  35809. const VkIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35810. width: "24",
  35811. height: "24",
  35812. viewBox: "0 0 24 24",
  35813. version: "1.1"
  35814. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35815. d: "M22,7.1c0.2,0.4-0.4,1.5-1.6,3.1c-0.2,0.2-0.4,0.5-0.7,0.9c-0.5,0.7-0.9,1.1-0.9,1.4c-0.1,0.3-0.1,0.6,0.1,0.8 c0.1,0.1,0.4,0.4,0.8,0.9h0l0,0c1,0.9,1.6,1.7,2,2.3c0,0,0,0.1,0.1,0.1c0,0.1,0,0.1,0.1,0.3c0,0.1,0,0.2,0,0.4 c0,0.1-0.1,0.2-0.3,0.3c-0.1,0.1-0.4,0.1-0.6,0.1l-2.7,0c-0.2,0-0.4,0-0.6-0.1c-0.2-0.1-0.4-0.1-0.5-0.2l-0.2-0.1 c-0.2-0.1-0.5-0.4-0.7-0.7s-0.5-0.6-0.7-0.8c-0.2-0.2-0.4-0.4-0.6-0.6C14.8,15,14.6,15,14.4,15c0,0,0,0-0.1,0c0,0-0.1,0.1-0.2,0.2 c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.1-0.1,0.3-0.2,0.5c-0.1,0.2-0.1,0.5-0.1,0.8c0,0.1,0,0.2,0,0.3c0,0.1-0.1,0.2-0.1,0.2l0,0.1 c-0.1,0.1-0.3,0.2-0.6,0.2h-1.2c-0.5,0-1,0-1.5-0.2c-0.5-0.1-1-0.3-1.4-0.6s-0.7-0.5-1.1-0.7s-0.6-0.4-0.7-0.6l-0.3-0.3 c-0.1-0.1-0.2-0.2-0.3-0.3s-0.4-0.5-0.7-0.9s-0.7-1-1.1-1.6c-0.4-0.6-0.8-1.3-1.3-2.2C2.9,9.4,2.5,8.5,2.1,7.5C2,7.4,2,7.3,2,7.2 c0-0.1,0-0.1,0-0.2l0-0.1c0.1-0.1,0.3-0.2,0.6-0.2l2.9,0c0.1,0,0.2,0,0.2,0.1S5.9,6.9,5.9,7L6,7c0.1,0.1,0.2,0.2,0.3,0.3 C6.4,7.7,6.5,8,6.7,8.4C6.9,8.8,7,9,7.1,9.2l0.2,0.3c0.2,0.4,0.4,0.8,0.6,1.1c0.2,0.3,0.4,0.5,0.5,0.7s0.3,0.3,0.4,0.4 c0.1,0.1,0.3,0.1,0.4,0.1c0.1,0,0.2,0,0.3-0.1c0,0,0,0,0.1-0.1c0,0,0.1-0.1,0.1-0.2c0.1-0.1,0.1-0.3,0.1-0.5c0-0.2,0.1-0.5,0.1-0.8 c0-0.4,0-0.8,0-1.3c0-0.3,0-0.5-0.1-0.8c0-0.2-0.1-0.4-0.1-0.5L9.6,7.6C9.4,7.3,9.1,7.2,8.7,7.1C8.6,7.1,8.6,7,8.7,6.9 C8.9,6.7,9,6.6,9.1,6.5c0.4-0.2,1.2-0.3,2.5-0.3c0.6,0,1,0.1,1.4,0.1c0.1,0,0.3,0.1,0.3,0.1c0.1,0.1,0.2,0.1,0.2,0.3 c0,0.1,0.1,0.2,0.1,0.3s0,0.3,0,0.5c0,0.2,0,0.4,0,0.6c0,0.2,0,0.4,0,0.7c0,0.3,0,0.6,0,0.9c0,0.1,0,0.2,0,0.4c0,0.2,0,0.4,0,0.5 c0,0.1,0,0.3,0,0.4s0.1,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3c0.1,0,0.1,0,0.2,0c0.1,0,0.2,0,0.3-0.1c0.1-0.1,0.2-0.2,0.4-0.4 s0.3-0.4,0.5-0.7c0.2-0.3,0.5-0.7,0.7-1.1c0.4-0.7,0.8-1.5,1.1-2.3c0-0.1,0.1-0.1,0.1-0.2c0-0.1,0.1-0.1,0.1-0.1l0,0l0.1,0 c0,0,0,0,0.1,0s0.2,0,0.2,0l3,0c0.3,0,0.5,0,0.7,0S21.9,7,21.9,7L22,7.1z"
  35816. }));
  35817. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/yelp.js
  35818. /**
  35819. * WordPress dependencies
  35820. */
  35821. const YelpIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35822. width: "24",
  35823. height: "24",
  35824. viewBox: "0 0 24 24",
  35825. version: "1.1"
  35826. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35827. d: "M12.271,16.718v1.417q-.011,3.257-.067,3.4a.707.707,0,0,1-.569.446,4.637,4.637,0,0,1-2.024-.424A4.609,4.609,0,0,1,7.8,20.565a.844.844,0,0,1-.19-.4.692.692,0,0,1,.044-.29,3.181,3.181,0,0,1,.379-.524q.335-.412,2.019-2.409.011,0,.669-.781a.757.757,0,0,1,.44-.274.965.965,0,0,1,.552.039.945.945,0,0,1,.418.324.732.732,0,0,1,.139.468Zm-1.662-2.8a.783.783,0,0,1-.58.781l-1.339.435q-3.067.981-3.257.981a.711.711,0,0,1-.6-.4,2.636,2.636,0,0,1-.19-.836,9.134,9.134,0,0,1,.011-1.857,3.559,3.559,0,0,1,.335-1.389.659.659,0,0,1,.625-.357,22.629,22.629,0,0,1,2.253.859q.781.324,1.283.524l.937.379a.771.771,0,0,1,.4.34A.982.982,0,0,1,10.609,13.917Zm9.213,3.313a4.467,4.467,0,0,1-1.021,1.8,4.559,4.559,0,0,1-1.512,1.417.671.671,0,0,1-.7-.078q-.156-.112-2.052-3.2l-.524-.859a.761.761,0,0,1-.128-.513.957.957,0,0,1,.217-.513.774.774,0,0,1,.926-.29q.011.011,1.327.446,2.264.736,2.7.887a2.082,2.082,0,0,1,.524.229.673.673,0,0,1,.245.68Zm-7.5-7.049q.056,1.137-.6,1.361-.647.19-1.272-.792L6.237,4.08a.7.7,0,0,1,.212-.691,5.788,5.788,0,0,1,2.314-1,5.928,5.928,0,0,1,2.5-.352.681.681,0,0,1,.547.5q.034.2.245,3.407T12.327,10.181Zm7.384,1.2a.679.679,0,0,1-.29.658q-.167.112-3.67.959-.747.167-1.015.257l.011-.022a.769.769,0,0,1-.513-.044.914.914,0,0,1-.413-.357.786.786,0,0,1,0-.971q.011-.011.836-1.137,1.394-1.908,1.673-2.275a2.423,2.423,0,0,1,.379-.435A.7.7,0,0,1,17.435,8a4.482,4.482,0,0,1,1.372,1.489,4.81,4.81,0,0,1,.9,1.868v.034Z"
  35828. }));
  35829. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/youtube.js
  35830. /**
  35831. * WordPress dependencies
  35832. */
  35833. const YouTubeIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35834. width: "24",
  35835. height: "24",
  35836. viewBox: "0 0 24 24",
  35837. version: "1.1"
  35838. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35839. d: "M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"
  35840. }));
  35841. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/variations.js
  35842. /**
  35843. * Internal dependencies
  35844. */
  35845. const social_link_variations_variations = [{
  35846. isDefault: true,
  35847. name: 'wordpress',
  35848. attributes: {
  35849. service: 'wordpress'
  35850. },
  35851. title: 'WordPress',
  35852. icon: WordPressIcon
  35853. }, {
  35854. name: 'fivehundredpx',
  35855. attributes: {
  35856. service: 'fivehundredpx'
  35857. },
  35858. title: '500px',
  35859. icon: FivehundredpxIcon
  35860. }, {
  35861. name: 'amazon',
  35862. attributes: {
  35863. service: 'amazon'
  35864. },
  35865. title: 'Amazon',
  35866. icon: AmazonIcon
  35867. }, {
  35868. name: 'bandcamp',
  35869. attributes: {
  35870. service: 'bandcamp'
  35871. },
  35872. title: 'Bandcamp',
  35873. icon: BandcampIcon
  35874. }, {
  35875. name: 'behance',
  35876. attributes: {
  35877. service: 'behance'
  35878. },
  35879. title: 'Behance',
  35880. icon: BehanceIcon
  35881. }, {
  35882. name: 'chain',
  35883. attributes: {
  35884. service: 'chain'
  35885. },
  35886. title: 'Link',
  35887. icon: ChainIcon
  35888. }, {
  35889. name: 'codepen',
  35890. attributes: {
  35891. service: 'codepen'
  35892. },
  35893. title: 'CodePen',
  35894. icon: CodepenIcon
  35895. }, {
  35896. name: 'deviantart',
  35897. attributes: {
  35898. service: 'deviantart'
  35899. },
  35900. title: 'DeviantArt',
  35901. icon: DeviantArtIcon
  35902. }, {
  35903. name: 'dribbble',
  35904. attributes: {
  35905. service: 'dribbble'
  35906. },
  35907. title: 'Dribbble',
  35908. icon: DribbbleIcon
  35909. }, {
  35910. name: 'dropbox',
  35911. attributes: {
  35912. service: 'dropbox'
  35913. },
  35914. title: 'Dropbox',
  35915. icon: DropboxIcon
  35916. }, {
  35917. name: 'etsy',
  35918. attributes: {
  35919. service: 'etsy'
  35920. },
  35921. title: 'Etsy',
  35922. icon: EtsyIcon
  35923. }, {
  35924. name: 'facebook',
  35925. attributes: {
  35926. service: 'facebook'
  35927. },
  35928. title: 'Facebook',
  35929. icon: FacebookIcon
  35930. }, {
  35931. name: 'feed',
  35932. attributes: {
  35933. service: 'feed'
  35934. },
  35935. title: 'RSS Feed',
  35936. icon: FeedIcon
  35937. }, {
  35938. name: 'flickr',
  35939. attributes: {
  35940. service: 'flickr'
  35941. },
  35942. title: 'Flickr',
  35943. icon: FlickrIcon
  35944. }, {
  35945. name: 'foursquare',
  35946. attributes: {
  35947. service: 'foursquare'
  35948. },
  35949. title: 'Foursquare',
  35950. icon: FoursquareIcon
  35951. }, {
  35952. name: 'goodreads',
  35953. attributes: {
  35954. service: 'goodreads'
  35955. },
  35956. title: 'Goodreads',
  35957. icon: GoodreadsIcon
  35958. }, {
  35959. name: 'google',
  35960. attributes: {
  35961. service: 'google'
  35962. },
  35963. title: 'Google',
  35964. icon: GoogleIcon
  35965. }, {
  35966. name: 'github',
  35967. attributes: {
  35968. service: 'github'
  35969. },
  35970. title: 'GitHub',
  35971. icon: GitHubIcon
  35972. }, {
  35973. name: 'instagram',
  35974. attributes: {
  35975. service: 'instagram'
  35976. },
  35977. title: 'Instagram',
  35978. icon: InstagramIcon
  35979. }, {
  35980. name: 'lastfm',
  35981. attributes: {
  35982. service: 'lastfm'
  35983. },
  35984. title: 'Last.fm',
  35985. icon: LastfmIcon
  35986. }, {
  35987. name: 'linkedin',
  35988. attributes: {
  35989. service: 'linkedin'
  35990. },
  35991. title: 'LinkedIn',
  35992. icon: LinkedInIcon
  35993. }, {
  35994. name: 'mail',
  35995. attributes: {
  35996. service: 'mail'
  35997. },
  35998. title: 'Mail',
  35999. keywords: ['email', 'e-mail'],
  36000. icon: MailIcon
  36001. }, {
  36002. name: 'mastodon',
  36003. attributes: {
  36004. service: 'mastodon'
  36005. },
  36006. title: 'Mastodon',
  36007. icon: MastodonIcon
  36008. }, {
  36009. name: 'meetup',
  36010. attributes: {
  36011. service: 'meetup'
  36012. },
  36013. title: 'Meetup',
  36014. icon: MeetupIcon
  36015. }, {
  36016. name: 'medium',
  36017. attributes: {
  36018. service: 'medium'
  36019. },
  36020. title: 'Medium',
  36021. icon: MediumIcon
  36022. }, {
  36023. name: 'patreon',
  36024. attributes: {
  36025. service: 'patreon'
  36026. },
  36027. title: 'Patreon',
  36028. icon: PatreonIcon
  36029. }, {
  36030. name: 'pinterest',
  36031. attributes: {
  36032. service: 'pinterest'
  36033. },
  36034. title: 'Pinterest',
  36035. icon: PinterestIcon
  36036. }, {
  36037. name: 'pocket',
  36038. attributes: {
  36039. service: 'pocket'
  36040. },
  36041. title: 'Pocket',
  36042. icon: PocketIcon
  36043. }, {
  36044. name: 'reddit',
  36045. attributes: {
  36046. service: 'reddit'
  36047. },
  36048. title: 'Reddit',
  36049. icon: RedditIcon
  36050. }, {
  36051. name: 'skype',
  36052. attributes: {
  36053. service: 'skype'
  36054. },
  36055. title: 'Skype',
  36056. icon: SkypeIcon
  36057. }, {
  36058. name: 'snapchat',
  36059. attributes: {
  36060. service: 'snapchat'
  36061. },
  36062. title: 'Snapchat',
  36063. icon: SnapchatIcon
  36064. }, {
  36065. name: 'soundcloud',
  36066. attributes: {
  36067. service: 'soundcloud'
  36068. },
  36069. title: 'SoundCloud',
  36070. icon: SoundCloudIcon
  36071. }, {
  36072. name: 'spotify',
  36073. attributes: {
  36074. service: 'spotify'
  36075. },
  36076. title: 'Spotify',
  36077. icon: SpotifyIcon
  36078. }, {
  36079. name: 'telegram',
  36080. attributes: {
  36081. service: 'telegram'
  36082. },
  36083. title: 'Telegram',
  36084. icon: TelegramIcon
  36085. }, {
  36086. name: 'tiktok',
  36087. attributes: {
  36088. service: 'tiktok'
  36089. },
  36090. title: 'TikTok',
  36091. icon: TiktokIcon
  36092. }, {
  36093. name: 'tumblr',
  36094. attributes: {
  36095. service: 'tumblr'
  36096. },
  36097. title: 'Tumblr',
  36098. icon: TumblrIcon
  36099. }, {
  36100. name: 'twitch',
  36101. attributes: {
  36102. service: 'twitch'
  36103. },
  36104. title: 'Twitch',
  36105. icon: TwitchIcon
  36106. }, {
  36107. name: 'twitter',
  36108. attributes: {
  36109. service: 'twitter'
  36110. },
  36111. title: 'Twitter',
  36112. icon: TwitterIcon
  36113. }, {
  36114. name: 'vimeo',
  36115. attributes: {
  36116. service: 'vimeo'
  36117. },
  36118. title: 'Vimeo',
  36119. icon: VimeoIcon
  36120. }, {
  36121. name: 'vk',
  36122. attributes: {
  36123. service: 'vk'
  36124. },
  36125. title: 'VK',
  36126. icon: VkIcon
  36127. }, {
  36128. name: 'yelp',
  36129. attributes: {
  36130. service: 'yelp'
  36131. },
  36132. title: 'Yelp',
  36133. icon: YelpIcon
  36134. }, {
  36135. name: 'youtube',
  36136. attributes: {
  36137. service: 'youtube'
  36138. },
  36139. title: 'YouTube',
  36140. icon: YouTubeIcon
  36141. }];
  36142. /**
  36143. * Add `isActive` function to all `social link` variations, if not defined.
  36144. * `isActive` function is used to find a variation match from a created
  36145. * Block by providing its attributes.
  36146. */
  36147. social_link_variations_variations.forEach(variation => {
  36148. if (variation.isActive) return;
  36149. variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.service === variationAttributes.service;
  36150. });
  36151. /* harmony default export */ var social_link_variations = (social_link_variations_variations);
  36152. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/social-list.js
  36153. /**
  36154. * External dependencies
  36155. */
  36156. /**
  36157. * WordPress dependencies
  36158. */
  36159. /**
  36160. * Internal dependencies
  36161. */
  36162. /**
  36163. * Retrieves the social service's icon component.
  36164. *
  36165. * @param {string} name key for a social service (lowercase slug)
  36166. *
  36167. * @return {WPComponent} Icon component for social service.
  36168. */
  36169. const getIconBySite = name => {
  36170. const variation = (0,external_lodash_namespaceObject.find)(social_link_variations, {
  36171. name
  36172. });
  36173. return variation ? variation.icon : ChainIcon;
  36174. };
  36175. /**
  36176. * Retrieves the display name for the social service.
  36177. *
  36178. * @param {string} name key for a social service (lowercase slug)
  36179. *
  36180. * @return {string} Display name for social service
  36181. */
  36182. const getNameBySite = name => {
  36183. const variation = (0,external_lodash_namespaceObject.find)(social_link_variations, {
  36184. name
  36185. });
  36186. return variation ? variation.title : (0,external_wp_i18n_namespaceObject.__)('Social Icon');
  36187. };
  36188. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/edit.js
  36189. /**
  36190. * External dependencies
  36191. */
  36192. /**
  36193. * WordPress dependencies
  36194. */
  36195. /**
  36196. * Internal dependencies
  36197. */
  36198. const SocialLinkURLPopover = _ref => {
  36199. let {
  36200. url,
  36201. setAttributes,
  36202. setPopover,
  36203. anchorRef
  36204. } = _ref;
  36205. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.URLPopover, {
  36206. anchorRef: anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current,
  36207. onClose: () => setPopover(false)
  36208. }, (0,external_wp_element_namespaceObject.createElement)("form", {
  36209. className: "block-editor-url-popover__link-editor",
  36210. onSubmit: event => {
  36211. event.preventDefault();
  36212. setPopover(false);
  36213. }
  36214. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  36215. className: "block-editor-url-input"
  36216. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.URLInput, {
  36217. value: url,
  36218. onChange: nextURL => setAttributes({
  36219. url: nextURL
  36220. }),
  36221. placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter address'),
  36222. disableSuggestions: true
  36223. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  36224. icon: keyboard_return,
  36225. label: (0,external_wp_i18n_namespaceObject.__)('Apply'),
  36226. type: "submit"
  36227. })));
  36228. };
  36229. const SocialLinkEdit = _ref2 => {
  36230. let {
  36231. attributes,
  36232. context,
  36233. isSelected,
  36234. setAttributes
  36235. } = _ref2;
  36236. const {
  36237. url,
  36238. service,
  36239. label
  36240. } = attributes;
  36241. const {
  36242. showLabels,
  36243. iconColorValue,
  36244. iconBackgroundColorValue
  36245. } = context;
  36246. const [showURLPopover, setPopover] = (0,external_wp_element_namespaceObject.useState)(false);
  36247. const classes = classnames_default()('wp-social-link', 'wp-social-link-' + service, {
  36248. 'wp-social-link__is-incomplete': !url
  36249. });
  36250. const ref = (0,external_wp_element_namespaceObject.useRef)();
  36251. const IconComponent = getIconBySite(service);
  36252. const socialLinkName = getNameBySite(service);
  36253. const socialLinkLabel = label !== null && label !== void 0 ? label : socialLinkName;
  36254. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  36255. className: classes,
  36256. style: {
  36257. color: iconColorValue,
  36258. backgroundColor: iconBackgroundColorValue
  36259. }
  36260. });
  36261. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  36262. title: (0,external_wp_i18n_namespaceObject.sprintf)(
  36263. /* translators: %s: name of the social service. */
  36264. (0,external_wp_i18n_namespaceObject.__)('%s label'), socialLinkName),
  36265. initialOpen: false
  36266. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelRow, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  36267. label: (0,external_wp_i18n_namespaceObject.__)('Link label'),
  36268. help: (0,external_wp_i18n_namespaceObject.__)('Briefly describe the link to help screen reader users.'),
  36269. value: label,
  36270. onChange: value => setAttributes({
  36271. label: value
  36272. })
  36273. })))), (0,external_wp_element_namespaceObject.createElement)("li", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  36274. className: "wp-block-social-link-anchor",
  36275. ref: ref,
  36276. onClick: () => setPopover(true)
  36277. }, (0,external_wp_element_namespaceObject.createElement)(IconComponent, null), (0,external_wp_element_namespaceObject.createElement)("span", {
  36278. className: classnames_default()('wp-block-social-link-label', {
  36279. 'screen-reader-text': !showLabels
  36280. })
  36281. }, socialLinkLabel), isSelected && showURLPopover && (0,external_wp_element_namespaceObject.createElement)(SocialLinkURLPopover, {
  36282. url: url,
  36283. setAttributes: setAttributes,
  36284. setPopover: setPopover,
  36285. anchorRef: ref
  36286. }))));
  36287. };
  36288. /* harmony default export */ var social_link_edit = (SocialLinkEdit);
  36289. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/index.js
  36290. /**
  36291. * WordPress dependencies
  36292. */
  36293. /**
  36294. * Internal dependencies
  36295. */
  36296. const social_link_metadata = {
  36297. $schema: "https://schemas.wp.org/trunk/block.json",
  36298. apiVersion: 2,
  36299. name: "core/social-link",
  36300. title: "Social Icon",
  36301. category: "widgets",
  36302. parent: ["core/social-links"],
  36303. description: "Display an icon linking to a social media profile or site.",
  36304. textdomain: "default",
  36305. attributes: {
  36306. url: {
  36307. type: "string"
  36308. },
  36309. service: {
  36310. type: "string"
  36311. },
  36312. label: {
  36313. type: "string"
  36314. }
  36315. },
  36316. usesContext: ["openInNewTab", "showLabels", "iconColorValue", "iconBackgroundColorValue"],
  36317. supports: {
  36318. reusable: false,
  36319. html: false
  36320. },
  36321. editorStyle: "wp-block-social-link-editor"
  36322. };
  36323. const {
  36324. name: social_link_name
  36325. } = social_link_metadata;
  36326. const social_link_settings = {
  36327. icon: library_share,
  36328. edit: social_link_edit,
  36329. variations: social_link_variations
  36330. };
  36331. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/deprecated.js
  36332. /**
  36333. * External dependencies
  36334. */
  36335. /**
  36336. * WordPress dependencies
  36337. */
  36338. /**
  36339. * The specific handling by `className` below is needed because `itemsJustification`
  36340. * was introduced in https://github.com/WordPress/gutenberg/pull/28980/files and wasn't
  36341. * declared in block.json.
  36342. *
  36343. * @param {Object} attributes Block's attributes.
  36344. */
  36345. const social_links_deprecated_migrateWithLayout = attributes => {
  36346. var _className$match, _className$match$;
  36347. if (!!attributes.layout) {
  36348. return attributes;
  36349. }
  36350. const {
  36351. className
  36352. } = attributes; // Matches classes with `items-justified-` prefix.
  36353. const prefix = `items-justified-`;
  36354. const justifiedItemsRegex = new RegExp(`\\b${prefix}[^ ]*[ ]?\\b`, 'g');
  36355. const newAttributes = { ...attributes,
  36356. className: className === null || className === void 0 ? void 0 : className.replace(justifiedItemsRegex, '').trim()
  36357. };
  36358. /**
  36359. * Add `layout` prop only if `justifyContent` is defined, for backwards
  36360. * compatibility. In other cases the block's default layout will be used.
  36361. * Also noting that due to the missing attribute, it's possible for a block
  36362. * to have more than one of `justified` classes.
  36363. */
  36364. const justifyContent = className === null || className === void 0 ? void 0 : (_className$match = className.match(justifiedItemsRegex)) === null || _className$match === void 0 ? void 0 : (_className$match$ = _className$match[0]) === null || _className$match$ === void 0 ? void 0 : _className$match$.trim();
  36365. if (justifyContent) {
  36366. Object.assign(newAttributes, {
  36367. layout: {
  36368. type: 'flex',
  36369. justifyContent: justifyContent.slice(prefix.length)
  36370. }
  36371. });
  36372. }
  36373. return newAttributes;
  36374. }; // Social Links block deprecations.
  36375. const social_links_deprecated_deprecated = [// V1. Remove CSS variable use for colors.
  36376. {
  36377. attributes: {
  36378. iconColor: {
  36379. type: 'string'
  36380. },
  36381. customIconColor: {
  36382. type: 'string'
  36383. },
  36384. iconColorValue: {
  36385. type: 'string'
  36386. },
  36387. iconBackgroundColor: {
  36388. type: 'string'
  36389. },
  36390. customIconBackgroundColor: {
  36391. type: 'string'
  36392. },
  36393. iconBackgroundColorValue: {
  36394. type: 'string'
  36395. },
  36396. openInNewTab: {
  36397. type: 'boolean',
  36398. default: false
  36399. },
  36400. size: {
  36401. type: 'string'
  36402. }
  36403. },
  36404. providesContext: {
  36405. openInNewTab: 'openInNewTab'
  36406. },
  36407. supports: {
  36408. align: ['left', 'center', 'right'],
  36409. anchor: true
  36410. },
  36411. migrate: social_links_deprecated_migrateWithLayout,
  36412. save: props => {
  36413. const {
  36414. attributes: {
  36415. iconBackgroundColorValue,
  36416. iconColorValue,
  36417. itemsJustification,
  36418. size
  36419. }
  36420. } = props;
  36421. const className = classnames_default()(size, {
  36422. 'has-icon-color': iconColorValue,
  36423. 'has-icon-background-color': iconBackgroundColorValue,
  36424. [`items-justified-${itemsJustification}`]: itemsJustification
  36425. });
  36426. const style = {
  36427. '--wp--social-links--icon-color': iconColorValue,
  36428. '--wp--social-links--icon-background-color': iconBackgroundColorValue
  36429. };
  36430. return (0,external_wp_element_namespaceObject.createElement)("ul", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  36431. className,
  36432. style
  36433. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  36434. }
  36435. }];
  36436. /* harmony default export */ var social_links_deprecated = (social_links_deprecated_deprecated);
  36437. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js
  36438. /**
  36439. * WordPress dependencies
  36440. */
  36441. const check = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  36442. xmlns: "http://www.w3.org/2000/svg",
  36443. viewBox: "0 0 24 24"
  36444. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  36445. d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
  36446. }));
  36447. /* harmony default export */ var library_check = (check);
  36448. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/edit.js
  36449. /**
  36450. * External dependencies
  36451. */
  36452. /**
  36453. * WordPress dependencies
  36454. */
  36455. const social_links_edit_ALLOWED_BLOCKS = ['core/social-link'];
  36456. const sizeOptions = [{
  36457. name: (0,external_wp_i18n_namespaceObject.__)('Small'),
  36458. value: 'has-small-icon-size'
  36459. }, {
  36460. name: (0,external_wp_i18n_namespaceObject.__)('Normal'),
  36461. value: 'has-normal-icon-size'
  36462. }, {
  36463. name: (0,external_wp_i18n_namespaceObject.__)('Large'),
  36464. value: 'has-large-icon-size'
  36465. }, {
  36466. name: (0,external_wp_i18n_namespaceObject.__)('Huge'),
  36467. value: 'has-huge-icon-size'
  36468. }];
  36469. const social_links_edit_getDefaultBlockLayout = blockTypeOrName => {
  36470. const layoutBlockSupportConfig = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockTypeOrName, '__experimentalLayout');
  36471. return layoutBlockSupportConfig === null || layoutBlockSupportConfig === void 0 ? void 0 : layoutBlockSupportConfig.default;
  36472. };
  36473. function SocialLinksEdit(props) {
  36474. var _attributes$className;
  36475. const {
  36476. name,
  36477. attributes,
  36478. iconBackgroundColor,
  36479. iconColor,
  36480. isSelected,
  36481. setAttributes,
  36482. setIconBackgroundColor,
  36483. setIconColor
  36484. } = props;
  36485. const {
  36486. iconBackgroundColorValue,
  36487. customIconBackgroundColor,
  36488. iconColorValue,
  36489. openInNewTab,
  36490. showLabels,
  36491. size,
  36492. layout
  36493. } = attributes;
  36494. const usedLayout = layout || social_links_edit_getDefaultBlockLayout(name);
  36495. const logosOnly = (_attributes$className = attributes.className) === null || _attributes$className === void 0 ? void 0 : _attributes$className.includes('is-style-logos-only'); // Remove icon background color when logos only style is selected or
  36496. // restore it when any other style is selected.
  36497. const backgroundBackup = (0,external_wp_element_namespaceObject.useRef)({});
  36498. (0,external_wp_element_namespaceObject.useEffect)(() => {
  36499. if (logosOnly) {
  36500. backgroundBackup.current = {
  36501. iconBackgroundColor,
  36502. iconBackgroundColorValue,
  36503. customIconBackgroundColor
  36504. };
  36505. setAttributes({
  36506. iconBackgroundColor: undefined,
  36507. customIconBackgroundColor: undefined,
  36508. iconBackgroundColorValue: undefined
  36509. });
  36510. } else {
  36511. setAttributes({ ...backgroundBackup.current
  36512. });
  36513. }
  36514. }, [logosOnly]);
  36515. const SocialPlaceholder = (0,external_wp_element_namespaceObject.createElement)("li", {
  36516. className: "wp-block-social-links__social-placeholder"
  36517. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  36518. className: "wp-block-social-links__social-placeholder-icons"
  36519. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  36520. className: "wp-social-link wp-social-link-twitter"
  36521. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  36522. className: "wp-social-link wp-social-link-facebook"
  36523. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  36524. className: "wp-social-link wp-social-link-instagram"
  36525. })));
  36526. const SelectedSocialPlaceholder = (0,external_wp_element_namespaceObject.createElement)("li", {
  36527. className: "wp-block-social-links__social-prompt"
  36528. }, (0,external_wp_i18n_namespaceObject.__)('Click plus to add')); // Fallback color values are used maintain selections in case switching
  36529. // themes and named colors in palette do not match.
  36530. const className = classnames_default()(size, {
  36531. 'has-icon-color': iconColor.color || iconColorValue,
  36532. 'has-icon-background-color': iconBackgroundColor.color || iconBackgroundColorValue
  36533. });
  36534. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  36535. className
  36536. });
  36537. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  36538. allowedBlocks: social_links_edit_ALLOWED_BLOCKS,
  36539. placeholder: isSelected ? SelectedSocialPlaceholder : SocialPlaceholder,
  36540. templateLock: false,
  36541. __experimentalAppenderTagName: 'li',
  36542. __experimentalLayout: usedLayout
  36543. });
  36544. const POPOVER_PROPS = {
  36545. position: 'bottom right'
  36546. };
  36547. const colorSettings = [{
  36548. // Use custom attribute as fallback to prevent loss of named color selection when
  36549. // switching themes to a new theme that does not have a matching named color.
  36550. value: iconColor.color || iconColorValue,
  36551. onChange: colorValue => {
  36552. setIconColor(colorValue);
  36553. setAttributes({
  36554. iconColorValue: colorValue
  36555. });
  36556. },
  36557. label: (0,external_wp_i18n_namespaceObject.__)('Icon color')
  36558. }];
  36559. if (!logosOnly) {
  36560. colorSettings.push({
  36561. // Use custom attribute as fallback to prevent loss of named color selection when
  36562. // switching themes to a new theme that does not have a matching named color.
  36563. value: iconBackgroundColor.color || iconBackgroundColorValue,
  36564. onChange: colorValue => {
  36565. setIconBackgroundColor(colorValue);
  36566. setAttributes({
  36567. iconBackgroundColorValue: colorValue
  36568. });
  36569. },
  36570. label: (0,external_wp_i18n_namespaceObject.__)('Icon background')
  36571. });
  36572. }
  36573. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  36574. group: "other"
  36575. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
  36576. label: (0,external_wp_i18n_namespaceObject.__)('Size'),
  36577. text: (0,external_wp_i18n_namespaceObject.__)('Size'),
  36578. icon: null,
  36579. popoverProps: POPOVER_PROPS
  36580. }, _ref => {
  36581. let {
  36582. onClose
  36583. } = _ref;
  36584. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, sizeOptions.map(entry => {
  36585. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  36586. icon: (size === entry.value || !size && entry.value === 'has-normal-icon-size') && library_check,
  36587. isSelected: size === entry.value,
  36588. key: entry.value,
  36589. onClick: () => {
  36590. setAttributes({
  36591. size: entry.value
  36592. });
  36593. },
  36594. onClose: onClose,
  36595. role: "menuitemradio"
  36596. }, entry.name);
  36597. }));
  36598. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  36599. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  36600. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  36601. label: (0,external_wp_i18n_namespaceObject.__)('Open links in new tab'),
  36602. checked: openInNewTab,
  36603. onChange: () => setAttributes({
  36604. openInNewTab: !openInNewTab
  36605. })
  36606. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  36607. label: (0,external_wp_i18n_namespaceObject.__)('Show labels'),
  36608. checked: showLabels,
  36609. onChange: () => setAttributes({
  36610. showLabels: !showLabels
  36611. })
  36612. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PanelColorSettings, {
  36613. __experimentalHasMultipleOrigins: true,
  36614. __experimentalIsRenderedInSidebar: true,
  36615. title: (0,external_wp_i18n_namespaceObject.__)('Color'),
  36616. colorSettings: colorSettings
  36617. }), !logosOnly && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ContrastChecker, {
  36618. textColor: iconColorValue,
  36619. backgroundColor: iconBackgroundColorValue,
  36620. isLargeText: false
  36621. })), (0,external_wp_element_namespaceObject.createElement)("ul", innerBlocksProps));
  36622. }
  36623. const iconColorAttributes = {
  36624. iconColor: 'icon-color',
  36625. iconBackgroundColor: 'icon-background-color'
  36626. };
  36627. /* harmony default export */ var social_links_edit = ((0,external_wp_blockEditor_namespaceObject.withColors)(iconColorAttributes)(SocialLinksEdit));
  36628. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/save.js
  36629. /**
  36630. * External dependencies
  36631. */
  36632. /**
  36633. * WordPress dependencies
  36634. */
  36635. function social_links_save_save(props) {
  36636. const {
  36637. attributes: {
  36638. iconBackgroundColorValue,
  36639. iconColorValue,
  36640. showLabels,
  36641. size
  36642. }
  36643. } = props;
  36644. const className = classnames_default()(size, {
  36645. 'has-visible-labels': showLabels,
  36646. 'has-icon-color': iconColorValue,
  36647. 'has-icon-background-color': iconBackgroundColorValue
  36648. });
  36649. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
  36650. className
  36651. });
  36652. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  36653. return (0,external_wp_element_namespaceObject.createElement)("ul", innerBlocksProps);
  36654. }
  36655. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/index.js
  36656. /**
  36657. * WordPress dependencies
  36658. */
  36659. /**
  36660. * Internal dependencies
  36661. */
  36662. const social_links_metadata = {
  36663. $schema: "https://schemas.wp.org/trunk/block.json",
  36664. apiVersion: 2,
  36665. name: "core/social-links",
  36666. title: "Social Icons",
  36667. category: "widgets",
  36668. description: "Display icons linking to your social media profiles or sites.",
  36669. keywords: ["links"],
  36670. textdomain: "default",
  36671. attributes: {
  36672. iconColor: {
  36673. type: "string"
  36674. },
  36675. customIconColor: {
  36676. type: "string"
  36677. },
  36678. iconColorValue: {
  36679. type: "string"
  36680. },
  36681. iconBackgroundColor: {
  36682. type: "string"
  36683. },
  36684. customIconBackgroundColor: {
  36685. type: "string"
  36686. },
  36687. iconBackgroundColorValue: {
  36688. type: "string"
  36689. },
  36690. openInNewTab: {
  36691. type: "boolean",
  36692. "default": false
  36693. },
  36694. showLabels: {
  36695. type: "boolean",
  36696. "default": false
  36697. },
  36698. size: {
  36699. type: "string"
  36700. }
  36701. },
  36702. providesContext: {
  36703. openInNewTab: "openInNewTab",
  36704. showLabels: "showLabels",
  36705. iconColorValue: "iconColorValue",
  36706. iconBackgroundColorValue: "iconBackgroundColorValue"
  36707. },
  36708. supports: {
  36709. align: ["left", "center", "right"],
  36710. anchor: true,
  36711. __experimentalExposeControlsToChildren: true,
  36712. __experimentalLayout: {
  36713. allowSwitching: false,
  36714. allowInheriting: false,
  36715. allowVerticalAlignment: false,
  36716. "default": {
  36717. type: "flex"
  36718. }
  36719. },
  36720. spacing: {
  36721. blockGap: ["horizontal", "vertical"],
  36722. margin: ["top", "bottom"],
  36723. units: ["px", "em", "rem", "vh", "vw"],
  36724. __experimentalDefaultControls: {
  36725. blockGap: true
  36726. }
  36727. }
  36728. },
  36729. styles: [{
  36730. name: "default",
  36731. label: "Default",
  36732. isDefault: true
  36733. }, {
  36734. name: "logos-only",
  36735. label: "Logos Only"
  36736. }, {
  36737. name: "pill-shape",
  36738. label: "Pill Shape"
  36739. }],
  36740. editorStyle: "wp-block-social-links-editor",
  36741. style: "wp-block-social-links"
  36742. };
  36743. const {
  36744. name: social_links_name
  36745. } = social_links_metadata;
  36746. const social_links_settings = {
  36747. example: {
  36748. innerBlocks: [{
  36749. name: 'core/social-link',
  36750. attributes: {
  36751. service: 'wordpress',
  36752. url: 'https://wordpress.org'
  36753. }
  36754. }, {
  36755. name: 'core/social-link',
  36756. attributes: {
  36757. service: 'facebook',
  36758. url: 'https://www.facebook.com/WordPress/'
  36759. }
  36760. }, {
  36761. name: 'core/social-link',
  36762. attributes: {
  36763. service: 'twitter',
  36764. url: 'https://twitter.com/WordPress'
  36765. }
  36766. }]
  36767. },
  36768. icon: library_share,
  36769. edit: social_links_edit,
  36770. save: social_links_save_save,
  36771. deprecated: social_links_deprecated
  36772. };
  36773. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/resize-corner-n-e.js
  36774. /**
  36775. * WordPress dependencies
  36776. */
  36777. const resizeCornerNE = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  36778. viewBox: "0 0 24 24",
  36779. xmlns: "http://www.w3.org/2000/svg"
  36780. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  36781. d: "M12.5 4.2v1.6h4.7L5.8 17.2V12H4.2v7.8H12v-1.6H6.8L18.2 6.8v4.7h1.6V4.2z"
  36782. }));
  36783. /* harmony default export */ var resize_corner_n_e = (resizeCornerNE);
  36784. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/deprecated.js
  36785. /**
  36786. * WordPress dependencies
  36787. */
  36788. const spacer_deprecated_deprecated = [{
  36789. attributes: {
  36790. height: {
  36791. type: 'number',
  36792. default: 100
  36793. },
  36794. width: {
  36795. type: 'number'
  36796. }
  36797. },
  36798. migrate(attributes) {
  36799. const {
  36800. height,
  36801. width
  36802. } = attributes;
  36803. return { ...attributes,
  36804. width: width !== undefined ? `${width}px` : undefined,
  36805. height: height !== undefined ? `${height}px` : undefined
  36806. };
  36807. },
  36808. save(_ref) {
  36809. let {
  36810. attributes
  36811. } = _ref;
  36812. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  36813. style: {
  36814. height: attributes.height,
  36815. width: attributes.width
  36816. },
  36817. 'aria-hidden': true
  36818. }));
  36819. }
  36820. }];
  36821. /* harmony default export */ var spacer_deprecated = (spacer_deprecated_deprecated);
  36822. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/controls.js
  36823. /**
  36824. * WordPress dependencies
  36825. */
  36826. /**
  36827. * Internal dependencies
  36828. */
  36829. function DimensionInput(_ref) {
  36830. var _ref2;
  36831. let {
  36832. label,
  36833. onChange,
  36834. isResizing,
  36835. value = ''
  36836. } = _ref;
  36837. const inputId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl, 'block-spacer-height-input'); // In most contexts the spacer size cannot meaningfully be set to a
  36838. // percentage, since this is relative to the parent container. This
  36839. // unit is disabled from the UI.
  36840. const availableUnitSettings = (_ref2 = (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || undefined) === null || _ref2 === void 0 ? void 0 : _ref2.filter(availableUnit => availableUnit !== '%');
  36841. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  36842. availableUnits: availableUnitSettings || ['px', 'em', 'rem', 'vw', 'vh'],
  36843. defaultValues: {
  36844. px: 100,
  36845. em: 10,
  36846. rem: 10,
  36847. vw: 10,
  36848. vh: 25
  36849. }
  36850. });
  36851. const handleOnChange = unprocessedValue => {
  36852. onChange(unprocessedValue);
  36853. }; // Force the unit to update to `px` when the Spacer is being resized.
  36854. const [parsedQuantity, parsedUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
  36855. const computedValue = [parsedQuantity, isResizing ? 'px' : parsedUnit].join('');
  36856. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  36857. label: label,
  36858. id: inputId
  36859. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  36860. id: inputId,
  36861. isResetValueOnUnitChange: true,
  36862. min: MIN_SPACER_SIZE,
  36863. onChange: handleOnChange,
  36864. style: {
  36865. maxWidth: 80
  36866. },
  36867. value: computedValue,
  36868. units: units
  36869. }));
  36870. }
  36871. function SpacerControls(_ref3) {
  36872. let {
  36873. setAttributes,
  36874. orientation,
  36875. height,
  36876. width,
  36877. isResizing
  36878. } = _ref3;
  36879. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  36880. title: (0,external_wp_i18n_namespaceObject.__)('Spacer settings')
  36881. }, orientation === 'horizontal' && (0,external_wp_element_namespaceObject.createElement)(DimensionInput, {
  36882. label: (0,external_wp_i18n_namespaceObject.__)('Width'),
  36883. value: width,
  36884. onChange: nextWidth => setAttributes({
  36885. width: nextWidth
  36886. }),
  36887. isResizing: isResizing
  36888. }), orientation !== 'horizontal' && (0,external_wp_element_namespaceObject.createElement)(DimensionInput, {
  36889. label: (0,external_wp_i18n_namespaceObject.__)('Height'),
  36890. value: height,
  36891. onChange: nextHeight => setAttributes({
  36892. height: nextHeight
  36893. }),
  36894. isResizing: isResizing
  36895. })));
  36896. }
  36897. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/edit.js
  36898. /**
  36899. * External dependencies
  36900. */
  36901. /**
  36902. * WordPress dependencies
  36903. */
  36904. /**
  36905. * Internal dependencies
  36906. */
  36907. const MIN_SPACER_SIZE = 0;
  36908. const ResizableSpacer = _ref => {
  36909. let {
  36910. orientation,
  36911. onResizeStart,
  36912. onResize,
  36913. onResizeStop,
  36914. isSelected,
  36915. isResizing,
  36916. setIsResizing,
  36917. ...props
  36918. } = _ref;
  36919. const getCurrentSize = elt => {
  36920. return orientation === 'horizontal' ? elt.clientWidth : elt.clientHeight;
  36921. };
  36922. const getNextVal = elt => {
  36923. return `${getCurrentSize(elt)}px`;
  36924. };
  36925. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, _extends({
  36926. className: classnames_default()('block-library-spacer__resize-container', {
  36927. 'resize-horizontal': orientation === 'horizontal',
  36928. 'is-resizing': isResizing,
  36929. 'is-selected': isSelected
  36930. }),
  36931. onResizeStart: (_event, _direction, elt) => {
  36932. const nextVal = getNextVal(elt);
  36933. onResizeStart(nextVal);
  36934. onResize(nextVal);
  36935. },
  36936. onResize: (_event, _direction, elt) => {
  36937. onResize(getNextVal(elt));
  36938. if (!isResizing) {
  36939. setIsResizing(true);
  36940. }
  36941. },
  36942. onResizeStop: (_event, _direction, elt) => {
  36943. const nextVal = getCurrentSize(elt);
  36944. onResizeStop(`${nextVal}px`);
  36945. setIsResizing(false);
  36946. },
  36947. __experimentalShowTooltip: true,
  36948. __experimentalTooltipProps: {
  36949. axis: orientation === 'horizontal' ? 'x' : 'y',
  36950. position: 'corner',
  36951. isVisible: isResizing
  36952. },
  36953. showHandle: isSelected
  36954. }, props));
  36955. };
  36956. const SpacerEdit = _ref2 => {
  36957. let {
  36958. attributes,
  36959. isSelected,
  36960. setAttributes,
  36961. toggleSelection,
  36962. context
  36963. } = _ref2;
  36964. const {
  36965. orientation
  36966. } = context;
  36967. const {
  36968. height,
  36969. width
  36970. } = attributes;
  36971. const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false);
  36972. const [temporaryHeight, setTemporaryHeight] = (0,external_wp_element_namespaceObject.useState)(null);
  36973. const [temporaryWidth, setTemporaryWidth] = (0,external_wp_element_namespaceObject.useState)(null);
  36974. const onResizeStart = () => toggleSelection(false);
  36975. const onResizeStop = () => toggleSelection(true);
  36976. const handleOnVerticalResizeStop = newHeight => {
  36977. onResizeStop();
  36978. setAttributes({
  36979. height: newHeight
  36980. });
  36981. setTemporaryHeight(null);
  36982. };
  36983. const handleOnHorizontalResizeStop = newWidth => {
  36984. onResizeStop();
  36985. setAttributes({
  36986. width: newWidth
  36987. });
  36988. setTemporaryWidth(null);
  36989. };
  36990. const style = {
  36991. height: orientation === 'horizontal' ? 24 : temporaryHeight || height || undefined,
  36992. width: orientation === 'horizontal' ? temporaryWidth || width || undefined : undefined
  36993. };
  36994. const resizableBoxWithOrientation = blockOrientation => {
  36995. if (blockOrientation === 'horizontal') {
  36996. return (0,external_wp_element_namespaceObject.createElement)(ResizableSpacer, {
  36997. minWidth: MIN_SPACER_SIZE,
  36998. enable: {
  36999. top: false,
  37000. right: true,
  37001. bottom: false,
  37002. left: false,
  37003. topRight: false,
  37004. bottomRight: false,
  37005. bottomLeft: false,
  37006. topLeft: false
  37007. },
  37008. orientation: blockOrientation,
  37009. onResizeStart: onResizeStart,
  37010. onResize: setTemporaryWidth,
  37011. onResizeStop: handleOnHorizontalResizeStop,
  37012. isSelected: isSelected,
  37013. isResizing: isResizing,
  37014. setIsResizing: setIsResizing
  37015. });
  37016. }
  37017. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(ResizableSpacer, {
  37018. minHeight: MIN_SPACER_SIZE,
  37019. enable: {
  37020. top: false,
  37021. right: false,
  37022. bottom: true,
  37023. left: false,
  37024. topRight: false,
  37025. bottomRight: false,
  37026. bottomLeft: false,
  37027. topLeft: false
  37028. },
  37029. orientation: blockOrientation,
  37030. onResizeStart: onResizeStart,
  37031. onResize: setTemporaryHeight,
  37032. onResizeStop: handleOnVerticalResizeStop,
  37033. isSelected: isSelected,
  37034. isResizing: isResizing,
  37035. setIsResizing: setIsResizing
  37036. }));
  37037. };
  37038. (0,external_wp_element_namespaceObject.useEffect)(() => {
  37039. if (orientation === 'horizontal' && !width) {
  37040. setAttributes({
  37041. height: '0px',
  37042. width: '72px'
  37043. });
  37044. }
  37045. }, []);
  37046. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  37047. style
  37048. }), resizableBoxWithOrientation(orientation)), (0,external_wp_element_namespaceObject.createElement)(SpacerControls, {
  37049. setAttributes: setAttributes,
  37050. height: temporaryHeight || height,
  37051. width: temporaryWidth || width,
  37052. orientation: orientation,
  37053. isResizing: isResizing
  37054. }));
  37055. };
  37056. /* harmony default export */ var spacer_edit = (SpacerEdit);
  37057. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/save.js
  37058. /**
  37059. * WordPress dependencies
  37060. */
  37061. function spacer_save_save(_ref) {
  37062. let {
  37063. attributes: {
  37064. height,
  37065. width
  37066. }
  37067. } = _ref;
  37068. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  37069. style: {
  37070. height,
  37071. width
  37072. },
  37073. 'aria-hidden': true
  37074. }));
  37075. }
  37076. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/index.js
  37077. /**
  37078. * WordPress dependencies
  37079. */
  37080. /**
  37081. * Internal dependencies
  37082. */
  37083. const spacer_metadata = {
  37084. $schema: "https://schemas.wp.org/trunk/block.json",
  37085. apiVersion: 2,
  37086. name: "core/spacer",
  37087. title: "Spacer",
  37088. category: "design",
  37089. description: "Add white space between blocks and customize its height.",
  37090. textdomain: "default",
  37091. attributes: {
  37092. height: {
  37093. type: "string",
  37094. "default": "100px"
  37095. },
  37096. width: {
  37097. type: "string"
  37098. }
  37099. },
  37100. usesContext: ["orientation"],
  37101. supports: {
  37102. anchor: true
  37103. },
  37104. editorStyle: "wp-block-spacer-editor",
  37105. style: "wp-block-spacer"
  37106. };
  37107. const {
  37108. name: spacer_name
  37109. } = spacer_metadata;
  37110. const spacer_settings = {
  37111. icon: resize_corner_n_e,
  37112. edit: spacer_edit,
  37113. save: spacer_save_save,
  37114. deprecated: spacer_deprecated
  37115. };
  37116. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-table.js
  37117. /**
  37118. * WordPress dependencies
  37119. */
  37120. const blockTable = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37121. viewBox: "0 0 24 24",
  37122. xmlns: "http://www.w3.org/2000/svg"
  37123. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37124. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z"
  37125. }));
  37126. /* harmony default export */ var block_table = (blockTable);
  37127. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/deprecated.js
  37128. /**
  37129. * External dependencies
  37130. */
  37131. /**
  37132. * WordPress dependencies
  37133. */
  37134. const table_deprecated_supports = {
  37135. align: true
  37136. }; // As the previous arbitrary colors won't match theme color palettes, the hex
  37137. // value will be mapped to the style.color.background attribute as if it was
  37138. // a custom color selection.
  37139. const oldColors = {
  37140. 'subtle-light-gray': '#f3f4f5',
  37141. 'subtle-pale-green': '#e9fbe5',
  37142. 'subtle-pale-blue': '#e7f5fe',
  37143. 'subtle-pale-pink': '#fcf0ef'
  37144. };
  37145. const table_deprecated_deprecated = [// Deprecation migrating table block to use colors block support feature.
  37146. {
  37147. attributes: {
  37148. hasFixedLayout: {
  37149. type: 'boolean',
  37150. default: false
  37151. },
  37152. backgroundColor: {
  37153. type: 'string'
  37154. },
  37155. caption: {
  37156. type: 'string',
  37157. source: 'html',
  37158. selector: 'figcaption',
  37159. default: ''
  37160. },
  37161. head: {
  37162. type: 'array',
  37163. default: [],
  37164. source: 'query',
  37165. selector: 'thead tr',
  37166. query: {
  37167. cells: {
  37168. type: 'array',
  37169. default: [],
  37170. source: 'query',
  37171. selector: 'td,th',
  37172. query: {
  37173. content: {
  37174. type: 'string',
  37175. source: 'html'
  37176. },
  37177. tag: {
  37178. type: 'string',
  37179. default: 'td',
  37180. source: 'tag'
  37181. },
  37182. scope: {
  37183. type: 'string',
  37184. source: 'attribute',
  37185. attribute: 'scope'
  37186. },
  37187. align: {
  37188. type: 'string',
  37189. source: 'attribute',
  37190. attribute: 'data-align'
  37191. }
  37192. }
  37193. }
  37194. }
  37195. },
  37196. body: {
  37197. type: 'array',
  37198. default: [],
  37199. source: 'query',
  37200. selector: 'tbody tr',
  37201. query: {
  37202. cells: {
  37203. type: 'array',
  37204. default: [],
  37205. source: 'query',
  37206. selector: 'td,th',
  37207. query: {
  37208. content: {
  37209. type: 'string',
  37210. source: 'html'
  37211. },
  37212. tag: {
  37213. type: 'string',
  37214. default: 'td',
  37215. source: 'tag'
  37216. },
  37217. scope: {
  37218. type: 'string',
  37219. source: 'attribute',
  37220. attribute: 'scope'
  37221. },
  37222. align: {
  37223. type: 'string',
  37224. source: 'attribute',
  37225. attribute: 'data-align'
  37226. }
  37227. }
  37228. }
  37229. }
  37230. },
  37231. foot: {
  37232. type: 'array',
  37233. default: [],
  37234. source: 'query',
  37235. selector: 'tfoot tr',
  37236. query: {
  37237. cells: {
  37238. type: 'array',
  37239. default: [],
  37240. source: 'query',
  37241. selector: 'td,th',
  37242. query: {
  37243. content: {
  37244. type: 'string',
  37245. source: 'html'
  37246. },
  37247. tag: {
  37248. type: 'string',
  37249. default: 'td',
  37250. source: 'tag'
  37251. },
  37252. scope: {
  37253. type: 'string',
  37254. source: 'attribute',
  37255. attribute: 'scope'
  37256. },
  37257. align: {
  37258. type: 'string',
  37259. source: 'attribute',
  37260. attribute: 'data-align'
  37261. }
  37262. }
  37263. }
  37264. }
  37265. }
  37266. },
  37267. supports: {
  37268. anchor: true,
  37269. align: true,
  37270. __experimentalSelector: '.wp-block-table > table'
  37271. },
  37272. save: _ref => {
  37273. let {
  37274. attributes
  37275. } = _ref;
  37276. const {
  37277. hasFixedLayout,
  37278. head,
  37279. body,
  37280. foot,
  37281. backgroundColor,
  37282. caption
  37283. } = attributes;
  37284. const isEmpty = !head.length && !body.length && !foot.length;
  37285. if (isEmpty) {
  37286. return null;
  37287. }
  37288. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  37289. const classes = classnames_default()(backgroundClass, {
  37290. 'has-fixed-layout': hasFixedLayout,
  37291. 'has-background': !!backgroundClass
  37292. });
  37293. const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption);
  37294. const Section = _ref2 => {
  37295. let {
  37296. type,
  37297. rows
  37298. } = _ref2;
  37299. if (!rows.length) {
  37300. return null;
  37301. }
  37302. const Tag = `t${type}`;
  37303. return (0,external_wp_element_namespaceObject.createElement)(Tag, null, rows.map((_ref3, rowIndex) => {
  37304. let {
  37305. cells
  37306. } = _ref3;
  37307. return (0,external_wp_element_namespaceObject.createElement)("tr", {
  37308. key: rowIndex
  37309. }, cells.map((_ref4, cellIndex) => {
  37310. let {
  37311. content,
  37312. tag,
  37313. scope,
  37314. align
  37315. } = _ref4;
  37316. const cellClasses = classnames_default()({
  37317. [`has-text-align-${align}`]: align
  37318. });
  37319. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  37320. className: cellClasses ? cellClasses : undefined,
  37321. "data-align": align,
  37322. tagName: tag,
  37323. value: content,
  37324. key: cellIndex,
  37325. scope: tag === 'th' ? scope : undefined
  37326. });
  37327. }));
  37328. }));
  37329. };
  37330. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("table", {
  37331. className: classes === '' ? undefined : classes
  37332. }, (0,external_wp_element_namespaceObject.createElement)(Section, {
  37333. type: "head",
  37334. rows: head
  37335. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  37336. type: "body",
  37337. rows: body
  37338. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  37339. type: "foot",
  37340. rows: foot
  37341. })), hasCaption && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  37342. tagName: "figcaption",
  37343. value: caption
  37344. }));
  37345. },
  37346. isEligible: attributes => {
  37347. return attributes.backgroundColor && attributes.backgroundColor in oldColors && !attributes.style;
  37348. },
  37349. // This version is the first to introduce the style attribute to the
  37350. // table block. As a result, we'll explicitly override that.
  37351. migrate: attributes => {
  37352. return { ...attributes,
  37353. backgroundColor: undefined,
  37354. style: {
  37355. color: {
  37356. background: oldColors[attributes.backgroundColor]
  37357. }
  37358. }
  37359. };
  37360. }
  37361. }, {
  37362. attributes: {
  37363. hasFixedLayout: {
  37364. type: 'boolean',
  37365. default: false
  37366. },
  37367. backgroundColor: {
  37368. type: 'string'
  37369. },
  37370. head: {
  37371. type: 'array',
  37372. default: [],
  37373. source: 'query',
  37374. selector: 'thead tr',
  37375. query: {
  37376. cells: {
  37377. type: 'array',
  37378. default: [],
  37379. source: 'query',
  37380. selector: 'td,th',
  37381. query: {
  37382. content: {
  37383. type: 'string',
  37384. source: 'html'
  37385. },
  37386. tag: {
  37387. type: 'string',
  37388. default: 'td',
  37389. source: 'tag'
  37390. },
  37391. scope: {
  37392. type: 'string',
  37393. source: 'attribute',
  37394. attribute: 'scope'
  37395. }
  37396. }
  37397. }
  37398. }
  37399. },
  37400. body: {
  37401. type: 'array',
  37402. default: [],
  37403. source: 'query',
  37404. selector: 'tbody tr',
  37405. query: {
  37406. cells: {
  37407. type: 'array',
  37408. default: [],
  37409. source: 'query',
  37410. selector: 'td,th',
  37411. query: {
  37412. content: {
  37413. type: 'string',
  37414. source: 'html'
  37415. },
  37416. tag: {
  37417. type: 'string',
  37418. default: 'td',
  37419. source: 'tag'
  37420. },
  37421. scope: {
  37422. type: 'string',
  37423. source: 'attribute',
  37424. attribute: 'scope'
  37425. }
  37426. }
  37427. }
  37428. }
  37429. },
  37430. foot: {
  37431. type: 'array',
  37432. default: [],
  37433. source: 'query',
  37434. selector: 'tfoot tr',
  37435. query: {
  37436. cells: {
  37437. type: 'array',
  37438. default: [],
  37439. source: 'query',
  37440. selector: 'td,th',
  37441. query: {
  37442. content: {
  37443. type: 'string',
  37444. source: 'html'
  37445. },
  37446. tag: {
  37447. type: 'string',
  37448. default: 'td',
  37449. source: 'tag'
  37450. },
  37451. scope: {
  37452. type: 'string',
  37453. source: 'attribute',
  37454. attribute: 'scope'
  37455. }
  37456. }
  37457. }
  37458. }
  37459. }
  37460. },
  37461. supports: table_deprecated_supports,
  37462. save(_ref5) {
  37463. let {
  37464. attributes
  37465. } = _ref5;
  37466. const {
  37467. hasFixedLayout,
  37468. head,
  37469. body,
  37470. foot,
  37471. backgroundColor
  37472. } = attributes;
  37473. const isEmpty = !head.length && !body.length && !foot.length;
  37474. if (isEmpty) {
  37475. return null;
  37476. }
  37477. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  37478. const classes = classnames_default()(backgroundClass, {
  37479. 'has-fixed-layout': hasFixedLayout,
  37480. 'has-background': !!backgroundClass
  37481. });
  37482. const Section = _ref6 => {
  37483. let {
  37484. type,
  37485. rows
  37486. } = _ref6;
  37487. if (!rows.length) {
  37488. return null;
  37489. }
  37490. const Tag = `t${type}`;
  37491. return (0,external_wp_element_namespaceObject.createElement)(Tag, null, rows.map((_ref7, rowIndex) => {
  37492. let {
  37493. cells
  37494. } = _ref7;
  37495. return (0,external_wp_element_namespaceObject.createElement)("tr", {
  37496. key: rowIndex
  37497. }, cells.map((_ref8, cellIndex) => {
  37498. let {
  37499. content,
  37500. tag,
  37501. scope
  37502. } = _ref8;
  37503. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  37504. tagName: tag,
  37505. value: content,
  37506. key: cellIndex,
  37507. scope: tag === 'th' ? scope : undefined
  37508. });
  37509. }));
  37510. }));
  37511. };
  37512. return (0,external_wp_element_namespaceObject.createElement)("table", {
  37513. className: classes
  37514. }, (0,external_wp_element_namespaceObject.createElement)(Section, {
  37515. type: "head",
  37516. rows: head
  37517. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  37518. type: "body",
  37519. rows: body
  37520. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  37521. type: "foot",
  37522. rows: foot
  37523. }));
  37524. }
  37525. }];
  37526. /* harmony default export */ var table_deprecated = (table_deprecated_deprecated);
  37527. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-left.js
  37528. /**
  37529. * WordPress dependencies
  37530. */
  37531. const alignLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37532. xmlns: "http://www.w3.org/2000/svg",
  37533. viewBox: "0 0 24 24"
  37534. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37535. d: "M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"
  37536. }));
  37537. /* harmony default export */ var align_left = (alignLeft);
  37538. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-center.js
  37539. /**
  37540. * WordPress dependencies
  37541. */
  37542. const alignCenter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37543. xmlns: "http://www.w3.org/2000/svg",
  37544. viewBox: "0 0 24 24"
  37545. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37546. d: "M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"
  37547. }));
  37548. /* harmony default export */ var align_center = (alignCenter);
  37549. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-right.js
  37550. /**
  37551. * WordPress dependencies
  37552. */
  37553. const alignRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37554. xmlns: "http://www.w3.org/2000/svg",
  37555. viewBox: "0 0 24 24"
  37556. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37557. d: "M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"
  37558. }));
  37559. /* harmony default export */ var align_right = (alignRight);
  37560. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-row-before.js
  37561. /**
  37562. * WordPress dependencies
  37563. */
  37564. const tableRowBefore = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37565. xmlns: "http://www.w3.org/2000/svg",
  37566. viewBox: "-2 -2 24 24"
  37567. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37568. d: "M6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84zM6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84z"
  37569. }));
  37570. /* harmony default export */ var table_row_before = (tableRowBefore);
  37571. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-row-after.js
  37572. /**
  37573. * WordPress dependencies
  37574. */
  37575. const tableRowAfter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37576. xmlns: "http://www.w3.org/2000/svg",
  37577. viewBox: "-2 -2 24 24"
  37578. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37579. d: "M13.824 10.176h-2.88v-2.88H9.536v2.88h-2.88v1.344h2.88v2.88h1.408v-2.88h2.88zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm6.4 0H7.68v3.84h5.12V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.056H1.28v9.024H19.2V6.336z"
  37580. }));
  37581. /* harmony default export */ var table_row_after = (tableRowAfter);
  37582. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-row-delete.js
  37583. /**
  37584. * WordPress dependencies
  37585. */
  37586. const tableRowDelete = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37587. xmlns: "http://www.w3.org/2000/svg",
  37588. viewBox: "-2 -2 24 24"
  37589. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37590. d: "M17.728 11.456L14.592 8.32l3.2-3.2-1.536-1.536-3.2 3.2L9.92 3.648 8.384 5.12l3.2 3.2-3.264 3.264 1.536 1.536 3.264-3.264 3.136 3.136 1.472-1.536zM0 17.92V0h20.48v17.92H0zm19.2-6.4h-.448l-1.28-1.28H19.2V6.4h-1.792l1.28-1.28h.512V1.28H1.28v3.84h6.208l1.28 1.28H1.28v3.84h7.424l-1.28 1.28H1.28v3.84H19.2v-3.84z"
  37591. }));
  37592. /* harmony default export */ var table_row_delete = (tableRowDelete);
  37593. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-before.js
  37594. /**
  37595. * WordPress dependencies
  37596. */
  37597. const tableColumnBefore = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37598. xmlns: "http://www.w3.org/2000/svg",
  37599. viewBox: "-2 -2 24 24"
  37600. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37601. d: "M6.4 3.776v3.648H2.752v1.792H6.4v3.648h1.728V9.216h3.712V7.424H8.128V3.776zM0 17.92V0h20.48v17.92H0zM12.8 1.28H1.28v14.08H12.8V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.12h-5.12v3.84h5.12V6.4zm0 5.12h-5.12v3.84h5.12v-3.84z"
  37602. }));
  37603. /* harmony default export */ var table_column_before = (tableColumnBefore);
  37604. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-after.js
  37605. /**
  37606. * WordPress dependencies
  37607. */
  37608. const tableColumnAfter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37609. xmlns: "http://www.w3.org/2000/svg",
  37610. viewBox: "-2 -2 24 24"
  37611. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37612. d: "M14.08 12.864V9.216h3.648V7.424H14.08V3.776h-1.728v3.648H8.64v1.792h3.712v3.648zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm0 5.12H1.28v3.84H6.4V6.4zm0 5.12H1.28v3.84H6.4v-3.84zM19.2 1.28H7.68v14.08H19.2V1.28z"
  37613. }));
  37614. /* harmony default export */ var table_column_after = (tableColumnAfter);
  37615. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-delete.js
  37616. /**
  37617. * WordPress dependencies
  37618. */
  37619. const tableColumnDelete = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37620. xmlns: "http://www.w3.org/2000/svg",
  37621. viewBox: "-2 -2 24 24"
  37622. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37623. d: "M6.4 9.98L7.68 8.7v-.256L6.4 7.164V9.98zm6.4-1.532l1.28-1.28V9.92L12.8 8.64v-.192zm7.68 9.472V0H0v17.92h20.48zm-1.28-2.56h-5.12v-1.024l-.256.256-1.024-1.024v1.792H7.68v-1.792l-1.024 1.024-.256-.256v1.024H1.28V1.28H6.4v2.368l.704-.704.576.576V1.216h5.12V3.52l.96-.96.32.32V1.216h5.12V15.36zm-5.76-2.112l-3.136-3.136-3.264 3.264-1.536-1.536 3.264-3.264L5.632 5.44l1.536-1.536 3.136 3.136 3.2-3.2 1.536 1.536-3.2 3.2 3.136 3.136-1.536 1.536z"
  37624. }));
  37625. /* harmony default export */ var table_column_delete = (tableColumnDelete);
  37626. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table.js
  37627. /**
  37628. * WordPress dependencies
  37629. */
  37630. const table = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37631. xmlns: "http://www.w3.org/2000/svg",
  37632. viewBox: "0 0 24 24"
  37633. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37634. d: "M4 6v11.5h16V6H4zm1.5 1.5h6V11h-6V7.5zm0 8.5v-3.5h6V16h-6zm13 0H13v-3.5h5.5V16zM13 11V7.5h5.5V11H13z"
  37635. }));
  37636. /* harmony default export */ var library_table = (table);
  37637. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/state.js
  37638. /**
  37639. * External dependencies
  37640. */
  37641. const INHERITED_COLUMN_ATTRIBUTES = ['align'];
  37642. /**
  37643. * Creates a table state.
  37644. *
  37645. * @param {Object} options
  37646. * @param {number} options.rowCount Row count for the table to create.
  37647. * @param {number} options.columnCount Column count for the table to create.
  37648. *
  37649. * @return {Object} New table state.
  37650. */
  37651. function createTable(_ref) {
  37652. let {
  37653. rowCount,
  37654. columnCount
  37655. } = _ref;
  37656. return {
  37657. body: (0,external_lodash_namespaceObject.times)(rowCount, () => ({
  37658. cells: (0,external_lodash_namespaceObject.times)(columnCount, () => ({
  37659. content: '',
  37660. tag: 'td'
  37661. }))
  37662. }))
  37663. };
  37664. }
  37665. /**
  37666. * Returns the first row in the table.
  37667. *
  37668. * @param {Object} state Current table state.
  37669. *
  37670. * @return {Object} The first table row.
  37671. */
  37672. function getFirstRow(state) {
  37673. if (!isEmptyTableSection(state.head)) {
  37674. return state.head[0];
  37675. }
  37676. if (!isEmptyTableSection(state.body)) {
  37677. return state.body[0];
  37678. }
  37679. if (!isEmptyTableSection(state.foot)) {
  37680. return state.foot[0];
  37681. }
  37682. }
  37683. /**
  37684. * Gets an attribute for a cell.
  37685. *
  37686. * @param {Object} state Current table state.
  37687. * @param {Object} cellLocation The location of the cell
  37688. * @param {string} attributeName The name of the attribute to get the value of.
  37689. *
  37690. * @return {*} The attribute value.
  37691. */
  37692. function getCellAttribute(state, cellLocation, attributeName) {
  37693. const {
  37694. sectionName,
  37695. rowIndex,
  37696. columnIndex
  37697. } = cellLocation;
  37698. return (0,external_lodash_namespaceObject.get)(state, [sectionName, rowIndex, 'cells', columnIndex, attributeName]);
  37699. }
  37700. /**
  37701. * Returns updated cell attributes after applying the `updateCell` function to the selection.
  37702. *
  37703. * @param {Object} state The block attributes.
  37704. * @param {Object} selection The selection of cells to update.
  37705. * @param {Function} updateCell A function to update the selected cell attributes.
  37706. *
  37707. * @return {Object} New table state including the updated cells.
  37708. */
  37709. function updateSelectedCell(state, selection, updateCell) {
  37710. if (!selection) {
  37711. return state;
  37712. }
  37713. const tableSections = (0,external_lodash_namespaceObject.pick)(state, ['head', 'body', 'foot']);
  37714. const {
  37715. sectionName: selectionSectionName,
  37716. rowIndex: selectionRowIndex
  37717. } = selection;
  37718. return (0,external_lodash_namespaceObject.mapValues)(tableSections, (section, sectionName) => {
  37719. if (selectionSectionName && selectionSectionName !== sectionName) {
  37720. return section;
  37721. }
  37722. return section.map((row, rowIndex) => {
  37723. if (selectionRowIndex && selectionRowIndex !== rowIndex) {
  37724. return row;
  37725. }
  37726. return {
  37727. cells: row.cells.map((cellAttributes, columnIndex) => {
  37728. const cellLocation = {
  37729. sectionName,
  37730. columnIndex,
  37731. rowIndex
  37732. };
  37733. if (!isCellSelected(cellLocation, selection)) {
  37734. return cellAttributes;
  37735. }
  37736. return updateCell(cellAttributes);
  37737. })
  37738. };
  37739. });
  37740. });
  37741. }
  37742. /**
  37743. * Returns whether the cell at `cellLocation` is included in the selection `selection`.
  37744. *
  37745. * @param {Object} cellLocation An object containing cell location properties.
  37746. * @param {Object} selection An object containing selection properties.
  37747. *
  37748. * @return {boolean} True if the cell is selected, false otherwise.
  37749. */
  37750. function isCellSelected(cellLocation, selection) {
  37751. if (!cellLocation || !selection) {
  37752. return false;
  37753. }
  37754. switch (selection.type) {
  37755. case 'column':
  37756. return selection.type === 'column' && cellLocation.columnIndex === selection.columnIndex;
  37757. case 'cell':
  37758. return selection.type === 'cell' && cellLocation.sectionName === selection.sectionName && cellLocation.columnIndex === selection.columnIndex && cellLocation.rowIndex === selection.rowIndex;
  37759. }
  37760. }
  37761. /**
  37762. * Inserts a row in the table state.
  37763. *
  37764. * @param {Object} state Current table state.
  37765. * @param {Object} options
  37766. * @param {string} options.sectionName Section in which to insert the row.
  37767. * @param {number} options.rowIndex Row index at which to insert the row.
  37768. * @param {number} options.columnCount Column count for the table to create.
  37769. *
  37770. * @return {Object} New table state.
  37771. */
  37772. function insertRow(state, _ref2) {
  37773. let {
  37774. sectionName,
  37775. rowIndex,
  37776. columnCount
  37777. } = _ref2;
  37778. const firstRow = getFirstRow(state);
  37779. const cellCount = columnCount === undefined ? (0,external_lodash_namespaceObject.get)(firstRow, ['cells', 'length']) : columnCount; // Bail early if the function cannot determine how many cells to add.
  37780. if (!cellCount) {
  37781. return state;
  37782. }
  37783. return {
  37784. [sectionName]: [...state[sectionName].slice(0, rowIndex), {
  37785. cells: (0,external_lodash_namespaceObject.times)(cellCount, index => {
  37786. const firstCellInColumn = (0,external_lodash_namespaceObject.get)(firstRow, ['cells', index], {});
  37787. const inheritedAttributes = (0,external_lodash_namespaceObject.pick)(firstCellInColumn, INHERITED_COLUMN_ATTRIBUTES);
  37788. return { ...inheritedAttributes,
  37789. content: '',
  37790. tag: sectionName === 'head' ? 'th' : 'td'
  37791. };
  37792. })
  37793. }, ...state[sectionName].slice(rowIndex)]
  37794. };
  37795. }
  37796. /**
  37797. * Deletes a row from the table state.
  37798. *
  37799. * @param {Object} state Current table state.
  37800. * @param {Object} options
  37801. * @param {string} options.sectionName Section in which to delete the row.
  37802. * @param {number} options.rowIndex Row index to delete.
  37803. *
  37804. * @return {Object} New table state.
  37805. */
  37806. function deleteRow(state, _ref3) {
  37807. let {
  37808. sectionName,
  37809. rowIndex
  37810. } = _ref3;
  37811. return {
  37812. [sectionName]: state[sectionName].filter((row, index) => index !== rowIndex)
  37813. };
  37814. }
  37815. /**
  37816. * Inserts a column in the table state.
  37817. *
  37818. * @param {Object} state Current table state.
  37819. * @param {Object} options
  37820. * @param {number} options.columnIndex Column index at which to insert the column.
  37821. *
  37822. * @return {Object} New table state.
  37823. */
  37824. function insertColumn(state, _ref4) {
  37825. let {
  37826. columnIndex
  37827. } = _ref4;
  37828. const tableSections = (0,external_lodash_namespaceObject.pick)(state, ['head', 'body', 'foot']);
  37829. return (0,external_lodash_namespaceObject.mapValues)(tableSections, (section, sectionName) => {
  37830. // Bail early if the table section is empty.
  37831. if (isEmptyTableSection(section)) {
  37832. return section;
  37833. }
  37834. return section.map(row => {
  37835. // Bail early if the row is empty or it's an attempt to insert past
  37836. // the last possible index of the array.
  37837. if (isEmptyRow(row) || row.cells.length < columnIndex) {
  37838. return row;
  37839. }
  37840. return {
  37841. cells: [...row.cells.slice(0, columnIndex), {
  37842. content: '',
  37843. tag: sectionName === 'head' ? 'th' : 'td'
  37844. }, ...row.cells.slice(columnIndex)]
  37845. };
  37846. });
  37847. });
  37848. }
  37849. /**
  37850. * Deletes a column from the table state.
  37851. *
  37852. * @param {Object} state Current table state.
  37853. * @param {Object} options
  37854. * @param {number} options.columnIndex Column index to delete.
  37855. *
  37856. * @return {Object} New table state.
  37857. */
  37858. function deleteColumn(state, _ref5) {
  37859. let {
  37860. columnIndex
  37861. } = _ref5;
  37862. const tableSections = (0,external_lodash_namespaceObject.pick)(state, ['head', 'body', 'foot']);
  37863. return (0,external_lodash_namespaceObject.mapValues)(tableSections, section => {
  37864. // Bail early if the table section is empty.
  37865. if (isEmptyTableSection(section)) {
  37866. return section;
  37867. }
  37868. return section.map(row => ({
  37869. cells: row.cells.length >= columnIndex ? row.cells.filter((cell, index) => index !== columnIndex) : row.cells
  37870. })).filter(row => row.cells.length);
  37871. });
  37872. }
  37873. /**
  37874. * Toggles the existance of a section.
  37875. *
  37876. * @param {Object} state Current table state.
  37877. * @param {string} sectionName Name of the section to toggle.
  37878. *
  37879. * @return {Object} New table state.
  37880. */
  37881. function toggleSection(state, sectionName) {
  37882. // Section exists, replace it with an empty row to remove it.
  37883. if (!isEmptyTableSection(state[sectionName])) {
  37884. return {
  37885. [sectionName]: []
  37886. };
  37887. } // Get the length of the first row of the body to use when creating the header.
  37888. const columnCount = (0,external_lodash_namespaceObject.get)(state, ['body', 0, 'cells', 'length'], 1); // Section doesn't exist, insert an empty row to create the section.
  37889. return insertRow(state, {
  37890. sectionName,
  37891. rowIndex: 0,
  37892. columnCount
  37893. });
  37894. }
  37895. /**
  37896. * Determines whether a table section is empty.
  37897. *
  37898. * @param {Object} section Table section state.
  37899. *
  37900. * @return {boolean} True if the table section is empty, false otherwise.
  37901. */
  37902. function isEmptyTableSection(section) {
  37903. return !section || !section.length || (0,external_lodash_namespaceObject.every)(section, isEmptyRow);
  37904. }
  37905. /**
  37906. * Determines whether a table row is empty.
  37907. *
  37908. * @param {Object} row Table row state.
  37909. *
  37910. * @return {boolean} True if the table section is empty, false otherwise.
  37911. */
  37912. function isEmptyRow(row) {
  37913. return !(row.cells && row.cells.length);
  37914. }
  37915. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/edit.js
  37916. /**
  37917. * External dependencies
  37918. */
  37919. /**
  37920. * WordPress dependencies
  37921. */
  37922. /**
  37923. * Internal dependencies
  37924. */
  37925. const ALIGNMENT_CONTROLS = [{
  37926. icon: align_left,
  37927. title: (0,external_wp_i18n_namespaceObject.__)('Align column left'),
  37928. align: 'left'
  37929. }, {
  37930. icon: align_center,
  37931. title: (0,external_wp_i18n_namespaceObject.__)('Align column center'),
  37932. align: 'center'
  37933. }, {
  37934. icon: align_right,
  37935. title: (0,external_wp_i18n_namespaceObject.__)('Align column right'),
  37936. align: 'right'
  37937. }];
  37938. const cellAriaLabel = {
  37939. head: (0,external_wp_i18n_namespaceObject.__)('Header cell text'),
  37940. body: (0,external_wp_i18n_namespaceObject.__)('Body cell text'),
  37941. foot: (0,external_wp_i18n_namespaceObject.__)('Footer cell text')
  37942. };
  37943. const placeholder = {
  37944. head: (0,external_wp_i18n_namespaceObject.__)('Header label'),
  37945. foot: (0,external_wp_i18n_namespaceObject.__)('Footer label')
  37946. };
  37947. function TSection(_ref) {
  37948. let {
  37949. name,
  37950. ...props
  37951. } = _ref;
  37952. const TagName = `t${name}`;
  37953. return (0,external_wp_element_namespaceObject.createElement)(TagName, props);
  37954. }
  37955. function TableEdit(_ref2) {
  37956. let {
  37957. attributes,
  37958. setAttributes,
  37959. insertBlocksAfter,
  37960. isSelected
  37961. } = _ref2;
  37962. const {
  37963. hasFixedLayout,
  37964. caption,
  37965. head,
  37966. foot
  37967. } = attributes;
  37968. const [initialRowCount, setInitialRowCount] = (0,external_wp_element_namespaceObject.useState)(2);
  37969. const [initialColumnCount, setInitialColumnCount] = (0,external_wp_element_namespaceObject.useState)(2);
  37970. const [selectedCell, setSelectedCell] = (0,external_wp_element_namespaceObject.useState)();
  37971. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
  37972. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
  37973. /**
  37974. * Updates the initial column count used for table creation.
  37975. *
  37976. * @param {number} count New initial column count.
  37977. */
  37978. function onChangeInitialColumnCount(count) {
  37979. setInitialColumnCount(count);
  37980. }
  37981. /**
  37982. * Updates the initial row count used for table creation.
  37983. *
  37984. * @param {number} count New initial row count.
  37985. */
  37986. function onChangeInitialRowCount(count) {
  37987. setInitialRowCount(count);
  37988. }
  37989. /**
  37990. * Creates a table based on dimensions in local state.
  37991. *
  37992. * @param {Object} event Form submit event.
  37993. */
  37994. function onCreateTable(event) {
  37995. event.preventDefault();
  37996. setAttributes(createTable({
  37997. rowCount: parseInt(initialRowCount, 10) || 2,
  37998. columnCount: parseInt(initialColumnCount, 10) || 2
  37999. }));
  38000. }
  38001. /**
  38002. * Toggles whether the table has a fixed layout or not.
  38003. */
  38004. function onChangeFixedLayout() {
  38005. setAttributes({
  38006. hasFixedLayout: !hasFixedLayout
  38007. });
  38008. }
  38009. /**
  38010. * Changes the content of the currently selected cell.
  38011. *
  38012. * @param {Array} content A RichText content value.
  38013. */
  38014. function onChange(content) {
  38015. if (!selectedCell) {
  38016. return;
  38017. }
  38018. setAttributes(updateSelectedCell(attributes, selectedCell, cellAttributes => ({ ...cellAttributes,
  38019. content
  38020. })));
  38021. }
  38022. /**
  38023. * Align text within the a column.
  38024. *
  38025. * @param {string} align The new alignment to apply to the column.
  38026. */
  38027. function onChangeColumnAlignment(align) {
  38028. if (!selectedCell) {
  38029. return;
  38030. } // Convert the cell selection to a column selection so that alignment
  38031. // is applied to the entire column.
  38032. const columnSelection = {
  38033. type: 'column',
  38034. columnIndex: selectedCell.columnIndex
  38035. };
  38036. const newAttributes = updateSelectedCell(attributes, columnSelection, cellAttributes => ({ ...cellAttributes,
  38037. align
  38038. }));
  38039. setAttributes(newAttributes);
  38040. }
  38041. /**
  38042. * Get the alignment of the currently selected cell.
  38043. *
  38044. * @return {string} The new alignment to apply to the column.
  38045. */
  38046. function getCellAlignment() {
  38047. if (!selectedCell) {
  38048. return;
  38049. }
  38050. return getCellAttribute(attributes, selectedCell, 'align');
  38051. }
  38052. /**
  38053. * Add or remove a `head` table section.
  38054. */
  38055. function onToggleHeaderSection() {
  38056. setAttributes(toggleSection(attributes, 'head'));
  38057. }
  38058. /**
  38059. * Add or remove a `foot` table section.
  38060. */
  38061. function onToggleFooterSection() {
  38062. setAttributes(toggleSection(attributes, 'foot'));
  38063. }
  38064. /**
  38065. * Inserts a row at the currently selected row index, plus `delta`.
  38066. *
  38067. * @param {number} delta Offset for selected row index at which to insert.
  38068. */
  38069. function onInsertRow(delta) {
  38070. if (!selectedCell) {
  38071. return;
  38072. }
  38073. const {
  38074. sectionName,
  38075. rowIndex
  38076. } = selectedCell;
  38077. const newRowIndex = rowIndex + delta;
  38078. setAttributes(insertRow(attributes, {
  38079. sectionName,
  38080. rowIndex: newRowIndex
  38081. })); // Select the first cell of the new row.
  38082. setSelectedCell({
  38083. sectionName,
  38084. rowIndex: newRowIndex,
  38085. columnIndex: 0,
  38086. type: 'cell'
  38087. });
  38088. }
  38089. /**
  38090. * Inserts a row before the currently selected row.
  38091. */
  38092. function onInsertRowBefore() {
  38093. onInsertRow(0);
  38094. }
  38095. /**
  38096. * Inserts a row after the currently selected row.
  38097. */
  38098. function onInsertRowAfter() {
  38099. onInsertRow(1);
  38100. }
  38101. /**
  38102. * Deletes the currently selected row.
  38103. */
  38104. function onDeleteRow() {
  38105. if (!selectedCell) {
  38106. return;
  38107. }
  38108. const {
  38109. sectionName,
  38110. rowIndex
  38111. } = selectedCell;
  38112. setSelectedCell();
  38113. setAttributes(deleteRow(attributes, {
  38114. sectionName,
  38115. rowIndex
  38116. }));
  38117. }
  38118. /**
  38119. * Inserts a column at the currently selected column index, plus `delta`.
  38120. *
  38121. * @param {number} delta Offset for selected column index at which to insert.
  38122. */
  38123. function onInsertColumn() {
  38124. let delta = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  38125. if (!selectedCell) {
  38126. return;
  38127. }
  38128. const {
  38129. columnIndex
  38130. } = selectedCell;
  38131. const newColumnIndex = columnIndex + delta;
  38132. setAttributes(insertColumn(attributes, {
  38133. columnIndex: newColumnIndex
  38134. })); // Select the first cell of the new column.
  38135. setSelectedCell({
  38136. rowIndex: 0,
  38137. columnIndex: newColumnIndex,
  38138. type: 'cell'
  38139. });
  38140. }
  38141. /**
  38142. * Inserts a column before the currently selected column.
  38143. */
  38144. function onInsertColumnBefore() {
  38145. onInsertColumn(0);
  38146. }
  38147. /**
  38148. * Inserts a column after the currently selected column.
  38149. */
  38150. function onInsertColumnAfter() {
  38151. onInsertColumn(1);
  38152. }
  38153. /**
  38154. * Deletes the currently selected column.
  38155. */
  38156. function onDeleteColumn() {
  38157. if (!selectedCell) {
  38158. return;
  38159. }
  38160. const {
  38161. sectionName,
  38162. columnIndex
  38163. } = selectedCell;
  38164. setSelectedCell();
  38165. setAttributes(deleteColumn(attributes, {
  38166. sectionName,
  38167. columnIndex
  38168. }));
  38169. }
  38170. (0,external_wp_element_namespaceObject.useEffect)(() => {
  38171. if (!isSelected) {
  38172. setSelectedCell();
  38173. }
  38174. }, [isSelected]);
  38175. const sections = ['head', 'body', 'foot'].filter(name => !isEmptyTableSection(attributes[name]));
  38176. const tableControls = [{
  38177. icon: table_row_before,
  38178. title: (0,external_wp_i18n_namespaceObject.__)('Insert row before'),
  38179. isDisabled: !selectedCell,
  38180. onClick: onInsertRowBefore
  38181. }, {
  38182. icon: table_row_after,
  38183. title: (0,external_wp_i18n_namespaceObject.__)('Insert row after'),
  38184. isDisabled: !selectedCell,
  38185. onClick: onInsertRowAfter
  38186. }, {
  38187. icon: table_row_delete,
  38188. title: (0,external_wp_i18n_namespaceObject.__)('Delete row'),
  38189. isDisabled: !selectedCell,
  38190. onClick: onDeleteRow
  38191. }, {
  38192. icon: table_column_before,
  38193. title: (0,external_wp_i18n_namespaceObject.__)('Insert column before'),
  38194. isDisabled: !selectedCell,
  38195. onClick: onInsertColumnBefore
  38196. }, {
  38197. icon: table_column_after,
  38198. title: (0,external_wp_i18n_namespaceObject.__)('Insert column after'),
  38199. isDisabled: !selectedCell,
  38200. onClick: onInsertColumnAfter
  38201. }, {
  38202. icon: table_column_delete,
  38203. title: (0,external_wp_i18n_namespaceObject.__)('Delete column'),
  38204. isDisabled: !selectedCell,
  38205. onClick: onDeleteColumn
  38206. }];
  38207. const renderedSections = ['head', 'body', 'foot'].map(name => (0,external_wp_element_namespaceObject.createElement)(TSection, {
  38208. name: name,
  38209. key: name
  38210. }, attributes[name].map((_ref3, rowIndex) => {
  38211. let {
  38212. cells
  38213. } = _ref3;
  38214. return (0,external_wp_element_namespaceObject.createElement)("tr", {
  38215. key: rowIndex
  38216. }, cells.map((_ref4, columnIndex) => {
  38217. let {
  38218. content,
  38219. tag: CellTag,
  38220. scope,
  38221. align
  38222. } = _ref4;
  38223. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  38224. tagName: CellTag,
  38225. key: columnIndex,
  38226. className: classnames_default()({
  38227. [`has-text-align-${align}`]: align
  38228. }, 'wp-block-table__cell-content'),
  38229. scope: CellTag === 'th' ? scope : undefined,
  38230. value: content,
  38231. onChange: onChange,
  38232. unstableOnFocus: () => {
  38233. setSelectedCell({
  38234. sectionName: name,
  38235. rowIndex,
  38236. columnIndex,
  38237. type: 'cell'
  38238. });
  38239. },
  38240. "aria-label": cellAriaLabel[name],
  38241. placeholder: placeholder[name]
  38242. });
  38243. }));
  38244. })));
  38245. const isEmpty = !sections.length;
  38246. return (0,external_wp_element_namespaceObject.createElement)("figure", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), !isEmpty && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  38247. group: "block"
  38248. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  38249. label: (0,external_wp_i18n_namespaceObject.__)('Change column alignment'),
  38250. alignmentControls: ALIGNMENT_CONTROLS,
  38251. value: getCellAlignment(),
  38252. onChange: nextAlign => onChangeColumnAlignment(nextAlign)
  38253. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  38254. group: "other"
  38255. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
  38256. hasArrowIndicator: true,
  38257. icon: library_table,
  38258. label: (0,external_wp_i18n_namespaceObject.__)('Edit table'),
  38259. controls: tableControls
  38260. }))), !isEmpty && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  38261. title: (0,external_wp_i18n_namespaceObject.__)('Table settings'),
  38262. className: "blocks-table-settings"
  38263. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  38264. label: (0,external_wp_i18n_namespaceObject.__)('Fixed width table cells'),
  38265. checked: !!hasFixedLayout,
  38266. onChange: onChangeFixedLayout
  38267. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  38268. label: (0,external_wp_i18n_namespaceObject.__)('Header section'),
  38269. checked: !!(head && head.length),
  38270. onChange: onToggleHeaderSection
  38271. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  38272. label: (0,external_wp_i18n_namespaceObject.__)('Footer section'),
  38273. checked: !!(foot && foot.length),
  38274. onChange: onToggleFooterSection
  38275. }))), !isEmpty && (0,external_wp_element_namespaceObject.createElement)("table", {
  38276. className: classnames_default()(colorProps.className, borderProps.className, {
  38277. 'has-fixed-layout': hasFixedLayout
  38278. }),
  38279. style: { ...colorProps.style,
  38280. ...borderProps.style
  38281. }
  38282. }, renderedSections), !isEmpty && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  38283. tagName: "figcaption",
  38284. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Table caption text'),
  38285. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
  38286. value: caption,
  38287. onChange: value => setAttributes({
  38288. caption: value
  38289. }) // Deselect the selected table cell when the caption is focused.
  38290. ,
  38291. unstableOnFocus: () => setSelectedCell(),
  38292. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
  38293. }), isEmpty && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  38294. label: (0,external_wp_i18n_namespaceObject.__)('Table'),
  38295. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  38296. icon: block_table,
  38297. showColors: true
  38298. }),
  38299. instructions: (0,external_wp_i18n_namespaceObject.__)('Insert a table for sharing data.')
  38300. }, (0,external_wp_element_namespaceObject.createElement)("form", {
  38301. className: "blocks-table__placeholder-form",
  38302. onSubmit: onCreateTable
  38303. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  38304. type: "number",
  38305. label: (0,external_wp_i18n_namespaceObject.__)('Column count'),
  38306. value: initialColumnCount,
  38307. onChange: onChangeInitialColumnCount,
  38308. min: "1",
  38309. className: "blocks-table__placeholder-input"
  38310. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  38311. type: "number",
  38312. label: (0,external_wp_i18n_namespaceObject.__)('Row count'),
  38313. value: initialRowCount,
  38314. onChange: onChangeInitialRowCount,
  38315. min: "1",
  38316. className: "blocks-table__placeholder-input"
  38317. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  38318. className: "blocks-table__placeholder-button",
  38319. variant: "primary",
  38320. type: "submit"
  38321. }, (0,external_wp_i18n_namespaceObject.__)('Create Table')))));
  38322. }
  38323. /* harmony default export */ var table_edit = (TableEdit);
  38324. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/save.js
  38325. /**
  38326. * External dependencies
  38327. */
  38328. /**
  38329. * WordPress dependencies
  38330. */
  38331. function table_save_save(_ref) {
  38332. let {
  38333. attributes
  38334. } = _ref;
  38335. const {
  38336. hasFixedLayout,
  38337. head,
  38338. body,
  38339. foot,
  38340. caption
  38341. } = attributes;
  38342. const isEmpty = !head.length && !body.length && !foot.length;
  38343. if (isEmpty) {
  38344. return null;
  38345. }
  38346. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  38347. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
  38348. const classes = classnames_default()(colorProps.className, borderProps.className, {
  38349. 'has-fixed-layout': hasFixedLayout
  38350. });
  38351. const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption);
  38352. const Section = _ref2 => {
  38353. let {
  38354. type,
  38355. rows
  38356. } = _ref2;
  38357. if (!rows.length) {
  38358. return null;
  38359. }
  38360. const Tag = `t${type}`;
  38361. return (0,external_wp_element_namespaceObject.createElement)(Tag, null, rows.map((_ref3, rowIndex) => {
  38362. let {
  38363. cells
  38364. } = _ref3;
  38365. return (0,external_wp_element_namespaceObject.createElement)("tr", {
  38366. key: rowIndex
  38367. }, cells.map((_ref4, cellIndex) => {
  38368. let {
  38369. content,
  38370. tag,
  38371. scope,
  38372. align
  38373. } = _ref4;
  38374. const cellClasses = classnames_default()({
  38375. [`has-text-align-${align}`]: align
  38376. });
  38377. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  38378. className: cellClasses ? cellClasses : undefined,
  38379. "data-align": align,
  38380. tagName: tag,
  38381. value: content,
  38382. key: cellIndex,
  38383. scope: tag === 'th' ? scope : undefined
  38384. });
  38385. }));
  38386. }));
  38387. };
  38388. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("table", {
  38389. className: classes === '' ? undefined : classes,
  38390. style: { ...colorProps.style,
  38391. ...borderProps.style
  38392. }
  38393. }, (0,external_wp_element_namespaceObject.createElement)(Section, {
  38394. type: "head",
  38395. rows: head
  38396. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  38397. type: "body",
  38398. rows: body
  38399. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  38400. type: "foot",
  38401. rows: foot
  38402. })), hasCaption && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  38403. tagName: "figcaption",
  38404. value: caption
  38405. }));
  38406. }
  38407. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/transforms.js
  38408. const tableContentPasteSchema = _ref => {
  38409. let {
  38410. phrasingContentSchema
  38411. } = _ref;
  38412. return {
  38413. tr: {
  38414. allowEmpty: true,
  38415. children: {
  38416. th: {
  38417. allowEmpty: true,
  38418. children: phrasingContentSchema,
  38419. attributes: ['scope']
  38420. },
  38421. td: {
  38422. allowEmpty: true,
  38423. children: phrasingContentSchema
  38424. }
  38425. }
  38426. }
  38427. };
  38428. };
  38429. const tablePasteSchema = args => ({
  38430. table: {
  38431. children: {
  38432. thead: {
  38433. allowEmpty: true,
  38434. children: tableContentPasteSchema(args)
  38435. },
  38436. tfoot: {
  38437. allowEmpty: true,
  38438. children: tableContentPasteSchema(args)
  38439. },
  38440. tbody: {
  38441. allowEmpty: true,
  38442. children: tableContentPasteSchema(args)
  38443. }
  38444. }
  38445. }
  38446. });
  38447. const table_transforms_transforms = {
  38448. from: [{
  38449. type: 'raw',
  38450. selector: 'table',
  38451. schema: tablePasteSchema
  38452. }]
  38453. };
  38454. /* harmony default export */ var table_transforms = (table_transforms_transforms);
  38455. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/index.js
  38456. /**
  38457. * WordPress dependencies
  38458. */
  38459. /**
  38460. * Internal dependencies
  38461. */
  38462. const table_metadata = {
  38463. $schema: "https://schemas.wp.org/trunk/block.json",
  38464. apiVersion: 2,
  38465. name: "core/table",
  38466. title: "Table",
  38467. category: "text",
  38468. description: "Create structured content in rows and columns to display information.",
  38469. textdomain: "default",
  38470. attributes: {
  38471. hasFixedLayout: {
  38472. type: "boolean",
  38473. "default": false
  38474. },
  38475. caption: {
  38476. type: "string",
  38477. source: "html",
  38478. selector: "figcaption",
  38479. "default": ""
  38480. },
  38481. head: {
  38482. type: "array",
  38483. "default": [],
  38484. source: "query",
  38485. selector: "thead tr",
  38486. query: {
  38487. cells: {
  38488. type: "array",
  38489. "default": [],
  38490. source: "query",
  38491. selector: "td,th",
  38492. query: {
  38493. content: {
  38494. type: "string",
  38495. source: "html"
  38496. },
  38497. tag: {
  38498. type: "string",
  38499. "default": "td",
  38500. source: "tag"
  38501. },
  38502. scope: {
  38503. type: "string",
  38504. source: "attribute",
  38505. attribute: "scope"
  38506. },
  38507. align: {
  38508. type: "string",
  38509. source: "attribute",
  38510. attribute: "data-align"
  38511. }
  38512. }
  38513. }
  38514. }
  38515. },
  38516. body: {
  38517. type: "array",
  38518. "default": [],
  38519. source: "query",
  38520. selector: "tbody tr",
  38521. query: {
  38522. cells: {
  38523. type: "array",
  38524. "default": [],
  38525. source: "query",
  38526. selector: "td,th",
  38527. query: {
  38528. content: {
  38529. type: "string",
  38530. source: "html"
  38531. },
  38532. tag: {
  38533. type: "string",
  38534. "default": "td",
  38535. source: "tag"
  38536. },
  38537. scope: {
  38538. type: "string",
  38539. source: "attribute",
  38540. attribute: "scope"
  38541. },
  38542. align: {
  38543. type: "string",
  38544. source: "attribute",
  38545. attribute: "data-align"
  38546. }
  38547. }
  38548. }
  38549. }
  38550. },
  38551. foot: {
  38552. type: "array",
  38553. "default": [],
  38554. source: "query",
  38555. selector: "tfoot tr",
  38556. query: {
  38557. cells: {
  38558. type: "array",
  38559. "default": [],
  38560. source: "query",
  38561. selector: "td,th",
  38562. query: {
  38563. content: {
  38564. type: "string",
  38565. source: "html"
  38566. },
  38567. tag: {
  38568. type: "string",
  38569. "default": "td",
  38570. source: "tag"
  38571. },
  38572. scope: {
  38573. type: "string",
  38574. source: "attribute",
  38575. attribute: "scope"
  38576. },
  38577. align: {
  38578. type: "string",
  38579. source: "attribute",
  38580. attribute: "data-align"
  38581. }
  38582. }
  38583. }
  38584. }
  38585. }
  38586. },
  38587. supports: {
  38588. anchor: true,
  38589. align: true,
  38590. color: {
  38591. __experimentalSkipSerialization: true,
  38592. gradients: true,
  38593. __experimentalDefaultControls: {
  38594. background: true,
  38595. text: true
  38596. }
  38597. },
  38598. typography: {
  38599. fontSize: true,
  38600. lineHeight: true,
  38601. __experimentalFontStyle: true,
  38602. __experimentalFontWeight: true,
  38603. __experimentalLetterSpacing: true,
  38604. __experimentalTextTransform: true,
  38605. __experimentalDefaultControls: {
  38606. fontSize: true
  38607. }
  38608. },
  38609. __experimentalBorder: {
  38610. __experimentalSkipSerialization: true,
  38611. color: true,
  38612. style: true,
  38613. width: true,
  38614. __experimentalDefaultControls: {
  38615. color: true,
  38616. style: true,
  38617. width: true
  38618. }
  38619. },
  38620. __experimentalSelector: ".wp-block-table > table"
  38621. },
  38622. styles: [{
  38623. name: "regular",
  38624. label: "Default",
  38625. isDefault: true
  38626. }, {
  38627. name: "stripes",
  38628. label: "Stripes"
  38629. }],
  38630. editorStyle: "wp-block-table-editor",
  38631. style: "wp-block-table"
  38632. };
  38633. const {
  38634. name: table_name
  38635. } = table_metadata;
  38636. const table_settings = {
  38637. icon: block_table,
  38638. example: {
  38639. attributes: {
  38640. head: [{
  38641. cells: [{
  38642. content: (0,external_wp_i18n_namespaceObject.__)('Version'),
  38643. tag: 'th'
  38644. }, {
  38645. content: (0,external_wp_i18n_namespaceObject.__)('Jazz Musician'),
  38646. tag: 'th'
  38647. }, {
  38648. content: (0,external_wp_i18n_namespaceObject.__)('Release Date'),
  38649. tag: 'th'
  38650. }]
  38651. }],
  38652. body: [{
  38653. cells: [{
  38654. content: '5.2',
  38655. tag: 'td'
  38656. }, {
  38657. content: 'Jaco Pastorius',
  38658. tag: 'td'
  38659. }, {
  38660. content: (0,external_wp_i18n_namespaceObject.__)('May 7, 2019'),
  38661. tag: 'td'
  38662. }]
  38663. }, {
  38664. cells: [{
  38665. content: '5.1',
  38666. tag: 'td'
  38667. }, {
  38668. content: 'Betty Carter',
  38669. tag: 'td'
  38670. }, {
  38671. content: (0,external_wp_i18n_namespaceObject.__)('February 21, 2019'),
  38672. tag: 'td'
  38673. }]
  38674. }, {
  38675. cells: [{
  38676. content: '5.0',
  38677. tag: 'td'
  38678. }, {
  38679. content: 'Bebo Valdés',
  38680. tag: 'td'
  38681. }, {
  38682. content: (0,external_wp_i18n_namespaceObject.__)('December 6, 2018'),
  38683. tag: 'td'
  38684. }]
  38685. }]
  38686. }
  38687. },
  38688. transforms: table_transforms,
  38689. edit: table_edit,
  38690. save: table_save_save,
  38691. deprecated: table_deprecated
  38692. };
  38693. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/tag-cloud/transforms.js
  38694. /**
  38695. * WordPress dependencies
  38696. */
  38697. const tag_cloud_transforms_transforms = {
  38698. from: [{
  38699. type: 'block',
  38700. blocks: ['core/categories'],
  38701. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/tag-cloud')
  38702. }],
  38703. to: [{
  38704. type: 'block',
  38705. blocks: ['core/categories'],
  38706. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/categories')
  38707. }]
  38708. };
  38709. /* harmony default export */ var tag_cloud_transforms = (tag_cloud_transforms_transforms);
  38710. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/tag-cloud/edit.js
  38711. /**
  38712. * External dependencies
  38713. */
  38714. /**
  38715. * WordPress dependencies
  38716. */
  38717. /**
  38718. * Minimum number of tags a user can show using this block.
  38719. *
  38720. * @type {number}
  38721. */
  38722. const MIN_TAGS = 1;
  38723. /**
  38724. * Maximum number of tags a user can show using this block.
  38725. *
  38726. * @type {number}
  38727. */
  38728. const MAX_TAGS = 100;
  38729. const MIN_FONT_SIZE = 0.1;
  38730. const MAX_FONT_SIZE = 100;
  38731. function TagCloudEdit(_ref) {
  38732. let {
  38733. attributes,
  38734. setAttributes,
  38735. taxonomies
  38736. } = _ref;
  38737. const {
  38738. taxonomy,
  38739. showTagCounts,
  38740. numberOfTags,
  38741. smallestFontSize,
  38742. largestFontSize
  38743. } = attributes;
  38744. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  38745. availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || ['%', 'px', 'em', 'rem']
  38746. });
  38747. const getTaxonomyOptions = () => {
  38748. const selectOption = {
  38749. label: (0,external_wp_i18n_namespaceObject.__)('- Select -'),
  38750. value: '',
  38751. disabled: true
  38752. };
  38753. const taxonomyOptions = (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(taxonomies, 'show_cloud'), item => {
  38754. return {
  38755. value: item.slug,
  38756. label: item.name
  38757. };
  38758. });
  38759. return [selectOption, ...taxonomyOptions];
  38760. };
  38761. const onFontSizeChange = (fontSizeLabel, newValue) => {
  38762. // eslint-disable-next-line @wordpress/no-unused-vars-before-return
  38763. const [quantity, newUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(newValue);
  38764. if (!Number.isFinite(quantity)) {
  38765. return;
  38766. }
  38767. const updateObj = {
  38768. [fontSizeLabel]: newValue
  38769. }; // We need to keep in sync the `unit` changes to both `smallestFontSize`
  38770. // and `largestFontSize` attributes.
  38771. Object.entries({
  38772. smallestFontSize,
  38773. largestFontSize
  38774. }).forEach(_ref2 => {
  38775. let [attribute, currentValue] = _ref2;
  38776. const [currentQuantity, currentUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(currentValue); // Only add an update if the other font size attribute has a different unit.
  38777. if (attribute !== fontSizeLabel && currentUnit !== newUnit) {
  38778. updateObj[attribute] = `${currentQuantity}${newUnit}`;
  38779. }
  38780. });
  38781. setAttributes(updateObj);
  38782. };
  38783. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  38784. title: (0,external_wp_i18n_namespaceObject.__)('Tag Cloud settings')
  38785. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  38786. label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy'),
  38787. options: getTaxonomyOptions(),
  38788. value: taxonomy,
  38789. onChange: selectedTaxonomy => setAttributes({
  38790. taxonomy: selectedTaxonomy
  38791. })
  38792. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  38793. label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'),
  38794. checked: showTagCounts,
  38795. onChange: () => setAttributes({
  38796. showTagCounts: !showTagCounts
  38797. })
  38798. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  38799. label: (0,external_wp_i18n_namespaceObject.__)('Number of tags'),
  38800. value: numberOfTags,
  38801. onChange: value => setAttributes({
  38802. numberOfTags: value
  38803. }),
  38804. min: MIN_TAGS,
  38805. max: MAX_TAGS,
  38806. required: true
  38807. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, {
  38808. isBlock: true
  38809. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  38810. label: (0,external_wp_i18n_namespaceObject.__)('Smallest size'),
  38811. value: smallestFontSize,
  38812. onChange: value => {
  38813. onFontSizeChange('smallestFontSize', value);
  38814. },
  38815. units: units,
  38816. min: MIN_FONT_SIZE,
  38817. max: MAX_FONT_SIZE
  38818. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, {
  38819. isBlock: true
  38820. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  38821. label: (0,external_wp_i18n_namespaceObject.__)('Largest size'),
  38822. value: largestFontSize,
  38823. onChange: value => {
  38824. onFontSizeChange('largestFontSize', value);
  38825. },
  38826. units: units,
  38827. min: MIN_FONT_SIZE,
  38828. max: MAX_FONT_SIZE
  38829. })))));
  38830. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
  38831. key: "tag-cloud",
  38832. block: "core/tag-cloud",
  38833. attributes: attributes
  38834. })));
  38835. }
  38836. /* harmony default export */ var tag_cloud_edit = ((0,external_wp_data_namespaceObject.withSelect)(select => {
  38837. return {
  38838. taxonomies: select(external_wp_coreData_namespaceObject.store).getTaxonomies({
  38839. per_page: -1
  38840. })
  38841. };
  38842. })(TagCloudEdit));
  38843. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js
  38844. /**
  38845. * WordPress dependencies
  38846. */
  38847. /**
  38848. * Internal dependencies
  38849. */
  38850. const tag_cloud_metadata = {
  38851. $schema: "https://schemas.wp.org/trunk/block.json",
  38852. apiVersion: 2,
  38853. name: "core/tag-cloud",
  38854. title: "Tag Cloud",
  38855. category: "widgets",
  38856. description: "A cloud of your most used tags.",
  38857. textdomain: "default",
  38858. attributes: {
  38859. numberOfTags: {
  38860. type: "number",
  38861. "default": 45,
  38862. minimum: 1,
  38863. maximum: 100
  38864. },
  38865. taxonomy: {
  38866. type: "string",
  38867. "default": "post_tag"
  38868. },
  38869. showTagCounts: {
  38870. type: "boolean",
  38871. "default": false
  38872. },
  38873. smallestFontSize: {
  38874. type: "string",
  38875. "default": "8pt"
  38876. },
  38877. largestFontSize: {
  38878. type: "string",
  38879. "default": "22pt"
  38880. }
  38881. },
  38882. styles: [{
  38883. name: "default",
  38884. label: "Default",
  38885. isDefault: true
  38886. }, {
  38887. name: "outline",
  38888. label: "Outline"
  38889. }],
  38890. supports: {
  38891. html: false,
  38892. align: true
  38893. },
  38894. editorStyle: "wp-block-tag-cloud-editor"
  38895. };
  38896. const {
  38897. name: tag_cloud_name
  38898. } = tag_cloud_metadata;
  38899. const tag_cloud_settings = {
  38900. icon: library_tag,
  38901. example: {},
  38902. edit: tag_cloud_edit,
  38903. transforms: tag_cloud_transforms
  38904. };
  38905. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js
  38906. /**
  38907. * WordPress dependencies
  38908. */
  38909. const symbolFilled = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  38910. xmlns: "http://www.w3.org/2000/svg",
  38911. viewBox: "0 0 24 24"
  38912. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  38913. d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"
  38914. }));
  38915. /* harmony default export */ var symbol_filled = (symbolFilled);
  38916. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/hooks.js
  38917. /**
  38918. * External dependencies
  38919. */
  38920. /**
  38921. * WordPress dependencies
  38922. */
  38923. /**
  38924. * Internal dependencies
  38925. */
  38926. /**
  38927. * Retrieves the available template parts for the given area.
  38928. *
  38929. * @param {string} area Template part area.
  38930. * @param {string} excludedId Template part ID to exclude.
  38931. *
  38932. * @return {{ templateParts: Array, isResolving: boolean }} array of template parts.
  38933. */
  38934. function useAlternativeTemplateParts(area, excludedId) {
  38935. const {
  38936. templateParts,
  38937. isResolving
  38938. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  38939. const {
  38940. getEntityRecords,
  38941. isResolving: _isResolving
  38942. } = select(external_wp_coreData_namespaceObject.store);
  38943. const query = {
  38944. per_page: -1
  38945. };
  38946. return {
  38947. templateParts: getEntityRecords('postType', 'wp_template_part', query),
  38948. isLoading: _isResolving('getEntityRecords', ['postType', 'wp_template_part', query])
  38949. };
  38950. }, []);
  38951. const filteredTemplateParts = (0,external_wp_element_namespaceObject.useMemo)(() => {
  38952. if (!templateParts) {
  38953. return [];
  38954. }
  38955. return templateParts.filter(templatePart => createTemplatePartId(templatePart.theme, templatePart.slug) !== excludedId && (!area || 'uncategorized' === area || templatePart.area === area)) || [];
  38956. }, [templateParts, area]);
  38957. return {
  38958. templateParts: filteredTemplateParts,
  38959. isResolving
  38960. };
  38961. }
  38962. /**
  38963. * Retrieves the available block patterns for the given area.
  38964. *
  38965. * @param {string} area Template part area.
  38966. * @param {string} clientId Block Client ID. (The container of the block can impact allowed blocks).
  38967. *
  38968. * @return {Array} array of block patterns.
  38969. */
  38970. function useAlternativeBlockPatterns(area, clientId) {
  38971. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  38972. const blockNameWithArea = area ? `core/template-part/${area}` : 'core/template-part';
  38973. const {
  38974. getBlockRootClientId,
  38975. __experimentalGetPatternsByBlockTypes
  38976. } = select(external_wp_blockEditor_namespaceObject.store);
  38977. const rootClientId = getBlockRootClientId(clientId);
  38978. return __experimentalGetPatternsByBlockTypes(blockNameWithArea, rootClientId);
  38979. }, [area, clientId]);
  38980. }
  38981. function useCreateTemplatePartFromBlocks(area, setAttributes) {
  38982. const {
  38983. saveEntityRecord
  38984. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  38985. return async function () {
  38986. let blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  38987. let title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0,external_wp_i18n_namespaceObject.__)('Untitled Template Part');
  38988. // Currently template parts only allow latin chars.
  38989. // Fallback slug will receive suffix by default.
  38990. const cleanSlug = (0,external_lodash_namespaceObject.kebabCase)(title).replace(/[^\w-]+/g, '') || 'wp-custom-part'; // If we have `area` set from block attributes, means an exposed
  38991. // block variation was inserted. So add this prop to the template
  38992. // part entity on creation. Afterwards remove `area` value from
  38993. // block attributes.
  38994. const record = {
  38995. title,
  38996. slug: cleanSlug,
  38997. content: (0,external_wp_blocks_namespaceObject.serialize)(blocks),
  38998. // `area` is filterable on the server and defaults to `UNCATEGORIZED`
  38999. // if provided value is not allowed.
  39000. area
  39001. };
  39002. const templatePart = await saveEntityRecord('postType', 'wp_template_part', record);
  39003. setAttributes({
  39004. slug: templatePart.slug,
  39005. theme: templatePart.theme,
  39006. area: undefined
  39007. });
  39008. };
  39009. }
  39010. /**
  39011. * Retrieves the template part area object.
  39012. *
  39013. * @param {string} area Template part area identifier.
  39014. *
  39015. * @return {{icon: Object, label: string, tagName: string}} Template Part area.
  39016. */
  39017. function useTemplatePartArea(area) {
  39018. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  39019. var _selectedArea$area_ta;
  39020. // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
  39021. // Blocks can be loaded into a *non-post* block editor.
  39022. // eslint-disable-next-line @wordpress/data-no-store-string-literals
  39023. const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas();
  39024. const selectedArea = (0,external_lodash_namespaceObject.find)(definedAreas, {
  39025. area
  39026. });
  39027. const defaultArea = (0,external_lodash_namespaceObject.find)(definedAreas, {
  39028. area: 'uncategorized'
  39029. });
  39030. return {
  39031. icon: (selectedArea === null || selectedArea === void 0 ? void 0 : selectedArea.icon) || (defaultArea === null || defaultArea === void 0 ? void 0 : defaultArea.icon),
  39032. label: (selectedArea === null || selectedArea === void 0 ? void 0 : selectedArea.label) || (0,external_wp_i18n_namespaceObject.__)('Template Part'),
  39033. tagName: (_selectedArea$area_ta = selectedArea === null || selectedArea === void 0 ? void 0 : selectedArea.area_tag) !== null && _selectedArea$area_ta !== void 0 ? _selectedArea$area_ta : 'div'
  39034. };
  39035. }, [area]);
  39036. }
  39037. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/title-modal.js
  39038. /**
  39039. * WordPress dependencies
  39040. */
  39041. function TitleModal(_ref) {
  39042. let {
  39043. areaLabel,
  39044. onClose,
  39045. onSubmit
  39046. } = _ref;
  39047. // Restructure onCreate to set the blocks on local state.
  39048. // Add modal to confirm title and trigger onCreate.
  39049. const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)((0,external_wp_i18n_namespaceObject.__)('Untitled Template Part'));
  39050. const submitForCreation = event => {
  39051. event.preventDefault();
  39052. onSubmit(title);
  39053. };
  39054. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
  39055. title: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
  39056. (0,external_wp_i18n_namespaceObject.__)('Name and create your new %s'), areaLabel.toLowerCase()),
  39057. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
  39058. overlayClassName: "wp-block-template-part__placeholder-create-new__title-form",
  39059. onRequestClose: onClose
  39060. }, (0,external_wp_element_namespaceObject.createElement)("form", {
  39061. onSubmit: submitForCreation
  39062. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  39063. label: (0,external_wp_i18n_namespaceObject.__)('Name'),
  39064. value: title,
  39065. onChange: setTitle
  39066. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
  39067. className: "wp-block-template-part__placeholder-create-new__title-form-actions",
  39068. justify: "flex-end"
  39069. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  39070. variant: "primary",
  39071. type: "submit",
  39072. disabled: !title.length,
  39073. "aria-disabled": !title.length
  39074. }, (0,external_wp_i18n_namespaceObject.__)('Create'))))));
  39075. }
  39076. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/placeholder.js
  39077. /**
  39078. * WordPress dependencies
  39079. */
  39080. /**
  39081. * Internal dependencies
  39082. */
  39083. function TemplatePartPlaceholder(_ref) {
  39084. let {
  39085. area,
  39086. clientId,
  39087. templatePartId,
  39088. onOpenSelectionModal,
  39089. setAttributes
  39090. } = _ref;
  39091. const {
  39092. templateParts,
  39093. isResolving
  39094. } = useAlternativeTemplateParts(area, templatePartId);
  39095. const blockPatterns = useAlternativeBlockPatterns(area, clientId);
  39096. const [showTitleModal, setShowTitleModal] = (0,external_wp_element_namespaceObject.useState)(false);
  39097. const areaObject = useTemplatePartArea(area);
  39098. const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes);
  39099. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  39100. icon: areaObject.icon,
  39101. label: areaObject.label,
  39102. instructions: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
  39103. (0,external_wp_i18n_namespaceObject.__)('Choose an existing %s or create a new one.'), areaObject.label.toLowerCase())
  39104. }, isResolving && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), !isResolving && !!(templateParts.length || blockPatterns.length) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  39105. variant: "primary",
  39106. onClick: onOpenSelectionModal
  39107. }, (0,external_wp_i18n_namespaceObject.__)('Choose')), !isResolving && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  39108. variant: "secondary",
  39109. onClick: () => {
  39110. setShowTitleModal(true);
  39111. }
  39112. }, (0,external_wp_i18n_namespaceObject.__)('Start blank')), showTitleModal && (0,external_wp_element_namespaceObject.createElement)(TitleModal, {
  39113. areaLabel: areaObject.label,
  39114. onClose: () => setShowTitleModal(false),
  39115. onSubmit: title => {
  39116. createFromBlocks([], title);
  39117. }
  39118. }));
  39119. }
  39120. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/selection-modal.js
  39121. /**
  39122. * WordPress dependencies
  39123. */
  39124. /**
  39125. * Internal dependencies
  39126. */
  39127. function TemplatePartSelectionModal(_ref) {
  39128. let {
  39129. setAttributes,
  39130. onClose,
  39131. templatePartId = null,
  39132. area,
  39133. clientId
  39134. } = _ref;
  39135. // When the templatePartId is undefined,
  39136. // it means the user is creating a new one from the placeholder.
  39137. const isReplacingTemplatePartContent = !!templatePartId;
  39138. const {
  39139. templateParts
  39140. } = useAlternativeTemplateParts(area, templatePartId); // We can map template parts to block patters to reuse the BlockPatternsList UI
  39141. const templartPartsAsBlockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => {
  39142. return templateParts.map(templatePart => ({
  39143. name: createTemplatePartId(templatePart.theme, templatePart.slug),
  39144. title: templatePart.title.rendered,
  39145. blocks: (0,external_wp_blocks_namespaceObject.parse)(templatePart.content.raw),
  39146. templatePart
  39147. }));
  39148. }, [templateParts]);
  39149. const shownTemplateParts = (0,external_wp_compose_namespaceObject.useAsyncList)(templartPartsAsBlockPatterns);
  39150. const {
  39151. createSuccessNotice
  39152. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  39153. const blockPatterns = useAlternativeBlockPatterns(area, clientId);
  39154. const shownBlockPatterns = (0,external_wp_compose_namespaceObject.useAsyncList)(blockPatterns);
  39155. const {
  39156. replaceInnerBlocks
  39157. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  39158. const onTemplatePartSelect = (0,external_wp_element_namespaceObject.useCallback)(templatePart => {
  39159. var _templatePart$title;
  39160. setAttributes({
  39161. slug: templatePart.slug,
  39162. theme: templatePart.theme,
  39163. area: undefined
  39164. });
  39165. createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
  39166. /* translators: %s: template part title. */
  39167. (0,external_wp_i18n_namespaceObject.__)('Template Part "%s" inserted.'), ((_templatePart$title = templatePart.title) === null || _templatePart$title === void 0 ? void 0 : _templatePart$title.rendered) || templatePart.slug), {
  39168. type: 'snackbar'
  39169. });
  39170. onClose();
  39171. }, []);
  39172. const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes);
  39173. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", {
  39174. className: "block-library-template-part__selection-content"
  39175. }, !!templartPartsAsBlockPatterns.length && (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)("h2", null, (0,external_wp_i18n_namespaceObject.__)('Existing template parts')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
  39176. blockPatterns: templartPartsAsBlockPatterns,
  39177. shownPatterns: shownTemplateParts,
  39178. onClickPattern: pattern => {
  39179. onTemplatePartSelect(pattern.templatePart);
  39180. }
  39181. })), !!blockPatterns.length && (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)("h2", null, (0,external_wp_i18n_namespaceObject.__)('Patterns')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
  39182. blockPatterns: blockPatterns,
  39183. shownPatterns: shownBlockPatterns,
  39184. onClickPattern: (pattern, blocks) => {
  39185. if (isReplacingTemplatePartContent) {
  39186. replaceInnerBlocks(clientId, blocks);
  39187. } else {
  39188. createFromBlocks(blocks, pattern.title);
  39189. }
  39190. onClose();
  39191. }
  39192. }))));
  39193. }
  39194. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/advanced-controls.js
  39195. /**
  39196. * WordPress dependencies
  39197. */
  39198. function TemplatePartAdvancedControls(_ref) {
  39199. let {
  39200. tagName,
  39201. setAttributes,
  39202. isEntityAvailable,
  39203. templatePartId,
  39204. defaultWrapper
  39205. } = _ref;
  39206. const [area, setArea] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_template_part', 'area', templatePartId);
  39207. const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_template_part', 'title', templatePartId);
  39208. const {
  39209. areaOptions
  39210. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  39211. // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
  39212. // Blocks can be loaded into a *non-post* block editor.
  39213. // eslint-disable-next-line @wordpress/data-no-store-string-literals
  39214. const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas();
  39215. return {
  39216. areaOptions: definedAreas.map(_ref2 => {
  39217. let {
  39218. label,
  39219. area: _area
  39220. } = _ref2;
  39221. return {
  39222. label,
  39223. value: _area
  39224. };
  39225. })
  39226. };
  39227. }, []);
  39228. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  39229. __experimentalGroup: "advanced"
  39230. }, isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  39231. label: (0,external_wp_i18n_namespaceObject.__)('Title'),
  39232. value: title,
  39233. onChange: value => {
  39234. setTitle(value);
  39235. },
  39236. onFocus: event => event.target.select()
  39237. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  39238. label: (0,external_wp_i18n_namespaceObject.__)('Area'),
  39239. labelPosition: "top",
  39240. options: areaOptions,
  39241. value: area,
  39242. onChange: setArea
  39243. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  39244. label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
  39245. options: [{
  39246. label: (0,external_wp_i18n_namespaceObject.sprintf)(
  39247. /* translators: %s: HTML tag based on area. */
  39248. (0,external_wp_i18n_namespaceObject.__)('Default based on area (%s)'), `<${defaultWrapper}>`),
  39249. value: ''
  39250. }, {
  39251. label: '<header>',
  39252. value: 'header'
  39253. }, {
  39254. label: '<main>',
  39255. value: 'main'
  39256. }, {
  39257. label: '<section>',
  39258. value: 'section'
  39259. }, {
  39260. label: '<article>',
  39261. value: 'article'
  39262. }, {
  39263. label: '<aside>',
  39264. value: 'aside'
  39265. }, {
  39266. label: '<footer>',
  39267. value: 'footer'
  39268. }, {
  39269. label: '<div>',
  39270. value: 'div'
  39271. }],
  39272. value: tagName || '',
  39273. onChange: value => setAttributes({
  39274. tagName: value
  39275. })
  39276. }));
  39277. }
  39278. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/inner-blocks.js
  39279. /**
  39280. * WordPress dependencies
  39281. */
  39282. function TemplatePartInnerBlocks(_ref) {
  39283. let {
  39284. postId: id,
  39285. hasInnerBlocks,
  39286. layout,
  39287. tagName,
  39288. blockProps,
  39289. clientId
  39290. } = _ref;
  39291. const themeSupportsLayout = (0,external_wp_data_namespaceObject.useSelect)(select => {
  39292. var _getSettings;
  39293. const {
  39294. getSettings
  39295. } = select(external_wp_blockEditor_namespaceObject.store);
  39296. return (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout;
  39297. }, []);
  39298. const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
  39299. const usedLayout = !!layout && layout.inherit ? defaultLayout : layout;
  39300. const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_template_part', {
  39301. id
  39302. });
  39303. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  39304. value: blocks,
  39305. onInput,
  39306. onChange,
  39307. renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender,
  39308. __experimentalLayout: themeSupportsLayout ? usedLayout : undefined
  39309. });
  39310. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockContentOverlay, {
  39311. clientId: clientId,
  39312. tagName: tagName,
  39313. wrapperProps: innerBlocksProps
  39314. });
  39315. }
  39316. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/index.js
  39317. /**
  39318. * External dependencies
  39319. */
  39320. /**
  39321. * WordPress dependencies
  39322. */
  39323. /**
  39324. * Internal dependencies
  39325. */
  39326. function TemplatePartEdit(_ref) {
  39327. let {
  39328. attributes,
  39329. setAttributes,
  39330. clientId
  39331. } = _ref;
  39332. const {
  39333. slug,
  39334. theme,
  39335. tagName,
  39336. layout = {}
  39337. } = attributes;
  39338. const templatePartId = createTemplatePartId(theme, slug);
  39339. const [hasAlreadyRendered, RecursionProvider] = (0,external_wp_blockEditor_namespaceObject.__experimentalUseNoRecursiveRenders)(templatePartId);
  39340. const [isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen] = (0,external_wp_element_namespaceObject.useState)(false); // Set the postId block attribute if it did not exist,
  39341. // but wait until the inner blocks have loaded to allow
  39342. // new edits to trigger this.
  39343. const {
  39344. isResolved,
  39345. innerBlocks,
  39346. isMissing,
  39347. area
  39348. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  39349. const {
  39350. getEditedEntityRecord,
  39351. hasFinishedResolution
  39352. } = select(external_wp_coreData_namespaceObject.store);
  39353. const {
  39354. getBlocks
  39355. } = select(external_wp_blockEditor_namespaceObject.store);
  39356. const getEntityArgs = ['postType', 'wp_template_part', templatePartId];
  39357. const entityRecord = templatePartId ? getEditedEntityRecord(...getEntityArgs) : null;
  39358. const _area = (entityRecord === null || entityRecord === void 0 ? void 0 : entityRecord.area) || attributes.area;
  39359. const hasResolvedEntity = templatePartId ? hasFinishedResolution('getEditedEntityRecord', getEntityArgs) : false;
  39360. return {
  39361. innerBlocks: getBlocks(clientId),
  39362. isResolved: hasResolvedEntity,
  39363. isMissing: hasResolvedEntity && (0,external_lodash_namespaceObject.isEmpty)(entityRecord),
  39364. area: _area
  39365. };
  39366. }, [templatePartId, clientId]);
  39367. const {
  39368. templateParts
  39369. } = useAlternativeTemplateParts(area, templatePartId);
  39370. const blockPatterns = useAlternativeBlockPatterns(area, clientId);
  39371. const hasReplacements = !!templateParts.length || !!blockPatterns.length;
  39372. const areaObject = useTemplatePartArea(area);
  39373. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  39374. const isPlaceholder = !slug;
  39375. const isEntityAvailable = !isPlaceholder && !isMissing && isResolved;
  39376. const TagName = tagName || areaObject.tagName; // We don't want to render a missing state if we have any inner blocks.
  39377. // A new template part is automatically created if we have any inner blocks but no entity.
  39378. if (innerBlocks.length === 0 && (slug && !theme || slug && isMissing)) {
  39379. return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.sprintf)(
  39380. /* translators: %s: Template part slug */
  39381. (0,external_wp_i18n_namespaceObject.__)('Template part has been deleted or is unavailable: %s'), slug)));
  39382. }
  39383. if (isEntityAvailable && hasAlreadyRendered) {
  39384. return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
  39385. }
  39386. return (0,external_wp_element_namespaceObject.createElement)(RecursionProvider, null, (0,external_wp_element_namespaceObject.createElement)(TemplatePartAdvancedControls, {
  39387. tagName: tagName,
  39388. setAttributes: setAttributes,
  39389. isEntityAvailable: isEntityAvailable,
  39390. templatePartId: templatePartId,
  39391. defaultWrapper: areaObject.tagName
  39392. }), isPlaceholder && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(TemplatePartPlaceholder, {
  39393. area: attributes.area,
  39394. templatePartId: templatePartId,
  39395. clientId: clientId,
  39396. setAttributes: setAttributes,
  39397. onOpenSelectionModal: () => setIsTemplatePartSelectionOpen(true)
  39398. })), isEntityAvailable && hasReplacements && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
  39399. className: "wp-block-template-part__block-control-group"
  39400. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  39401. onClick: () => setIsTemplatePartSelectionOpen(true)
  39402. }, (0,external_wp_i18n_namespaceObject.__)('Replace')))), isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(TemplatePartInnerBlocks, {
  39403. clientId: clientId,
  39404. tagName: TagName,
  39405. blockProps: blockProps,
  39406. postId: templatePartId,
  39407. hasInnerBlocks: innerBlocks.length > 0,
  39408. layout: layout
  39409. }), !isPlaceholder && !isResolved && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)), isTemplatePartSelectionOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
  39410. className: "block-editor-template-part__selection-modal",
  39411. title: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
  39412. (0,external_wp_i18n_namespaceObject.__)('Choose a %s'), areaObject.label.toLowerCase()),
  39413. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
  39414. onRequestClose: () => setIsTemplatePartSelectionOpen(false)
  39415. }, (0,external_wp_element_namespaceObject.createElement)(TemplatePartSelectionModal, {
  39416. templatePartId: templatePartId,
  39417. clientId: clientId,
  39418. area: area,
  39419. setAttributes: setAttributes,
  39420. onClose: () => setIsTemplatePartSelectionOpen(false)
  39421. })));
  39422. }
  39423. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/header.js
  39424. /**
  39425. * WordPress dependencies
  39426. */
  39427. const header = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  39428. xmlns: "http://www.w3.org/2000/svg",
  39429. viewBox: "0 0 24 24"
  39430. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  39431. d: "M18.5 10.5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
  39432. }));
  39433. /* harmony default export */ var library_header = (header);
  39434. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/footer.js
  39435. /**
  39436. * WordPress dependencies
  39437. */
  39438. const footer = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  39439. xmlns: "http://www.w3.org/2000/svg",
  39440. viewBox: "0 0 24 24"
  39441. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  39442. fillRule: "evenodd",
  39443. d: "M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
  39444. }));
  39445. /* harmony default export */ var library_footer = (footer);
  39446. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/sidebar.js
  39447. /**
  39448. * WordPress dependencies
  39449. */
  39450. const sidebar = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  39451. xmlns: "http://www.w3.org/2000/svg",
  39452. viewBox: "0 0 24 24"
  39453. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  39454. d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
  39455. }));
  39456. /* harmony default export */ var library_sidebar = (sidebar);
  39457. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/fallback-variations.js
  39458. /**
  39459. * WordPress dependencies
  39460. */
  39461. const fallback_variations_fallbackVariations = [{
  39462. name: 'header',
  39463. icon: library_header,
  39464. title: (0,external_wp_i18n_namespaceObject.__)('Header'),
  39465. description: (0,external_wp_i18n_namespaceObject.__)('The Header template defines a page area that typically contains a title, logo, and main navigation.'),
  39466. attributes: {
  39467. area: 'header'
  39468. },
  39469. scope: ['inserter']
  39470. }, {
  39471. name: 'footer',
  39472. icon: library_footer,
  39473. title: (0,external_wp_i18n_namespaceObject.__)('Footer'),
  39474. description: (0,external_wp_i18n_namespaceObject.__)('The Footer template defines a page area that typically contains site credits, social links, or any other combination of blocks.'),
  39475. attributes: {
  39476. area: 'footer'
  39477. },
  39478. scope: ['inserter']
  39479. }];
  39480. fallback_variations_fallbackVariations.forEach(variation => {
  39481. if (variation.isActive) return;
  39482. variation.isActive = (blockAttributes, variationAttributes) => {
  39483. const {
  39484. area,
  39485. theme,
  39486. slug
  39487. } = blockAttributes; // We first check the `area` block attribute which is set during insertion.
  39488. // This property is removed on the creation of a template part.
  39489. if (area) return area === variationAttributes.area; // Find a matching variation from the created template part
  39490. // by checking the entity's `area` property.
  39491. if (!slug) return false;
  39492. const entity = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template_part', `${theme}//${slug}`);
  39493. return (entity === null || entity === void 0 ? void 0 : entity.area) === variationAttributes.area;
  39494. };
  39495. });
  39496. /* harmony default export */ var template_part_fallback_variations = (fallback_variations_fallbackVariations);
  39497. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/variations.js
  39498. /**
  39499. * WordPress dependencies
  39500. */
  39501. /**
  39502. * Internal dependencies
  39503. */
  39504. function getTemplatePartIcon(iconName) {
  39505. if ('header' === iconName) {
  39506. return library_header;
  39507. } else if ('footer' === iconName) {
  39508. return library_footer;
  39509. } else if ('sidebar' === iconName) {
  39510. return library_sidebar;
  39511. }
  39512. return symbol_filled;
  39513. }
  39514. function enhanceTemplatePartVariations(settings, name) {
  39515. if (name !== 'core/template-part') {
  39516. return settings;
  39517. } // WordPress versions pre-5.8 do not support server side variation registration.
  39518. // So we must register the fallback variations until those versions are no longer supported.
  39519. if (!(settings.variations && settings.variations.length)) {
  39520. return { ...settings,
  39521. variations: template_part_fallback_variations
  39522. };
  39523. }
  39524. if (settings.variations) {
  39525. const isActive = (blockAttributes, variationAttributes) => {
  39526. const {
  39527. area,
  39528. theme,
  39529. slug
  39530. } = blockAttributes; // We first check the `area` block attribute which is set during insertion.
  39531. // This property is removed on the creation of a template part.
  39532. if (area) return area === variationAttributes.area; // Find a matching variation from the created template part
  39533. // by checking the entity's `area` property.
  39534. if (!slug) return false;
  39535. const entity = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template_part', `${theme}//${slug}`);
  39536. return (entity === null || entity === void 0 ? void 0 : entity.area) === variationAttributes.area;
  39537. };
  39538. const variations = settings.variations.map(variation => {
  39539. return { ...variation,
  39540. ...(!variation.isActive && {
  39541. isActive
  39542. }),
  39543. ...(typeof variation.icon === 'string' && {
  39544. icon: getTemplatePartIcon(variation.icon)
  39545. })
  39546. };
  39547. });
  39548. return { ...settings,
  39549. variations
  39550. };
  39551. }
  39552. return settings;
  39553. }
  39554. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/index.js
  39555. /**
  39556. * External dependencies
  39557. */
  39558. /**
  39559. * WordPress dependencies
  39560. */
  39561. /**
  39562. * Internal dependencies
  39563. */
  39564. const template_part_metadata = {
  39565. $schema: "https://schemas.wp.org/trunk/block.json",
  39566. apiVersion: 2,
  39567. name: "core/template-part",
  39568. title: "Template Part",
  39569. category: "theme",
  39570. description: "Edit the different global regions of your site, like the header, footer, sidebar, or create your own.",
  39571. textdomain: "default",
  39572. attributes: {
  39573. slug: {
  39574. type: "string"
  39575. },
  39576. theme: {
  39577. type: "string"
  39578. },
  39579. tagName: {
  39580. type: "string"
  39581. },
  39582. area: {
  39583. type: "string"
  39584. }
  39585. },
  39586. supports: {
  39587. align: true,
  39588. html: false,
  39589. reusable: false
  39590. },
  39591. editorStyle: "wp-block-template-part-editor"
  39592. };
  39593. const {
  39594. name: template_part_name
  39595. } = template_part_metadata;
  39596. const template_part_settings = {
  39597. icon: symbol_filled,
  39598. __experimentalLabel: _ref => {
  39599. var _entity$title;
  39600. let {
  39601. slug,
  39602. theme
  39603. } = _ref;
  39604. // Attempt to find entity title if block is a template part.
  39605. // Require slug to request, otherwise entity is uncreated and will throw 404.
  39606. if (!slug) {
  39607. return;
  39608. }
  39609. const entity = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template_part', theme + '//' + slug);
  39610. if (!entity) {
  39611. return;
  39612. }
  39613. return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)((_entity$title = entity.title) === null || _entity$title === void 0 ? void 0 : _entity$title.rendered) || (0,external_lodash_namespaceObject.startCase)(entity.slug);
  39614. },
  39615. edit: TemplatePartEdit
  39616. }; // Importing this file includes side effects. This is whitelisted in block-library/package.json under sideEffects
  39617. (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/template-part', enhanceTemplatePartVariations); // Prevent adding template parts inside post templates.
  39618. const DISALLOWED_PARENTS = ['core/post-template', 'core/post-content'];
  39619. (0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'removeTemplatePartsFromPostTemplates', (can, blockType, rootClientId, _ref2) => {
  39620. let {
  39621. getBlock,
  39622. getBlockParentsByBlockName
  39623. } = _ref2;
  39624. if (blockType.name !== 'core/template-part') {
  39625. return can;
  39626. }
  39627. for (const disallowedParentType of DISALLOWED_PARENTS) {
  39628. var _getBlock;
  39629. const hasDisallowedParent = ((_getBlock = getBlock(rootClientId)) === null || _getBlock === void 0 ? void 0 : _getBlock.name) === disallowedParentType || getBlockParentsByBlockName(rootClientId, disallowedParentType).length;
  39630. if (hasDisallowedParent) {
  39631. return false;
  39632. }
  39633. }
  39634. return true;
  39635. });
  39636. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/term-description.js
  39637. /**
  39638. * WordPress dependencies
  39639. */
  39640. const term_description_tag = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  39641. xmlns: "http://www.w3.org/2000/svg",
  39642. viewBox: "0 0 24 24"
  39643. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  39644. d: "M6.08 10.103h2.914L9.657 12h1.417L8.23 4H6.846L4 12h1.417l.663-1.897Zm1.463-4.137.994 2.857h-2l1.006-2.857ZM11 16H4v-1.5h7V16Zm1 0h8v-1.5h-8V16Zm-4 4H4v-1.5h4V20Zm7-1.5V20H9v-1.5h6Z"
  39645. }));
  39646. /* harmony default export */ var term_description = (term_description_tag);
  39647. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/term-description/edit.js
  39648. /**
  39649. * External dependencies
  39650. */
  39651. /**
  39652. * WordPress dependencies
  39653. */
  39654. function TermDescriptionEdit(_ref) {
  39655. let {
  39656. attributes,
  39657. setAttributes,
  39658. mergedStyle
  39659. } = _ref;
  39660. const {
  39661. textAlign
  39662. } = attributes;
  39663. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  39664. className: classnames_default()({
  39665. [`has-text-align-${textAlign}`]: textAlign
  39666. }),
  39667. style: mergedStyle
  39668. });
  39669. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  39670. group: "block"
  39671. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  39672. value: textAlign,
  39673. onChange: nextAlign => {
  39674. setAttributes({
  39675. textAlign: nextAlign
  39676. });
  39677. }
  39678. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("div", {
  39679. className: "wp-block-term-description__placeholder"
  39680. }, (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Term Description')))));
  39681. }
  39682. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/term-description/index.js
  39683. /**
  39684. * WordPress dependencies
  39685. */
  39686. /**
  39687. * Internal dependencies
  39688. */
  39689. const term_description_metadata = {
  39690. $schema: "https://schemas.wp.org/trunk/block.json",
  39691. apiVersion: 2,
  39692. name: "core/term-description",
  39693. title: "Term Description",
  39694. category: "theme",
  39695. description: "Display the description of categories, tags and custom taxonomies when viewing an archive.",
  39696. textdomain: "default",
  39697. attributes: {
  39698. textAlign: {
  39699. type: "string"
  39700. }
  39701. },
  39702. supports: {
  39703. align: ["wide", "full"],
  39704. html: false,
  39705. color: {
  39706. link: true,
  39707. __experimentalDefaultControls: {
  39708. background: true,
  39709. text: true
  39710. }
  39711. },
  39712. typography: {
  39713. fontSize: true,
  39714. lineHeight: true,
  39715. __experimentalDefaultControls: {
  39716. fontSize: true
  39717. }
  39718. }
  39719. },
  39720. editorStyle: "wp-block-term-description-editor"
  39721. };
  39722. const {
  39723. name: term_description_name
  39724. } = term_description_metadata;
  39725. const term_description_settings = {
  39726. icon: term_description,
  39727. edit: TermDescriptionEdit
  39728. };
  39729. ;// CONCATENATED MODULE: external ["wp","deprecated"]
  39730. var external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
  39731. var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
  39732. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/edit.js
  39733. /**
  39734. * External dependencies
  39735. */
  39736. /**
  39737. * WordPress dependencies
  39738. */
  39739. function TextColumnsEdit(_ref) {
  39740. let {
  39741. attributes,
  39742. setAttributes
  39743. } = _ref;
  39744. const {
  39745. width,
  39746. content,
  39747. columns
  39748. } = attributes;
  39749. external_wp_deprecated_default()('The Text Columns block', {
  39750. since: '5.3',
  39751. alternative: 'the Columns block'
  39752. });
  39753. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentToolbar, {
  39754. value: width,
  39755. onChange: nextWidth => setAttributes({
  39756. width: nextWidth
  39757. }),
  39758. controls: ['center', 'wide', 'full']
  39759. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  39760. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  39761. value: columns,
  39762. onChange: value => setAttributes({
  39763. columns: value
  39764. }),
  39765. min: 2,
  39766. max: 4,
  39767. required: true
  39768. }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  39769. className: `align${width} columns-${columns}`
  39770. }), (0,external_lodash_namespaceObject.times)(columns, index => {
  39771. return (0,external_wp_element_namespaceObject.createElement)("div", {
  39772. className: "wp-block-column",
  39773. key: `column-${index}`
  39774. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  39775. tagName: "p",
  39776. value: (0,external_lodash_namespaceObject.get)(content, [index, 'children']),
  39777. onChange: nextContent => {
  39778. setAttributes({
  39779. content: [...content.slice(0, index), {
  39780. children: nextContent
  39781. }, ...content.slice(index + 1)]
  39782. });
  39783. },
  39784. "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %d: column index (starting with 1)
  39785. (0,external_wp_i18n_namespaceObject.__)('Column %d text'), index + 1),
  39786. placeholder: (0,external_wp_i18n_namespaceObject.__)('New Column')
  39787. }));
  39788. })));
  39789. }
  39790. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/save.js
  39791. /**
  39792. * External dependencies
  39793. */
  39794. /**
  39795. * WordPress dependencies
  39796. */
  39797. function text_columns_save_save(_ref) {
  39798. let {
  39799. attributes
  39800. } = _ref;
  39801. const {
  39802. width,
  39803. content,
  39804. columns
  39805. } = attributes;
  39806. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  39807. className: `align${width} columns-${columns}`
  39808. }), (0,external_lodash_namespaceObject.times)(columns, index => (0,external_wp_element_namespaceObject.createElement)("div", {
  39809. className: "wp-block-column",
  39810. key: `column-${index}`
  39811. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  39812. tagName: "p",
  39813. value: (0,external_lodash_namespaceObject.get)(content, [index, 'children'])
  39814. }))));
  39815. }
  39816. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/transforms.js
  39817. /**
  39818. * WordPress dependencies
  39819. */
  39820. const text_columns_transforms_transforms = {
  39821. to: [{
  39822. type: 'block',
  39823. blocks: ['core/columns'],
  39824. transform: _ref => {
  39825. let {
  39826. className,
  39827. columns,
  39828. content,
  39829. width
  39830. } = _ref;
  39831. return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', {
  39832. align: 'wide' === width || 'full' === width ? width : undefined,
  39833. className,
  39834. columns
  39835. }, content.map(_ref2 => {
  39836. let {
  39837. children
  39838. } = _ref2;
  39839. return (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  39840. content: children
  39841. })]);
  39842. }));
  39843. }
  39844. }]
  39845. };
  39846. /* harmony default export */ var text_columns_transforms = (text_columns_transforms_transforms);
  39847. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js
  39848. /**
  39849. * Internal dependencies
  39850. */
  39851. const text_columns_metadata = {
  39852. $schema: "https://schemas.wp.org/trunk/block.json",
  39853. apiVersion: 2,
  39854. name: "core/text-columns",
  39855. title: "Text Columns (deprecated)",
  39856. icon: "columns",
  39857. category: "design",
  39858. description: "This block is deprecated. Please use the Columns block instead.",
  39859. textdomain: "default",
  39860. attributes: {
  39861. content: {
  39862. type: "array",
  39863. source: "query",
  39864. selector: "p",
  39865. query: {
  39866. children: {
  39867. type: "string",
  39868. source: "html"
  39869. }
  39870. },
  39871. "default": [{}, {}]
  39872. },
  39873. columns: {
  39874. type: "number",
  39875. "default": 2
  39876. },
  39877. width: {
  39878. type: "string"
  39879. }
  39880. },
  39881. supports: {
  39882. inserter: false
  39883. },
  39884. editorStyle: "wp-block-text-columns-editor",
  39885. style: "wp-block-text-columns"
  39886. };
  39887. const {
  39888. name: text_columns_name
  39889. } = text_columns_metadata;
  39890. const text_columns_settings = {
  39891. transforms: text_columns_transforms,
  39892. getEditWrapperProps(attributes) {
  39893. const {
  39894. width
  39895. } = attributes;
  39896. if ('wide' === width || 'full' === width) {
  39897. return {
  39898. 'data-align': width
  39899. };
  39900. }
  39901. },
  39902. edit: TextColumnsEdit,
  39903. save: text_columns_save_save
  39904. };
  39905. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/verse.js
  39906. /**
  39907. * WordPress dependencies
  39908. */
  39909. const verse = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  39910. viewBox: "0 0 24 24",
  39911. xmlns: "http://www.w3.org/2000/svg"
  39912. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  39913. d: "M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"
  39914. }));
  39915. /* harmony default export */ var library_verse = (verse);
  39916. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/deprecated.js
  39917. /**
  39918. * External dependencies
  39919. */
  39920. /**
  39921. * WordPress dependencies
  39922. */
  39923. /**
  39924. * Internal dependencies
  39925. */
  39926. const verse_deprecated_v1 = {
  39927. attributes: {
  39928. content: {
  39929. type: 'string',
  39930. source: 'html',
  39931. selector: 'pre',
  39932. default: ''
  39933. },
  39934. textAlign: {
  39935. type: 'string'
  39936. }
  39937. },
  39938. save(_ref) {
  39939. let {
  39940. attributes
  39941. } = _ref;
  39942. const {
  39943. textAlign,
  39944. content
  39945. } = attributes;
  39946. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  39947. tagName: "pre",
  39948. style: {
  39949. textAlign
  39950. },
  39951. value: content
  39952. });
  39953. }
  39954. };
  39955. const verse_deprecated_v2 = {
  39956. attributes: {
  39957. content: {
  39958. type: 'string',
  39959. source: 'html',
  39960. selector: 'pre',
  39961. default: '',
  39962. __unstablePreserveWhiteSpace: true,
  39963. __experimentalRole: 'content'
  39964. },
  39965. textAlign: {
  39966. type: 'string'
  39967. }
  39968. },
  39969. supports: {
  39970. anchor: true,
  39971. color: {
  39972. gradients: true,
  39973. link: true
  39974. },
  39975. typography: {
  39976. fontSize: true,
  39977. __experimentalFontFamily: true
  39978. },
  39979. spacing: {
  39980. padding: true
  39981. }
  39982. },
  39983. save(_ref2) {
  39984. let {
  39985. attributes
  39986. } = _ref2;
  39987. const {
  39988. textAlign,
  39989. content
  39990. } = attributes;
  39991. const className = classnames_default()({
  39992. [`has-text-align-${textAlign}`]: textAlign
  39993. });
  39994. return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  39995. className
  39996. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  39997. value: content
  39998. }));
  39999. },
  40000. migrate: migrate_font_family,
  40001. isEligible(_ref3) {
  40002. var _style$typography;
  40003. let {
  40004. style
  40005. } = _ref3;
  40006. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  40007. }
  40008. };
  40009. /**
  40010. * New deprecations need to be placed first
  40011. * for them to have higher priority.
  40012. *
  40013. * Old deprecations may need to be updated as well.
  40014. *
  40015. * See block-deprecation.md
  40016. */
  40017. /* harmony default export */ var verse_deprecated = ([verse_deprecated_v2, verse_deprecated_v1]);
  40018. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/edit.js
  40019. /**
  40020. * External dependencies
  40021. */
  40022. /**
  40023. * WordPress dependencies
  40024. */
  40025. function VerseEdit(_ref) {
  40026. let {
  40027. attributes,
  40028. setAttributes,
  40029. mergeBlocks,
  40030. onRemove,
  40031. style
  40032. } = _ref;
  40033. const {
  40034. textAlign,
  40035. content
  40036. } = attributes;
  40037. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  40038. className: classnames_default()({
  40039. [`has-text-align-${textAlign}`]: textAlign
  40040. }),
  40041. style
  40042. });
  40043. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, {
  40044. value: textAlign,
  40045. onChange: nextAlign => {
  40046. setAttributes({
  40047. textAlign: nextAlign
  40048. });
  40049. }
  40050. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  40051. tagName: "pre",
  40052. identifier: "content",
  40053. preserveWhiteSpace: true,
  40054. value: content,
  40055. onChange: nextContent => {
  40056. setAttributes({
  40057. content: nextContent
  40058. });
  40059. },
  40060. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Verse text'),
  40061. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write verse…'),
  40062. onRemove: onRemove,
  40063. onMerge: mergeBlocks,
  40064. textAlign: textAlign
  40065. }, blockProps, {
  40066. __unstablePastePlainText: true
  40067. })));
  40068. }
  40069. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/save.js
  40070. /**
  40071. * External dependencies
  40072. */
  40073. /**
  40074. * WordPress dependencies
  40075. */
  40076. function verse_save_save(_ref) {
  40077. let {
  40078. attributes
  40079. } = _ref;
  40080. const {
  40081. textAlign,
  40082. content
  40083. } = attributes;
  40084. const className = classnames_default()({
  40085. [`has-text-align-${textAlign}`]: textAlign
  40086. });
  40087. return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  40088. className
  40089. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  40090. value: content
  40091. }));
  40092. }
  40093. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/transforms.js
  40094. /**
  40095. * WordPress dependencies
  40096. */
  40097. const verse_transforms_transforms = {
  40098. from: [{
  40099. type: 'block',
  40100. blocks: ['core/paragraph'],
  40101. transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/verse', attributes)
  40102. }],
  40103. to: [{
  40104. type: 'block',
  40105. blocks: ['core/paragraph'],
  40106. transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes)
  40107. }]
  40108. };
  40109. /* harmony default export */ var verse_transforms = (verse_transforms_transforms);
  40110. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/index.js
  40111. /**
  40112. * WordPress dependencies
  40113. */
  40114. /**
  40115. * Internal dependencies
  40116. */
  40117. const verse_metadata = {
  40118. $schema: "https://schemas.wp.org/trunk/block.json",
  40119. apiVersion: 2,
  40120. name: "core/verse",
  40121. title: "Verse",
  40122. category: "text",
  40123. description: "Insert poetry. Use special spacing formats. Or quote song lyrics.",
  40124. keywords: ["poetry", "poem"],
  40125. textdomain: "default",
  40126. attributes: {
  40127. content: {
  40128. type: "string",
  40129. source: "html",
  40130. selector: "pre",
  40131. "default": "",
  40132. __unstablePreserveWhiteSpace: true,
  40133. __experimentalRole: "content"
  40134. },
  40135. textAlign: {
  40136. type: "string"
  40137. }
  40138. },
  40139. supports: {
  40140. anchor: true,
  40141. color: {
  40142. gradients: true,
  40143. link: true,
  40144. __experimentalDefaultControls: {
  40145. background: true,
  40146. text: true
  40147. }
  40148. },
  40149. typography: {
  40150. fontSize: true,
  40151. __experimentalFontFamily: true,
  40152. lineHeight: true,
  40153. __experimentalFontStyle: true,
  40154. __experimentalFontWeight: true,
  40155. __experimentalLetterSpacing: true,
  40156. __experimentalTextTransform: true,
  40157. __experimentalDefaultControls: {
  40158. fontSize: true,
  40159. fontAppearance: true
  40160. }
  40161. },
  40162. spacing: {
  40163. padding: true
  40164. }
  40165. },
  40166. style: "wp-block-verse",
  40167. editorStyle: "wp-block-verse-editor"
  40168. };
  40169. const {
  40170. name: verse_name
  40171. } = verse_metadata;
  40172. const verse_settings = {
  40173. icon: library_verse,
  40174. example: {
  40175. attributes: {
  40176. /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */
  40177. // translators: Sample content for the Verse block. Can be replaced with a more locale-adequate work.
  40178. content: (0,external_wp_i18n_namespaceObject.__)('WHAT was he doing, the great god Pan,\n Down in the reeds by the river?\nSpreading ruin and scattering ban,\nSplashing and paddling with hoofs of a goat,\nAnd breaking the golden lilies afloat\n With the dragon-fly on the river.')
  40179. /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */
  40180. }
  40181. },
  40182. transforms: verse_transforms,
  40183. deprecated: verse_deprecated,
  40184. merge(attributes, attributesToMerge) {
  40185. return {
  40186. content: attributes.content + attributesToMerge.content
  40187. };
  40188. },
  40189. edit: VerseEdit,
  40190. save: verse_save_save
  40191. };
  40192. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/video.js
  40193. /**
  40194. * WordPress dependencies
  40195. */
  40196. const video = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  40197. viewBox: "0 0 24 24",
  40198. xmlns: "http://www.w3.org/2000/svg"
  40199. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  40200. d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"
  40201. }));
  40202. /* harmony default export */ var library_video = (video);
  40203. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/edit-common-settings.js
  40204. /**
  40205. * WordPress dependencies
  40206. */
  40207. const options = [{
  40208. value: 'auto',
  40209. label: (0,external_wp_i18n_namespaceObject.__)('Auto')
  40210. }, {
  40211. value: 'metadata',
  40212. label: (0,external_wp_i18n_namespaceObject.__)('Metadata')
  40213. }, {
  40214. value: 'none',
  40215. label: (0,external_wp_i18n_namespaceObject._x)('None', 'Preload value')
  40216. }];
  40217. const VideoSettings = _ref => {
  40218. let {
  40219. setAttributes,
  40220. attributes
  40221. } = _ref;
  40222. const {
  40223. autoplay,
  40224. controls,
  40225. loop,
  40226. muted,
  40227. playsInline,
  40228. preload
  40229. } = attributes;
  40230. const autoPlayHelpText = (0,external_wp_i18n_namespaceObject.__)('Autoplay may cause usability issues for some users.');
  40231. const getAutoplayHelp = external_wp_element_namespaceObject.Platform.select({
  40232. web: (0,external_wp_element_namespaceObject.useCallback)(checked => {
  40233. return checked ? autoPlayHelpText : null;
  40234. }, []),
  40235. native: autoPlayHelpText
  40236. });
  40237. const toggleFactory = (0,external_wp_element_namespaceObject.useMemo)(() => {
  40238. const toggleAttribute = attribute => {
  40239. return newValue => {
  40240. setAttributes({
  40241. [attribute]: newValue
  40242. });
  40243. };
  40244. };
  40245. return {
  40246. autoplay: toggleAttribute('autoplay'),
  40247. loop: toggleAttribute('loop'),
  40248. muted: toggleAttribute('muted'),
  40249. controls: toggleAttribute('controls'),
  40250. playsInline: toggleAttribute('playsInline')
  40251. };
  40252. }, []);
  40253. const onChangePreload = (0,external_wp_element_namespaceObject.useCallback)(value => {
  40254. setAttributes({
  40255. preload: value
  40256. });
  40257. }, []);
  40258. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  40259. label: (0,external_wp_i18n_namespaceObject.__)('Autoplay'),
  40260. onChange: toggleFactory.autoplay,
  40261. checked: autoplay,
  40262. help: getAutoplayHelp
  40263. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  40264. label: (0,external_wp_i18n_namespaceObject.__)('Loop'),
  40265. onChange: toggleFactory.loop,
  40266. checked: loop
  40267. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  40268. label: (0,external_wp_i18n_namespaceObject.__)('Muted'),
  40269. onChange: toggleFactory.muted,
  40270. checked: muted
  40271. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  40272. label: (0,external_wp_i18n_namespaceObject.__)('Playback controls'),
  40273. onChange: toggleFactory.controls,
  40274. checked: controls
  40275. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  40276. label: (0,external_wp_i18n_namespaceObject.__)('Play inline'),
  40277. onChange: toggleFactory.playsInline,
  40278. checked: playsInline
  40279. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  40280. label: (0,external_wp_i18n_namespaceObject.__)('Preload'),
  40281. value: preload,
  40282. onChange: onChangePreload,
  40283. options: options,
  40284. hideCancelButton: true
  40285. }));
  40286. };
  40287. /* harmony default export */ var edit_common_settings = (VideoSettings);
  40288. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/media.js
  40289. /**
  40290. * WordPress dependencies
  40291. */
  40292. const media = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  40293. xmlns: "http://www.w3.org/2000/svg",
  40294. viewBox: "0 0 24 24"
  40295. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  40296. d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"
  40297. }));
  40298. /* harmony default export */ var library_media = (media);
  40299. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/tracks-editor.js
  40300. /**
  40301. * WordPress dependencies
  40302. */
  40303. const ALLOWED_TYPES = ['text/vtt'];
  40304. const DEFAULT_KIND = 'subtitles';
  40305. const KIND_OPTIONS = [{
  40306. label: (0,external_wp_i18n_namespaceObject.__)('Subtitles'),
  40307. value: 'subtitles'
  40308. }, {
  40309. label: (0,external_wp_i18n_namespaceObject.__)('Captions'),
  40310. value: 'captions'
  40311. }, {
  40312. label: (0,external_wp_i18n_namespaceObject.__)('Descriptions'),
  40313. value: 'descriptions'
  40314. }, {
  40315. label: (0,external_wp_i18n_namespaceObject.__)('Chapters'),
  40316. value: 'chapters'
  40317. }, {
  40318. label: (0,external_wp_i18n_namespaceObject.__)('Metadata'),
  40319. value: 'metadata'
  40320. }];
  40321. const captionIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  40322. width: "18",
  40323. height: "14",
  40324. viewBox: "0 0 18 14",
  40325. role: "img",
  40326. fill: "none"
  40327. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  40328. x: "0.75",
  40329. y: "0.75",
  40330. width: "16.5",
  40331. height: "12.5",
  40332. rx: "1.25",
  40333. stroke: "black",
  40334. strokeWidth: "1.5",
  40335. fill: "none"
  40336. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  40337. d: "M3 7H15",
  40338. stroke: "black",
  40339. strokeWidth: "1.5"
  40340. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  40341. d: "M3 10L15 10",
  40342. stroke: "black",
  40343. strokeWidth: "1.5"
  40344. }));
  40345. function TrackList(_ref) {
  40346. let {
  40347. tracks,
  40348. onEditPress
  40349. } = _ref;
  40350. let content;
  40351. if (tracks.length === 0) {
  40352. content = (0,external_wp_element_namespaceObject.createElement)("p", {
  40353. className: "block-library-video-tracks-editor__tracks-informative-message"
  40354. }, (0,external_wp_i18n_namespaceObject.__)('Tracks can be subtitles, captions, chapters, or descriptions. They help make your content more accessible to a wider range of users.'));
  40355. } else {
  40356. content = tracks.map((track, index) => {
  40357. return (0,external_wp_element_namespaceObject.createElement)("div", {
  40358. key: index,
  40359. className: "block-library-video-tracks-editor__track-list-track"
  40360. }, (0,external_wp_element_namespaceObject.createElement)("span", null, track.label, " "), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  40361. variant: "tertiary",
  40362. onClick: () => onEditPress(index),
  40363. "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
  40364. /* translators: %s: Label of the video text track e.g: "French subtitles" */
  40365. (0,external_wp_i18n_namespaceObject.__)('Edit %s'), track.label)
  40366. }, (0,external_wp_i18n_namespaceObject.__)('Edit')));
  40367. });
  40368. }
  40369. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  40370. label: (0,external_wp_i18n_namespaceObject.__)('Text tracks'),
  40371. className: "block-library-video-tracks-editor__track-list"
  40372. }, content);
  40373. }
  40374. function SingleTrackEditor(_ref2) {
  40375. let {
  40376. track,
  40377. onChange,
  40378. onClose,
  40379. onRemove
  40380. } = _ref2;
  40381. const {
  40382. src = '',
  40383. label = '',
  40384. srcLang = '',
  40385. kind = DEFAULT_KIND
  40386. } = track;
  40387. const fileName = src.startsWith('blob:') ? '' : (0,external_wp_url_namespaceObject.getFilename)(src) || '';
  40388. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, null, (0,external_wp_element_namespaceObject.createElement)("div", {
  40389. className: "block-library-video-tracks-editor__single-track-editor"
  40390. }, (0,external_wp_element_namespaceObject.createElement)("span", {
  40391. className: "block-library-video-tracks-editor__single-track-editor-edit-track-label"
  40392. }, (0,external_wp_i18n_namespaceObject.__)('Edit track')), (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('File'), ": ", (0,external_wp_element_namespaceObject.createElement)("b", null, fileName)), (0,external_wp_element_namespaceObject.createElement)("div", {
  40393. className: "block-library-video-tracks-editor__single-track-editor-label-language"
  40394. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl
  40395. /* eslint-disable jsx-a11y/no-autofocus */
  40396. , {
  40397. autoFocus: true
  40398. /* eslint-enable jsx-a11y/no-autofocus */
  40399. ,
  40400. onChange: newLabel => onChange({ ...track,
  40401. label: newLabel
  40402. }),
  40403. label: (0,external_wp_i18n_namespaceObject.__)('Label'),
  40404. value: label,
  40405. help: (0,external_wp_i18n_namespaceObject.__)('Title of track')
  40406. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  40407. onChange: newSrcLang => onChange({ ...track,
  40408. srcLang: newSrcLang
  40409. }),
  40410. label: (0,external_wp_i18n_namespaceObject.__)('Source language'),
  40411. value: srcLang,
  40412. help: (0,external_wp_i18n_namespaceObject.__)('Language tag (en, fr, etc.)')
  40413. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  40414. className: "block-library-video-tracks-editor__single-track-editor-kind-select",
  40415. options: KIND_OPTIONS,
  40416. value: kind,
  40417. label: (0,external_wp_i18n_namespaceObject.__)('Kind'),
  40418. onChange: newKind => {
  40419. onChange({ ...track,
  40420. kind: newKind
  40421. });
  40422. }
  40423. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  40424. className: "block-library-video-tracks-editor__single-track-editor-buttons-container"
  40425. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  40426. variant: "secondary",
  40427. onClick: () => {
  40428. const changes = {};
  40429. let hasChanges = false;
  40430. if (label === '') {
  40431. changes.label = (0,external_wp_i18n_namespaceObject.__)('English');
  40432. hasChanges = true;
  40433. }
  40434. if (srcLang === '') {
  40435. changes.srcLang = 'en';
  40436. hasChanges = true;
  40437. }
  40438. if (track.kind === undefined) {
  40439. changes.kind = DEFAULT_KIND;
  40440. hasChanges = true;
  40441. }
  40442. if (hasChanges) {
  40443. onChange({ ...track,
  40444. ...changes
  40445. });
  40446. }
  40447. onClose();
  40448. }
  40449. }, (0,external_wp_i18n_namespaceObject.__)('Close')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  40450. isDestructive: true,
  40451. variant: "link",
  40452. onClick: onRemove
  40453. }, (0,external_wp_i18n_namespaceObject.__)('Remove track')))));
  40454. }
  40455. function TracksEditor(_ref3) {
  40456. let {
  40457. tracks = [],
  40458. onChange
  40459. } = _ref3;
  40460. const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => {
  40461. return select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload;
  40462. }, []);
  40463. const [trackBeingEdited, setTrackBeingEdited] = (0,external_wp_element_namespaceObject.useState)(null);
  40464. if (!mediaUpload) {
  40465. return null;
  40466. }
  40467. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
  40468. contentClassName: "block-library-video-tracks-editor",
  40469. renderToggle: _ref4 => {
  40470. let {
  40471. isOpen,
  40472. onToggle
  40473. } = _ref4;
  40474. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  40475. label: (0,external_wp_i18n_namespaceObject.__)('Text tracks'),
  40476. showTooltip: true,
  40477. "aria-expanded": isOpen,
  40478. "aria-haspopup": "true",
  40479. onClick: onToggle,
  40480. icon: captionIcon
  40481. });
  40482. },
  40483. renderContent: _ref5 => {
  40484. let {} = _ref5;
  40485. if (trackBeingEdited !== null) {
  40486. return (0,external_wp_element_namespaceObject.createElement)(SingleTrackEditor, {
  40487. track: tracks[trackBeingEdited],
  40488. onChange: newTrack => {
  40489. const newTracks = [...tracks];
  40490. newTracks[trackBeingEdited] = newTrack;
  40491. onChange(newTracks);
  40492. },
  40493. onClose: () => setTrackBeingEdited(null),
  40494. onRemove: () => {
  40495. onChange(tracks.filter((_track, index) => index !== trackBeingEdited));
  40496. setTrackBeingEdited(null);
  40497. }
  40498. });
  40499. }
  40500. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, null, (0,external_wp_element_namespaceObject.createElement)(TrackList, {
  40501. tracks: tracks,
  40502. onEditPress: setTrackBeingEdited
  40503. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  40504. className: "block-library-video-tracks-editor__add-tracks-container",
  40505. label: (0,external_wp_i18n_namespaceObject.__)('Add tracks')
  40506. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUpload, {
  40507. onSelect: _ref6 => {
  40508. let {
  40509. url
  40510. } = _ref6;
  40511. const trackIndex = tracks.length;
  40512. onChange([...tracks, {
  40513. src: url
  40514. }]);
  40515. setTrackBeingEdited(trackIndex);
  40516. },
  40517. allowedTypes: ALLOWED_TYPES,
  40518. render: _ref7 => {
  40519. let {
  40520. open
  40521. } = _ref7;
  40522. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  40523. icon: library_media,
  40524. onClick: open
  40525. }, (0,external_wp_i18n_namespaceObject.__)('Open Media Library'));
  40526. }
  40527. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormFileUpload, {
  40528. onChange: event => {
  40529. const files = event.target.files;
  40530. const trackIndex = tracks.length;
  40531. mediaUpload({
  40532. allowedTypes: ALLOWED_TYPES,
  40533. filesList: files,
  40534. onFileChange: _ref8 => {
  40535. let [{
  40536. url
  40537. }] = _ref8;
  40538. const newTracks = [...tracks];
  40539. if (!newTracks[trackIndex]) {
  40540. newTracks[trackIndex] = {};
  40541. }
  40542. newTracks[trackIndex] = { ...tracks[trackIndex],
  40543. src: url
  40544. };
  40545. onChange(newTracks);
  40546. setTrackBeingEdited(trackIndex);
  40547. }
  40548. });
  40549. },
  40550. accept: ".vtt,text/vtt",
  40551. render: _ref9 => {
  40552. let {
  40553. openFileDialog
  40554. } = _ref9;
  40555. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  40556. icon: library_upload,
  40557. onClick: () => {
  40558. openFileDialog();
  40559. }
  40560. }, (0,external_wp_i18n_namespaceObject.__)('Upload'));
  40561. }
  40562. })))));
  40563. }
  40564. });
  40565. }
  40566. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/tracks.js
  40567. function Tracks(_ref) {
  40568. let {
  40569. tracks = []
  40570. } = _ref;
  40571. return tracks.map(track => {
  40572. return (0,external_wp_element_namespaceObject.createElement)("track", _extends({
  40573. key: track.src
  40574. }, track));
  40575. });
  40576. }
  40577. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/edit.js
  40578. /**
  40579. * External dependencies
  40580. */
  40581. /**
  40582. * WordPress dependencies
  40583. */
  40584. /**
  40585. * Internal dependencies
  40586. */
  40587. const video_edit_ALLOWED_MEDIA_TYPES = ['video'];
  40588. const VIDEO_POSTER_ALLOWED_MEDIA_TYPES = ['image'];
  40589. function VideoEdit(_ref) {
  40590. let {
  40591. isSelected,
  40592. noticeUI,
  40593. attributes,
  40594. className,
  40595. setAttributes,
  40596. insertBlocksAfter,
  40597. onReplace,
  40598. noticeOperations
  40599. } = _ref;
  40600. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(VideoEdit);
  40601. const videoPlayer = (0,external_wp_element_namespaceObject.useRef)();
  40602. const posterImageButton = (0,external_wp_element_namespaceObject.useRef)();
  40603. const {
  40604. id,
  40605. caption,
  40606. controls,
  40607. poster,
  40608. src,
  40609. tracks
  40610. } = attributes;
  40611. const isTemporaryVideo = !id && (0,external_wp_blob_namespaceObject.isBlobURL)(src);
  40612. const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload);
  40613. (0,external_wp_element_namespaceObject.useEffect)(() => {
  40614. if (!id && (0,external_wp_blob_namespaceObject.isBlobURL)(src)) {
  40615. const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(src);
  40616. if (file) {
  40617. mediaUpload({
  40618. filesList: [file],
  40619. onFileChange: _ref2 => {
  40620. let [{
  40621. url
  40622. }] = _ref2;
  40623. setAttributes({
  40624. src: url
  40625. });
  40626. },
  40627. onError: message => {
  40628. noticeOperations.createErrorNotice(message);
  40629. },
  40630. allowedTypes: video_edit_ALLOWED_MEDIA_TYPES
  40631. });
  40632. }
  40633. }
  40634. }, []);
  40635. (0,external_wp_element_namespaceObject.useEffect)(() => {
  40636. // Placeholder may be rendered.
  40637. if (videoPlayer.current) {
  40638. videoPlayer.current.load();
  40639. }
  40640. }, [poster]);
  40641. function onSelectVideo(media) {
  40642. var _media$image, _media$image2;
  40643. if (!media || !media.url) {
  40644. // In this case there was an error
  40645. // previous attributes should be removed
  40646. // because they may be temporary blob urls.
  40647. setAttributes({
  40648. src: undefined,
  40649. id: undefined,
  40650. poster: undefined
  40651. });
  40652. return;
  40653. } // Sets the block's attribute and updates the edit component from the
  40654. // selected media.
  40655. setAttributes({
  40656. src: media.url,
  40657. id: media.id,
  40658. poster: ((_media$image = media.image) === null || _media$image === void 0 ? void 0 : _media$image.src) !== media.icon ? (_media$image2 = media.image) === null || _media$image2 === void 0 ? void 0 : _media$image2.src : undefined
  40659. });
  40660. }
  40661. function onSelectURL(newSrc) {
  40662. if (newSrc !== src) {
  40663. // Check if there's an embed block that handles this URL.
  40664. const embedBlock = createUpgradedEmbedBlock({
  40665. attributes: {
  40666. url: newSrc
  40667. }
  40668. });
  40669. if (undefined !== embedBlock) {
  40670. onReplace(embedBlock);
  40671. return;
  40672. }
  40673. setAttributes({
  40674. src: newSrc,
  40675. id: undefined,
  40676. poster: undefined
  40677. });
  40678. }
  40679. }
  40680. function onUploadError(message) {
  40681. noticeOperations.removeAllNotices();
  40682. noticeOperations.createErrorNotice(message);
  40683. }
  40684. const classes = classnames_default()(className, {
  40685. 'is-transient': isTemporaryVideo
  40686. });
  40687. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  40688. className: classes
  40689. });
  40690. if (!src) {
  40691. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  40692. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  40693. icon: library_video
  40694. }),
  40695. onSelect: onSelectVideo,
  40696. onSelectURL: onSelectURL,
  40697. accept: "video/*",
  40698. allowedTypes: video_edit_ALLOWED_MEDIA_TYPES,
  40699. value: attributes,
  40700. notices: noticeUI,
  40701. onError: onUploadError
  40702. }));
  40703. }
  40704. function onSelectPoster(image) {
  40705. setAttributes({
  40706. poster: image.url
  40707. });
  40708. }
  40709. function onRemovePoster() {
  40710. setAttributes({
  40711. poster: undefined
  40712. }); // Move focus back to the Media Upload button.
  40713. posterImageButton.current.focus();
  40714. }
  40715. const videoPosterDescription = `video-block__poster-image-description-${instanceId}`;
  40716. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  40717. group: "block"
  40718. }, (0,external_wp_element_namespaceObject.createElement)(TracksEditor, {
  40719. tracks: tracks,
  40720. onChange: newTracks => {
  40721. setAttributes({
  40722. tracks: newTracks
  40723. });
  40724. }
  40725. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  40726. group: "other"
  40727. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  40728. mediaId: id,
  40729. mediaURL: src,
  40730. allowedTypes: video_edit_ALLOWED_MEDIA_TYPES,
  40731. accept: "video/*",
  40732. onSelect: onSelectVideo,
  40733. onSelectURL: onSelectURL,
  40734. onError: onUploadError
  40735. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  40736. title: (0,external_wp_i18n_namespaceObject.__)('Video settings')
  40737. }, (0,external_wp_element_namespaceObject.createElement)(edit_common_settings, {
  40738. setAttributes: setAttributes,
  40739. attributes: attributes
  40740. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  40741. className: "editor-video-poster-control"
  40742. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_wp_i18n_namespaceObject.__)('Poster image')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUpload, {
  40743. title: (0,external_wp_i18n_namespaceObject.__)('Select poster image'),
  40744. onSelect: onSelectPoster,
  40745. allowedTypes: VIDEO_POSTER_ALLOWED_MEDIA_TYPES,
  40746. render: _ref3 => {
  40747. let {
  40748. open
  40749. } = _ref3;
  40750. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  40751. variant: "primary",
  40752. onClick: open,
  40753. ref: posterImageButton,
  40754. "aria-describedby": videoPosterDescription
  40755. }, !poster ? (0,external_wp_i18n_namespaceObject.__)('Select') : (0,external_wp_i18n_namespaceObject.__)('Replace'));
  40756. }
  40757. }), (0,external_wp_element_namespaceObject.createElement)("p", {
  40758. id: videoPosterDescription,
  40759. hidden: true
  40760. }, poster ? (0,external_wp_i18n_namespaceObject.sprintf)(
  40761. /* translators: %s: poster image URL. */
  40762. (0,external_wp_i18n_namespaceObject.__)('The current poster image url is %s'), poster) : (0,external_wp_i18n_namespaceObject.__)('There is no poster image currently selected')), !!poster && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  40763. onClick: onRemovePoster,
  40764. variant: "tertiary"
  40765. }, (0,external_wp_i18n_namespaceObject.__)('Remove')))))), (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, {
  40766. isDisabled: !isSelected
  40767. }, (0,external_wp_element_namespaceObject.createElement)("video", {
  40768. controls: controls,
  40769. poster: poster,
  40770. src: src,
  40771. ref: videoPlayer
  40772. }, (0,external_wp_element_namespaceObject.createElement)(Tracks, {
  40773. tracks: tracks
  40774. }))), isTemporaryVideo && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  40775. tagName: "figcaption",
  40776. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Video caption text'),
  40777. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
  40778. value: caption,
  40779. onChange: value => setAttributes({
  40780. caption: value
  40781. }),
  40782. inlineToolbar: true,
  40783. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
  40784. })));
  40785. }
  40786. /* harmony default export */ var video_edit = ((0,external_wp_components_namespaceObject.withNotices)(VideoEdit));
  40787. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/save.js
  40788. /**
  40789. * WordPress dependencies
  40790. */
  40791. /**
  40792. * Internal dependencies
  40793. */
  40794. function video_save_save(_ref) {
  40795. let {
  40796. attributes
  40797. } = _ref;
  40798. const {
  40799. autoplay,
  40800. caption,
  40801. controls,
  40802. loop,
  40803. muted,
  40804. poster,
  40805. preload,
  40806. src,
  40807. playsInline,
  40808. tracks
  40809. } = attributes;
  40810. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), src && (0,external_wp_element_namespaceObject.createElement)("video", {
  40811. autoPlay: autoplay,
  40812. controls: controls,
  40813. loop: loop,
  40814. muted: muted,
  40815. poster: poster,
  40816. preload: preload !== 'metadata' ? preload : undefined,
  40817. src: src,
  40818. playsInline: playsInline
  40819. }, (0,external_wp_element_namespaceObject.createElement)(Tracks, {
  40820. tracks: tracks
  40821. })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  40822. tagName: "figcaption",
  40823. value: caption
  40824. }));
  40825. }
  40826. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/transforms.js
  40827. /**
  40828. * WordPress dependencies
  40829. */
  40830. const video_transforms_transforms = {
  40831. from: [{
  40832. type: 'files',
  40833. isMatch(files) {
  40834. return files.length === 1 && files[0].type.indexOf('video/') === 0;
  40835. },
  40836. transform(files) {
  40837. const file = files[0]; // We don't need to upload the media directly here
  40838. // It's already done as part of the `componentDidMount`
  40839. // in the video block
  40840. const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/video', {
  40841. src: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  40842. });
  40843. return block;
  40844. }
  40845. }, {
  40846. type: 'shortcode',
  40847. tag: 'video',
  40848. attributes: {
  40849. src: {
  40850. type: 'string',
  40851. shortcode: _ref => {
  40852. let {
  40853. named: {
  40854. src,
  40855. mp4,
  40856. m4v,
  40857. webm,
  40858. ogv,
  40859. flv
  40860. }
  40861. } = _ref;
  40862. return src || mp4 || m4v || webm || ogv || flv;
  40863. }
  40864. },
  40865. poster: {
  40866. type: 'string',
  40867. shortcode: _ref2 => {
  40868. let {
  40869. named: {
  40870. poster
  40871. }
  40872. } = _ref2;
  40873. return poster;
  40874. }
  40875. },
  40876. loop: {
  40877. type: 'string',
  40878. shortcode: _ref3 => {
  40879. let {
  40880. named: {
  40881. loop
  40882. }
  40883. } = _ref3;
  40884. return loop;
  40885. }
  40886. },
  40887. autoplay: {
  40888. type: 'string',
  40889. shortcode: _ref4 => {
  40890. let {
  40891. named: {
  40892. autoplay
  40893. }
  40894. } = _ref4;
  40895. return autoplay;
  40896. }
  40897. },
  40898. preload: {
  40899. type: 'string',
  40900. shortcode: _ref5 => {
  40901. let {
  40902. named: {
  40903. preload
  40904. }
  40905. } = _ref5;
  40906. return preload;
  40907. }
  40908. }
  40909. }
  40910. }]
  40911. };
  40912. /* harmony default export */ var video_transforms = (video_transforms_transforms);
  40913. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/index.js
  40914. /**
  40915. * WordPress dependencies
  40916. */
  40917. /**
  40918. * Internal dependencies
  40919. */
  40920. const video_metadata = {
  40921. $schema: "https://schemas.wp.org/trunk/block.json",
  40922. apiVersion: 2,
  40923. name: "core/video",
  40924. title: "Video",
  40925. category: "media",
  40926. description: "Embed a video from your media library or upload a new one.",
  40927. keywords: ["movie"],
  40928. textdomain: "default",
  40929. attributes: {
  40930. autoplay: {
  40931. type: "boolean",
  40932. source: "attribute",
  40933. selector: "video",
  40934. attribute: "autoplay"
  40935. },
  40936. caption: {
  40937. type: "string",
  40938. source: "html",
  40939. selector: "figcaption"
  40940. },
  40941. controls: {
  40942. type: "boolean",
  40943. source: "attribute",
  40944. selector: "video",
  40945. attribute: "controls",
  40946. "default": true
  40947. },
  40948. id: {
  40949. type: "number"
  40950. },
  40951. loop: {
  40952. type: "boolean",
  40953. source: "attribute",
  40954. selector: "video",
  40955. attribute: "loop"
  40956. },
  40957. muted: {
  40958. type: "boolean",
  40959. source: "attribute",
  40960. selector: "video",
  40961. attribute: "muted"
  40962. },
  40963. poster: {
  40964. type: "string",
  40965. source: "attribute",
  40966. selector: "video",
  40967. attribute: "poster"
  40968. },
  40969. preload: {
  40970. type: "string",
  40971. source: "attribute",
  40972. selector: "video",
  40973. attribute: "preload",
  40974. "default": "metadata"
  40975. },
  40976. src: {
  40977. type: "string",
  40978. source: "attribute",
  40979. selector: "video",
  40980. attribute: "src"
  40981. },
  40982. playsInline: {
  40983. type: "boolean",
  40984. source: "attribute",
  40985. selector: "video",
  40986. attribute: "playsinline"
  40987. },
  40988. tracks: {
  40989. type: "array",
  40990. items: {
  40991. type: "object"
  40992. },
  40993. "default": []
  40994. }
  40995. },
  40996. supports: {
  40997. anchor: true,
  40998. align: true
  40999. },
  41000. editorStyle: "wp-block-video-editor",
  41001. style: "wp-block-video"
  41002. };
  41003. const {
  41004. name: video_name
  41005. } = video_metadata;
  41006. const video_settings = {
  41007. icon: library_video,
  41008. example: {
  41009. attributes: {
  41010. src: 'https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm',
  41011. // translators: Caption accompanying a video of the wood thrush singing, which serves as an example for the Video block.
  41012. caption: (0,external_wp_i18n_namespaceObject.__)('Wood thrush singing in Central Park, NYC.')
  41013. }
  41014. },
  41015. transforms: video_transforms,
  41016. edit: video_edit,
  41017. save: video_save_save
  41018. };
  41019. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/index.js
  41020. /**
  41021. * WordPress dependencies
  41022. */
  41023. /**
  41024. * Internal dependencies
  41025. */
  41026. /**
  41027. * Function to register an individual block.
  41028. *
  41029. * @param {Object} block The block to be registered.
  41030. *
  41031. */
  41032. const registerBlock = block => {
  41033. if (!block) {
  41034. return;
  41035. }
  41036. const {
  41037. metadata,
  41038. settings,
  41039. name
  41040. } = block;
  41041. (0,external_wp_blocks_namespaceObject.registerBlockType)({
  41042. name,
  41043. ...metadata
  41044. }, settings);
  41045. };
  41046. /**
  41047. * Function to get all the core blocks in an array.
  41048. *
  41049. * @example
  41050. * ```js
  41051. * import { __experimentalGetCoreBlocks } from '@wordpress/block-library';
  41052. *
  41053. * const coreBlocks = __experimentalGetCoreBlocks();
  41054. * ```
  41055. */
  41056. const __experimentalGetCoreBlocks = () => [// Common blocks are grouped at the top to prioritize their display
  41057. // in various contexts — like the inserter and auto-complete components.
  41058. build_module_paragraph_namespaceObject, build_module_image_namespaceObject, build_module_heading_namespaceObject, build_module_gallery_namespaceObject, build_module_list_namespaceObject, build_module_quote_namespaceObject, // Register all remaining core blocks.
  41059. archives_namespaceObject, build_module_audio_namespaceObject, build_module_button_namespaceObject, build_module_buttons_namespaceObject, build_module_calendar_namespaceObject, categories_namespaceObject, window.wp && window.wp.oldEditor ? freeform_namespaceObject : null, // Only add the classic block in WP Context.
  41060. build_module_code_namespaceObject, build_module_column_namespaceObject, build_module_columns_namespaceObject, build_module_cover_namespaceObject, embed_namespaceObject, build_module_file_namespaceObject, build_module_group_namespaceObject, build_module_html_namespaceObject, latest_comments_namespaceObject, latest_posts_namespaceObject, media_text_namespaceObject, missing_namespaceObject, build_module_more_namespaceObject, nextpage_namespaceObject, page_list_namespaceObject, pattern_namespaceObject, build_module_preformatted_namespaceObject, build_module_pullquote_namespaceObject, block_namespaceObject, build_module_rss_namespaceObject, build_module_search_namespaceObject, build_module_separator_namespaceObject, build_module_shortcode_namespaceObject, social_link_namespaceObject, social_links_namespaceObject, spacer_namespaceObject, build_module_table_namespaceObject, // tableOfContents,
  41061. tag_cloud_namespaceObject, text_columns_namespaceObject, build_module_verse_namespaceObject, build_module_video_namespaceObject, // theme blocks
  41062. build_module_navigation_namespaceObject, navigation_link_namespaceObject, navigation_submenu_namespaceObject, build_module_site_logo_namespaceObject, site_title_namespaceObject, site_tagline_namespaceObject, query_namespaceObject, template_part_namespaceObject, avatar_namespaceObject, build_module_post_title_namespaceObject, build_module_post_excerpt_namespaceObject, build_module_post_featured_image_namespaceObject, build_module_post_content_namespaceObject, build_module_post_author_namespaceObject, build_module_post_date_namespaceObject, build_module_post_terms_namespaceObject, post_navigation_link_namespaceObject, post_template_namespaceObject, build_module_query_pagination_namespaceObject, build_module_query_pagination_next_namespaceObject, build_module_query_pagination_numbers_namespaceObject, build_module_query_pagination_previous_namespaceObject, query_no_results_namespaceObject, read_more_namespaceObject, build_module_comment_author_name_namespaceObject, build_module_comment_content_namespaceObject, comment_date_namespaceObject, build_module_comment_edit_link_namespaceObject, build_module_comment_reply_link_namespaceObject, comment_template_namespaceObject, comments_title_namespaceObject, comments_query_loop_namespaceObject, comments_pagination_namespaceObject, comments_pagination_next_namespaceObject, comments_pagination_numbers_namespaceObject, comments_pagination_previous_namespaceObject, build_module_post_comments_namespaceObject, build_module_post_comments_form_namespaceObject, home_link_namespaceObject, loginout_namespaceObject, build_module_term_description_namespaceObject, build_module_query_title_namespaceObject, post_author_biography_namespaceObject];
  41063. /**
  41064. * Function to register core blocks provided by the block editor.
  41065. *
  41066. * @param {Array} blocks An optional array of the core blocks being registered.
  41067. *
  41068. * @example
  41069. * ```js
  41070. * import { registerCoreBlocks } from '@wordpress/block-library';
  41071. *
  41072. * registerCoreBlocks();
  41073. * ```
  41074. */
  41075. const registerCoreBlocks = function () {
  41076. let blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : __experimentalGetCoreBlocks();
  41077. blocks.forEach(registerBlock);
  41078. (0,external_wp_blocks_namespaceObject.setDefaultBlockName)(paragraph_name);
  41079. if (window.wp && window.wp.oldEditor) {
  41080. (0,external_wp_blocks_namespaceObject.setFreeformContentHandlerName)(freeform_name);
  41081. }
  41082. (0,external_wp_blocks_namespaceObject.setUnregisteredTypeHandlerName)(missing_name);
  41083. (0,external_wp_blocks_namespaceObject.setGroupingBlockName)(group_name);
  41084. };
  41085. /**
  41086. * Function to register experimental core blocks depending on editor settings.
  41087. *
  41088. * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.
  41089. * @example
  41090. * ```js
  41091. * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';
  41092. *
  41093. * __experimentalRegisterExperimentalCoreBlocks( settings );
  41094. * ```
  41095. */
  41096. const __experimentalRegisterExperimentalCoreBlocks = false ? 0 : undefined;
  41097. }();
  41098. (window.wp = window.wp || {}).blockLibrary = __webpack_exports__;
  41099. /******/ })()
  41100. ;