data.js 141 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529
  1. this["wp"] = this["wp"] || {}; this["wp"]["data"] =
  2. /******/ (function(modules) { // webpackBootstrap
  3. /******/ // The module cache
  4. /******/ var installedModules = {};
  5. /******/
  6. /******/ // The require function
  7. /******/ function __webpack_require__(moduleId) {
  8. /******/
  9. /******/ // Check if module is in cache
  10. /******/ if(installedModules[moduleId]) {
  11. /******/ return installedModules[moduleId].exports;
  12. /******/ }
  13. /******/ // Create a new module (and put it into the cache)
  14. /******/ var module = installedModules[moduleId] = {
  15. /******/ i: moduleId,
  16. /******/ l: false,
  17. /******/ exports: {}
  18. /******/ };
  19. /******/
  20. /******/ // Execute the module function
  21. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22. /******/
  23. /******/ // Flag the module as loaded
  24. /******/ module.l = true;
  25. /******/
  26. /******/ // Return the exports of the module
  27. /******/ return module.exports;
  28. /******/ }
  29. /******/
  30. /******/
  31. /******/ // expose the modules object (__webpack_modules__)
  32. /******/ __webpack_require__.m = modules;
  33. /******/
  34. /******/ // expose the module cache
  35. /******/ __webpack_require__.c = installedModules;
  36. /******/
  37. /******/ // define getter function for harmony exports
  38. /******/ __webpack_require__.d = function(exports, name, getter) {
  39. /******/ if(!__webpack_require__.o(exports, name)) {
  40. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41. /******/ }
  42. /******/ };
  43. /******/
  44. /******/ // define __esModule on exports
  45. /******/ __webpack_require__.r = function(exports) {
  46. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48. /******/ }
  49. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  50. /******/ };
  51. /******/
  52. /******/ // create a fake namespace object
  53. /******/ // mode & 1: value is a module id, require it
  54. /******/ // mode & 2: merge all properties of value into the ns
  55. /******/ // mode & 4: return value when already ns object
  56. /******/ // mode & 8|1: behave like require
  57. /******/ __webpack_require__.t = function(value, mode) {
  58. /******/ if(mode & 1) value = __webpack_require__(value);
  59. /******/ if(mode & 8) return value;
  60. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61. /******/ var ns = Object.create(null);
  62. /******/ __webpack_require__.r(ns);
  63. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65. /******/ return ns;
  66. /******/ };
  67. /******/
  68. /******/ // getDefaultExport function for compatibility with non-harmony modules
  69. /******/ __webpack_require__.n = function(module) {
  70. /******/ var getter = module && module.__esModule ?
  71. /******/ function getDefault() { return module['default']; } :
  72. /******/ function getModuleExports() { return module; };
  73. /******/ __webpack_require__.d(getter, 'a', getter);
  74. /******/ return getter;
  75. /******/ };
  76. /******/
  77. /******/ // Object.prototype.hasOwnProperty.call
  78. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79. /******/
  80. /******/ // __webpack_public_path__
  81. /******/ __webpack_require__.p = "";
  82. /******/
  83. /******/
  84. /******/ // Load entry module and return exports
  85. /******/ return __webpack_require__(__webpack_require__.s = 348);
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ 0:
  90. /***/ (function(module, exports) {
  91. (function() { module.exports = this["wp"]["element"]; }());
  92. /***/ }),
  93. /***/ 10:
  94. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95. "use strict";
  96. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
  97. function _defineProperty(obj, key, value) {
  98. if (key in obj) {
  99. Object.defineProperty(obj, key, {
  100. value: value,
  101. enumerable: true,
  102. configurable: true,
  103. writable: true
  104. });
  105. } else {
  106. obj[key] = value;
  107. }
  108. return obj;
  109. }
  110. /***/ }),
  111. /***/ 111:
  112. /***/ (function(module, exports) {
  113. function combineReducers( reducers ) {
  114. var keys = Object.keys( reducers ),
  115. getNextState;
  116. getNextState = ( function() {
  117. var fn, i, key;
  118. fn = 'return {';
  119. for ( i = 0; i < keys.length; i++ ) {
  120. // Rely on Quoted escaping of JSON.stringify with guarantee that
  121. // each member of Object.keys is a string.
  122. //
  123. // "If Type(value) is String, then return the result of calling the
  124. // abstract operation Quote with argument value. [...] The abstract
  125. // operation Quote(value) wraps a String value in double quotes and
  126. // escapes characters within it."
  127. //
  128. // https://www.ecma-international.org/ecma-262/5.1/#sec-15.12.3
  129. key = JSON.stringify( keys[ i ] );
  130. fn += key + ':r[' + key + '](s[' + key + '],a),';
  131. }
  132. fn += '}';
  133. return new Function( 'r,s,a', fn );
  134. } )();
  135. return function combinedReducer( state, action ) {
  136. var nextState, i, key;
  137. // Assumed changed if initial state.
  138. if ( state === undefined ) {
  139. return getNextState( reducers, {}, action );
  140. }
  141. nextState = getNextState( reducers, state, action );
  142. // Determine whether state has changed.
  143. i = keys.length;
  144. while ( i-- ) {
  145. key = keys[ i ];
  146. if ( state[ key ] !== nextState[ key ] ) {
  147. // Return immediately if a changed value is encountered.
  148. return nextState;
  149. }
  150. }
  151. return state;
  152. };
  153. }
  154. module.exports = combineReducers;
  155. /***/ }),
  156. /***/ 145:
  157. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  158. "use strict";
  159. /* WEBPACK VAR INJECTION */(function(global, module) {/* harmony import */ var _ponyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(229);
  160. /* global window */
  161. var root;
  162. if (typeof self !== 'undefined') {
  163. root = self;
  164. } else if (typeof window !== 'undefined') {
  165. root = window;
  166. } else if (typeof global !== 'undefined') {
  167. root = global;
  168. } else if (true) {
  169. root = module;
  170. } else {}
  171. var result = Object(_ponyfill_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(root);
  172. /* harmony default export */ __webpack_exports__["a"] = (result);
  173. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(65), __webpack_require__(318)(module)))
  174. /***/ }),
  175. /***/ 17:
  176. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  177. "use strict";
  178. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
  179. function _arrayWithoutHoles(arr) {
  180. if (Array.isArray(arr)) {
  181. for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
  182. arr2[i] = arr[i];
  183. }
  184. return arr2;
  185. }
  186. }
  187. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
  188. var iterableToArray = __webpack_require__(30);
  189. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
  190. function _nonIterableSpread() {
  191. throw new TypeError("Invalid attempt to spread non-iterable instance");
  192. }
  193. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
  194. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _toConsumableArray; });
  195. function _toConsumableArray(arr) {
  196. return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || _nonIterableSpread();
  197. }
  198. /***/ }),
  199. /***/ 18:
  200. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  201. "use strict";
  202. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
  203. function _extends() {
  204. _extends = Object.assign || function (target) {
  205. for (var i = 1; i < arguments.length; i++) {
  206. var source = arguments[i];
  207. for (var key in source) {
  208. if (Object.prototype.hasOwnProperty.call(source, key)) {
  209. target[key] = source[key];
  210. }
  211. }
  212. }
  213. return target;
  214. };
  215. return _extends.apply(this, arguments);
  216. }
  217. /***/ }),
  218. /***/ 2:
  219. /***/ (function(module, exports) {
  220. (function() { module.exports = this["lodash"]; }());
  221. /***/ }),
  222. /***/ 20:
  223. /***/ (function(module, exports, __webpack_require__) {
  224. module.exports = __webpack_require__(47);
  225. /***/ }),
  226. /***/ 228:
  227. /***/ (function(module, exports) {
  228. (function() { module.exports = this["wp"]["reduxRoutine"]; }());
  229. /***/ }),
  230. /***/ 229:
  231. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  232. "use strict";
  233. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return symbolObservablePonyfill; });
  234. function symbolObservablePonyfill(root) {
  235. var result;
  236. var Symbol = root.Symbol;
  237. if (typeof Symbol === 'function') {
  238. if (Symbol.observable) {
  239. result = Symbol.observable;
  240. } else {
  241. result = Symbol('observable');
  242. Symbol.observable = result;
  243. }
  244. } else {
  245. result = '@@observable';
  246. }
  247. return result;
  248. };
  249. /***/ }),
  250. /***/ 23:
  251. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  252. "use strict";
  253. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
  254. var arrayWithHoles = __webpack_require__(38);
  255. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
  256. function _iterableToArrayLimit(arr, i) {
  257. var _arr = [];
  258. var _n = true;
  259. var _d = false;
  260. var _e = undefined;
  261. try {
  262. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  263. _arr.push(_s.value);
  264. if (i && _arr.length === i) break;
  265. }
  266. } catch (err) {
  267. _d = true;
  268. _e = err;
  269. } finally {
  270. try {
  271. if (!_n && _i["return"] != null) _i["return"]();
  272. } finally {
  273. if (_d) throw _e;
  274. }
  275. }
  276. return _arr;
  277. }
  278. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
  279. var nonIterableRest = __webpack_require__(39);
  280. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
  281. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _slicedToArray; });
  282. function _slicedToArray(arr, i) {
  283. return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(nonIterableRest["a" /* default */])();
  284. }
  285. /***/ }),
  286. /***/ 230:
  287. /***/ (function(module, exports) {
  288. (function() { module.exports = this["wp"]["priorityQueue"]; }());
  289. /***/ }),
  290. /***/ 30:
  291. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  292. "use strict";
  293. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
  294. function _iterableToArray(iter) {
  295. if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
  296. }
  297. /***/ }),
  298. /***/ 318:
  299. /***/ (function(module, exports) {
  300. module.exports = function(originalModule) {
  301. if (!originalModule.webpackPolyfill) {
  302. var module = Object.create(originalModule);
  303. // module.parent = undefined by default
  304. if (!module.children) module.children = [];
  305. Object.defineProperty(module, "loaded", {
  306. enumerable: true,
  307. get: function() {
  308. return module.l;
  309. }
  310. });
  311. Object.defineProperty(module, "id", {
  312. enumerable: true,
  313. get: function() {
  314. return module.i;
  315. }
  316. });
  317. Object.defineProperty(module, "exports", {
  318. enumerable: true
  319. });
  320. module.webpackPolyfill = 1;
  321. }
  322. return module;
  323. };
  324. /***/ }),
  325. /***/ 348:
  326. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  327. "use strict";
  328. __webpack_require__.r(__webpack_exports__);
  329. var selectors_namespaceObject = {};
  330. __webpack_require__.r(selectors_namespaceObject);
  331. __webpack_require__.d(selectors_namespaceObject, "getIsResolving", function() { return getIsResolving; });
  332. __webpack_require__.d(selectors_namespaceObject, "hasStartedResolution", function() { return hasStartedResolution; });
  333. __webpack_require__.d(selectors_namespaceObject, "hasFinishedResolution", function() { return hasFinishedResolution; });
  334. __webpack_require__.d(selectors_namespaceObject, "isResolving", function() { return isResolving; });
  335. __webpack_require__.d(selectors_namespaceObject, "getCachedResolvers", function() { return getCachedResolvers; });
  336. var actions_namespaceObject = {};
  337. __webpack_require__.r(actions_namespaceObject);
  338. __webpack_require__.d(actions_namespaceObject, "startResolution", function() { return startResolution; });
  339. __webpack_require__.d(actions_namespaceObject, "finishResolution", function() { return finishResolution; });
  340. __webpack_require__.d(actions_namespaceObject, "invalidateResolution", function() { return invalidateResolution; });
  341. __webpack_require__.d(actions_namespaceObject, "invalidateResolutionForStore", function() { return invalidateResolutionForStore; });
  342. __webpack_require__.d(actions_namespaceObject, "invalidateResolutionForStoreSelector", function() { return invalidateResolutionForStoreSelector; });
  343. var plugins_namespaceObject = {};
  344. __webpack_require__.r(plugins_namespaceObject);
  345. __webpack_require__.d(plugins_namespaceObject, "controls", function() { return controls; });
  346. __webpack_require__.d(plugins_namespaceObject, "persistence", function() { return plugins_persistence; });
  347. // EXTERNAL MODULE: ./node_modules/turbo-combine-reducers/index.js
  348. var turbo_combine_reducers = __webpack_require__(111);
  349. var turbo_combine_reducers_default = /*#__PURE__*/__webpack_require__.n(turbo_combine_reducers);
  350. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
  351. var slicedToArray = __webpack_require__(23);
  352. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread.js
  353. var objectSpread = __webpack_require__(7);
  354. // EXTERNAL MODULE: external "lodash"
  355. var external_lodash_ = __webpack_require__(2);
  356. // EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
  357. var regenerator = __webpack_require__(20);
  358. var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
  359. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
  360. var asyncToGenerator = __webpack_require__(43);
  361. // EXTERNAL MODULE: ./node_modules/symbol-observable/es/index.js
  362. var es = __webpack_require__(145);
  363. // CONCATENATED MODULE: ./node_modules/redux/es/redux.js
  364. /**
  365. * These are private action types reserved by Redux.
  366. * For any unknown actions, you must return the current state.
  367. * If the current state is undefined, you must return the initial state.
  368. * Do not reference these action types directly in your code.
  369. */
  370. var randomString = function randomString() {
  371. return Math.random().toString(36).substring(7).split('').join('.');
  372. };
  373. var ActionTypes = {
  374. INIT: "@@redux/INIT" + randomString(),
  375. REPLACE: "@@redux/REPLACE" + randomString(),
  376. PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
  377. return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
  378. }
  379. };
  380. /**
  381. * @param {any} obj The object to inspect.
  382. * @returns {boolean} True if the argument appears to be a plain object.
  383. */
  384. function isPlainObject(obj) {
  385. if (typeof obj !== 'object' || obj === null) return false;
  386. var proto = obj;
  387. while (Object.getPrototypeOf(proto) !== null) {
  388. proto = Object.getPrototypeOf(proto);
  389. }
  390. return Object.getPrototypeOf(obj) === proto;
  391. }
  392. /**
  393. * Creates a Redux store that holds the state tree.
  394. * The only way to change the data in the store is to call `dispatch()` on it.
  395. *
  396. * There should only be a single store in your app. To specify how different
  397. * parts of the state tree respond to actions, you may combine several reducers
  398. * into a single reducer function by using `combineReducers`.
  399. *
  400. * @param {Function} reducer A function that returns the next state tree, given
  401. * the current state tree and the action to handle.
  402. *
  403. * @param {any} [preloadedState] The initial state. You may optionally specify it
  404. * to hydrate the state from the server in universal apps, or to restore a
  405. * previously serialized user session.
  406. * If you use `combineReducers` to produce the root reducer function, this must be
  407. * an object with the same shape as `combineReducers` keys.
  408. *
  409. * @param {Function} [enhancer] The store enhancer. You may optionally specify it
  410. * to enhance the store with third-party capabilities such as middleware,
  411. * time travel, persistence, etc. The only store enhancer that ships with Redux
  412. * is `applyMiddleware()`.
  413. *
  414. * @returns {Store} A Redux store that lets you read the state, dispatch actions
  415. * and subscribe to changes.
  416. */
  417. function createStore(reducer, preloadedState, enhancer) {
  418. var _ref2;
  419. if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
  420. throw new Error('It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function.');
  421. }
  422. if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
  423. enhancer = preloadedState;
  424. preloadedState = undefined;
  425. }
  426. if (typeof enhancer !== 'undefined') {
  427. if (typeof enhancer !== 'function') {
  428. throw new Error('Expected the enhancer to be a function.');
  429. }
  430. return enhancer(createStore)(reducer, preloadedState);
  431. }
  432. if (typeof reducer !== 'function') {
  433. throw new Error('Expected the reducer to be a function.');
  434. }
  435. var currentReducer = reducer;
  436. var currentState = preloadedState;
  437. var currentListeners = [];
  438. var nextListeners = currentListeners;
  439. var isDispatching = false;
  440. /**
  441. * This makes a shallow copy of currentListeners so we can use
  442. * nextListeners as a temporary list while dispatching.
  443. *
  444. * This prevents any bugs around consumers calling
  445. * subscribe/unsubscribe in the middle of a dispatch.
  446. */
  447. function ensureCanMutateNextListeners() {
  448. if (nextListeners === currentListeners) {
  449. nextListeners = currentListeners.slice();
  450. }
  451. }
  452. /**
  453. * Reads the state tree managed by the store.
  454. *
  455. * @returns {any} The current state tree of your application.
  456. */
  457. function getState() {
  458. if (isDispatching) {
  459. throw new Error('You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');
  460. }
  461. return currentState;
  462. }
  463. /**
  464. * Adds a change listener. It will be called any time an action is dispatched,
  465. * and some part of the state tree may potentially have changed. You may then
  466. * call `getState()` to read the current state tree inside the callback.
  467. *
  468. * You may call `dispatch()` from a change listener, with the following
  469. * caveats:
  470. *
  471. * 1. The subscriptions are snapshotted just before every `dispatch()` call.
  472. * If you subscribe or unsubscribe while the listeners are being invoked, this
  473. * will not have any effect on the `dispatch()` that is currently in progress.
  474. * However, the next `dispatch()` call, whether nested or not, will use a more
  475. * recent snapshot of the subscription list.
  476. *
  477. * 2. The listener should not expect to see all state changes, as the state
  478. * might have been updated multiple times during a nested `dispatch()` before
  479. * the listener is called. It is, however, guaranteed that all subscribers
  480. * registered before the `dispatch()` started will be called with the latest
  481. * state by the time it exits.
  482. *
  483. * @param {Function} listener A callback to be invoked on every dispatch.
  484. * @returns {Function} A function to remove this change listener.
  485. */
  486. function subscribe(listener) {
  487. if (typeof listener !== 'function') {
  488. throw new Error('Expected the listener to be a function.');
  489. }
  490. if (isDispatching) {
  491. throw new Error('You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');
  492. }
  493. var isSubscribed = true;
  494. ensureCanMutateNextListeners();
  495. nextListeners.push(listener);
  496. return function unsubscribe() {
  497. if (!isSubscribed) {
  498. return;
  499. }
  500. if (isDispatching) {
  501. throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');
  502. }
  503. isSubscribed = false;
  504. ensureCanMutateNextListeners();
  505. var index = nextListeners.indexOf(listener);
  506. nextListeners.splice(index, 1);
  507. };
  508. }
  509. /**
  510. * Dispatches an action. It is the only way to trigger a state change.
  511. *
  512. * The `reducer` function, used to create the store, will be called with the
  513. * current state tree and the given `action`. Its return value will
  514. * be considered the **next** state of the tree, and the change listeners
  515. * will be notified.
  516. *
  517. * The base implementation only supports plain object actions. If you want to
  518. * dispatch a Promise, an Observable, a thunk, or something else, you need to
  519. * wrap your store creating function into the corresponding middleware. For
  520. * example, see the documentation for the `redux-thunk` package. Even the
  521. * middleware will eventually dispatch plain object actions using this method.
  522. *
  523. * @param {Object} action A plain object representing “what changed”. It is
  524. * a good idea to keep actions serializable so you can record and replay user
  525. * sessions, or use the time travelling `redux-devtools`. An action must have
  526. * a `type` property which may not be `undefined`. It is a good idea to use
  527. * string constants for action types.
  528. *
  529. * @returns {Object} For convenience, the same action object you dispatched.
  530. *
  531. * Note that, if you use a custom middleware, it may wrap `dispatch()` to
  532. * return something else (for example, a Promise you can await).
  533. */
  534. function dispatch(action) {
  535. if (!isPlainObject(action)) {
  536. throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
  537. }
  538. if (typeof action.type === 'undefined') {
  539. throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
  540. }
  541. if (isDispatching) {
  542. throw new Error('Reducers may not dispatch actions.');
  543. }
  544. try {
  545. isDispatching = true;
  546. currentState = currentReducer(currentState, action);
  547. } finally {
  548. isDispatching = false;
  549. }
  550. var listeners = currentListeners = nextListeners;
  551. for (var i = 0; i < listeners.length; i++) {
  552. var listener = listeners[i];
  553. listener();
  554. }
  555. return action;
  556. }
  557. /**
  558. * Replaces the reducer currently used by the store to calculate the state.
  559. *
  560. * You might need this if your app implements code splitting and you want to
  561. * load some of the reducers dynamically. You might also need this if you
  562. * implement a hot reloading mechanism for Redux.
  563. *
  564. * @param {Function} nextReducer The reducer for the store to use instead.
  565. * @returns {void}
  566. */
  567. function replaceReducer(nextReducer) {
  568. if (typeof nextReducer !== 'function') {
  569. throw new Error('Expected the nextReducer to be a function.');
  570. }
  571. currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
  572. // Any reducers that existed in both the new and old rootReducer
  573. // will receive the previous state. This effectively populates
  574. // the new state tree with any relevant data from the old one.
  575. dispatch({
  576. type: ActionTypes.REPLACE
  577. });
  578. }
  579. /**
  580. * Interoperability point for observable/reactive libraries.
  581. * @returns {observable} A minimal observable of state changes.
  582. * For more information, see the observable proposal:
  583. * https://github.com/tc39/proposal-observable
  584. */
  585. function observable() {
  586. var _ref;
  587. var outerSubscribe = subscribe;
  588. return _ref = {
  589. /**
  590. * The minimal observable subscription method.
  591. * @param {Object} observer Any object that can be used as an observer.
  592. * The observer object should have a `next` method.
  593. * @returns {subscription} An object with an `unsubscribe` method that can
  594. * be used to unsubscribe the observable from the store, and prevent further
  595. * emission of values from the observable.
  596. */
  597. subscribe: function subscribe(observer) {
  598. if (typeof observer !== 'object' || observer === null) {
  599. throw new TypeError('Expected the observer to be an object.');
  600. }
  601. function observeState() {
  602. if (observer.next) {
  603. observer.next(getState());
  604. }
  605. }
  606. observeState();
  607. var unsubscribe = outerSubscribe(observeState);
  608. return {
  609. unsubscribe: unsubscribe
  610. };
  611. }
  612. }, _ref[es["a" /* default */]] = function () {
  613. return this;
  614. }, _ref;
  615. } // When a store is created, an "INIT" action is dispatched so that every
  616. // reducer returns their initial state. This effectively populates
  617. // the initial state tree.
  618. dispatch({
  619. type: ActionTypes.INIT
  620. });
  621. return _ref2 = {
  622. dispatch: dispatch,
  623. subscribe: subscribe,
  624. getState: getState,
  625. replaceReducer: replaceReducer
  626. }, _ref2[es["a" /* default */]] = observable, _ref2;
  627. }
  628. /**
  629. * Prints a warning in the console if it exists.
  630. *
  631. * @param {String} message The warning message.
  632. * @returns {void}
  633. */
  634. function warning(message) {
  635. /* eslint-disable no-console */
  636. if (typeof console !== 'undefined' && typeof console.error === 'function') {
  637. console.error(message);
  638. }
  639. /* eslint-enable no-console */
  640. try {
  641. // This error was thrown as a convenience so that if you enable
  642. // "break on all exceptions" in your console,
  643. // it would pause the execution at this line.
  644. throw new Error(message);
  645. } catch (e) {} // eslint-disable-line no-empty
  646. }
  647. function getUndefinedStateErrorMessage(key, action) {
  648. var actionType = action && action.type;
  649. var actionDescription = actionType && "action \"" + String(actionType) + "\"" || 'an action';
  650. return "Given " + actionDescription + ", reducer \"" + key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined.";
  651. }
  652. function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
  653. var reducerKeys = Object.keys(reducers);
  654. var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
  655. if (reducerKeys.length === 0) {
  656. return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
  657. }
  658. if (!isPlainObject(inputState)) {
  659. return "The " + argumentName + " has unexpected type of \"" + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
  660. }
  661. var unexpectedKeys = Object.keys(inputState).filter(function (key) {
  662. return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
  663. });
  664. unexpectedKeys.forEach(function (key) {
  665. unexpectedKeyCache[key] = true;
  666. });
  667. if (action && action.type === ActionTypes.REPLACE) return;
  668. if (unexpectedKeys.length > 0) {
  669. return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored.");
  670. }
  671. }
  672. function assertReducerShape(reducers) {
  673. Object.keys(reducers).forEach(function (key) {
  674. var reducer = reducers[key];
  675. var initialState = reducer(undefined, {
  676. type: ActionTypes.INIT
  677. });
  678. if (typeof initialState === 'undefined') {
  679. throw new Error("Reducer \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined.");
  680. }
  681. if (typeof reducer(undefined, {
  682. type: ActionTypes.PROBE_UNKNOWN_ACTION()
  683. }) === 'undefined') {
  684. throw new Error("Reducer \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle " + ActionTypes.INIT + " or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null.");
  685. }
  686. });
  687. }
  688. /**
  689. * Turns an object whose values are different reducer functions, into a single
  690. * reducer function. It will call every child reducer, and gather their results
  691. * into a single state object, whose keys correspond to the keys of the passed
  692. * reducer functions.
  693. *
  694. * @param {Object} reducers An object whose values correspond to different
  695. * reducer functions that need to be combined into one. One handy way to obtain
  696. * it is to use ES6 `import * as reducers` syntax. The reducers may never return
  697. * undefined for any action. Instead, they should return their initial state
  698. * if the state passed to them was undefined, and the current state for any
  699. * unrecognized action.
  700. *
  701. * @returns {Function} A reducer function that invokes every reducer inside the
  702. * passed object, and builds a state object with the same shape.
  703. */
  704. function combineReducers(reducers) {
  705. var reducerKeys = Object.keys(reducers);
  706. var finalReducers = {};
  707. for (var i = 0; i < reducerKeys.length; i++) {
  708. var key = reducerKeys[i];
  709. if (false) {}
  710. if (typeof reducers[key] === 'function') {
  711. finalReducers[key] = reducers[key];
  712. }
  713. }
  714. var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same
  715. // keys multiple times.
  716. var unexpectedKeyCache;
  717. if (false) {}
  718. var shapeAssertionError;
  719. try {
  720. assertReducerShape(finalReducers);
  721. } catch (e) {
  722. shapeAssertionError = e;
  723. }
  724. return function combination(state, action) {
  725. if (state === void 0) {
  726. state = {};
  727. }
  728. if (shapeAssertionError) {
  729. throw shapeAssertionError;
  730. }
  731. if (false) { var warningMessage; }
  732. var hasChanged = false;
  733. var nextState = {};
  734. for (var _i = 0; _i < finalReducerKeys.length; _i++) {
  735. var _key = finalReducerKeys[_i];
  736. var reducer = finalReducers[_key];
  737. var previousStateForKey = state[_key];
  738. var nextStateForKey = reducer(previousStateForKey, action);
  739. if (typeof nextStateForKey === 'undefined') {
  740. var errorMessage = getUndefinedStateErrorMessage(_key, action);
  741. throw new Error(errorMessage);
  742. }
  743. nextState[_key] = nextStateForKey;
  744. hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
  745. }
  746. return hasChanged ? nextState : state;
  747. };
  748. }
  749. function bindActionCreator(actionCreator, dispatch) {
  750. return function () {
  751. return dispatch(actionCreator.apply(this, arguments));
  752. };
  753. }
  754. /**
  755. * Turns an object whose values are action creators, into an object with the
  756. * same keys, but with every function wrapped into a `dispatch` call so they
  757. * may be invoked directly. This is just a convenience method, as you can call
  758. * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
  759. *
  760. * For convenience, you can also pass an action creator as the first argument,
  761. * and get a dispatch wrapped function in return.
  762. *
  763. * @param {Function|Object} actionCreators An object whose values are action
  764. * creator functions. One handy way to obtain it is to use ES6 `import * as`
  765. * syntax. You may also pass a single function.
  766. *
  767. * @param {Function} dispatch The `dispatch` function available on your Redux
  768. * store.
  769. *
  770. * @returns {Function|Object} The object mimicking the original object, but with
  771. * every action creator wrapped into the `dispatch` call. If you passed a
  772. * function as `actionCreators`, the return value will also be a single
  773. * function.
  774. */
  775. function bindActionCreators(actionCreators, dispatch) {
  776. if (typeof actionCreators === 'function') {
  777. return bindActionCreator(actionCreators, dispatch);
  778. }
  779. if (typeof actionCreators !== 'object' || actionCreators === null) {
  780. throw new Error("bindActionCreators expected an object or a function, instead received " + (actionCreators === null ? 'null' : typeof actionCreators) + ". " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?");
  781. }
  782. var boundActionCreators = {};
  783. for (var key in actionCreators) {
  784. var actionCreator = actionCreators[key];
  785. if (typeof actionCreator === 'function') {
  786. boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
  787. }
  788. }
  789. return boundActionCreators;
  790. }
  791. function _defineProperty(obj, key, value) {
  792. if (key in obj) {
  793. Object.defineProperty(obj, key, {
  794. value: value,
  795. enumerable: true,
  796. configurable: true,
  797. writable: true
  798. });
  799. } else {
  800. obj[key] = value;
  801. }
  802. return obj;
  803. }
  804. function ownKeys(object, enumerableOnly) {
  805. var keys = Object.keys(object);
  806. if (Object.getOwnPropertySymbols) {
  807. keys.push.apply(keys, Object.getOwnPropertySymbols(object));
  808. }
  809. if (enumerableOnly) keys = keys.filter(function (sym) {
  810. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  811. });
  812. return keys;
  813. }
  814. function _objectSpread2(target) {
  815. for (var i = 1; i < arguments.length; i++) {
  816. var source = arguments[i] != null ? arguments[i] : {};
  817. if (i % 2) {
  818. ownKeys(source, true).forEach(function (key) {
  819. _defineProperty(target, key, source[key]);
  820. });
  821. } else if (Object.getOwnPropertyDescriptors) {
  822. Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
  823. } else {
  824. ownKeys(source).forEach(function (key) {
  825. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  826. });
  827. }
  828. }
  829. return target;
  830. }
  831. /**
  832. * Composes single-argument functions from right to left. The rightmost
  833. * function can take multiple arguments as it provides the signature for
  834. * the resulting composite function.
  835. *
  836. * @param {...Function} funcs The functions to compose.
  837. * @returns {Function} A function obtained by composing the argument functions
  838. * from right to left. For example, compose(f, g, h) is identical to doing
  839. * (...args) => f(g(h(...args))).
  840. */
  841. function compose() {
  842. for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
  843. funcs[_key] = arguments[_key];
  844. }
  845. if (funcs.length === 0) {
  846. return function (arg) {
  847. return arg;
  848. };
  849. }
  850. if (funcs.length === 1) {
  851. return funcs[0];
  852. }
  853. return funcs.reduce(function (a, b) {
  854. return function () {
  855. return a(b.apply(void 0, arguments));
  856. };
  857. });
  858. }
  859. /**
  860. * Creates a store enhancer that applies middleware to the dispatch method
  861. * of the Redux store. This is handy for a variety of tasks, such as expressing
  862. * asynchronous actions in a concise manner, or logging every action payload.
  863. *
  864. * See `redux-thunk` package as an example of the Redux middleware.
  865. *
  866. * Because middleware is potentially asynchronous, this should be the first
  867. * store enhancer in the composition chain.
  868. *
  869. * Note that each middleware will be given the `dispatch` and `getState` functions
  870. * as named arguments.
  871. *
  872. * @param {...Function} middlewares The middleware chain to be applied.
  873. * @returns {Function} A store enhancer applying the middleware.
  874. */
  875. function applyMiddleware() {
  876. for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
  877. middlewares[_key] = arguments[_key];
  878. }
  879. return function (createStore) {
  880. return function () {
  881. var store = createStore.apply(void 0, arguments);
  882. var _dispatch = function dispatch() {
  883. throw new Error('Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');
  884. };
  885. var middlewareAPI = {
  886. getState: store.getState,
  887. dispatch: function dispatch() {
  888. return _dispatch.apply(void 0, arguments);
  889. }
  890. };
  891. var chain = middlewares.map(function (middleware) {
  892. return middleware(middlewareAPI);
  893. });
  894. _dispatch = compose.apply(void 0, chain)(store.dispatch);
  895. return _objectSpread2({}, store, {
  896. dispatch: _dispatch
  897. });
  898. };
  899. };
  900. }
  901. /*
  902. * This is a dummy function to check if the function name has been altered by minification.
  903. * If the function has been minified and NODE_ENV !== 'production', warn the user.
  904. */
  905. function isCrushed() {}
  906. if (false) {}
  907. // EXTERNAL MODULE: external {"this":["wp","reduxRoutine"]}
  908. var external_this_wp_reduxRoutine_ = __webpack_require__(228);
  909. var external_this_wp_reduxRoutine_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_reduxRoutine_);
  910. // EXTERNAL MODULE: ./node_modules/is-promise/index.js
  911. var is_promise = __webpack_require__(98);
  912. var is_promise_default = /*#__PURE__*/__webpack_require__.n(is_promise);
  913. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/promise-middleware.js
  914. /**
  915. * External dependencies
  916. */
  917. /**
  918. * Simplest possible promise redux middleware.
  919. *
  920. * @return {Function} middleware.
  921. */
  922. var promise_middleware_promiseMiddleware = function promiseMiddleware() {
  923. return function (next) {
  924. return function (action) {
  925. if (is_promise_default()(action)) {
  926. return action.then(function (resolvedAction) {
  927. if (resolvedAction) {
  928. return next(resolvedAction);
  929. }
  930. });
  931. }
  932. return next(action);
  933. };
  934. };
  935. };
  936. /* harmony default export */ var promise_middleware = (promise_middleware_promiseMiddleware);
  937. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
  938. var toConsumableArray = __webpack_require__(17);
  939. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/resolvers-cache-middleware.js
  940. /**
  941. * External dependencies
  942. */
  943. /**
  944. * Creates a middleware handling resolvers cache invalidation.
  945. *
  946. * @param {WPDataRegistry} registry The registry reference for which to create
  947. * the middleware.
  948. * @param {string} reducerKey The namespace for which to create the
  949. * middleware.
  950. *
  951. * @return {Function} Middleware function.
  952. */
  953. var resolvers_cache_middleware_createResolversCacheMiddleware = function createResolversCacheMiddleware(registry, reducerKey) {
  954. return function () {
  955. return function (next) {
  956. return function (action) {
  957. var resolvers = registry.select('core/data').getCachedResolvers(reducerKey);
  958. Object.entries(resolvers).forEach(function (_ref) {
  959. var _ref2 = Object(slicedToArray["a" /* default */])(_ref, 2),
  960. selectorName = _ref2[0],
  961. resolversByArgs = _ref2[1];
  962. var resolver = Object(external_lodash_["get"])(registry.stores, [reducerKey, 'resolvers', selectorName]);
  963. if (!resolver || !resolver.shouldInvalidate) {
  964. return;
  965. }
  966. resolversByArgs.forEach(function (value, args) {
  967. // resolversByArgs is the map Map([ args ] => boolean) storing the cache resolution status for a given selector.
  968. // If the value is false it means this resolver has finished its resolution which means we need to invalidate it,
  969. // if it's true it means it's inflight and the invalidation is not necessary.
  970. if (value !== false || !resolver.shouldInvalidate.apply(resolver, [action].concat(Object(toConsumableArray["a" /* default */])(args)))) {
  971. return;
  972. } // Trigger cache invalidation
  973. registry.dispatch('core/data').invalidateResolution(reducerKey, selectorName, args);
  974. });
  975. });
  976. return next(action);
  977. };
  978. };
  979. };
  980. };
  981. /* harmony default export */ var resolvers_cache_middleware = (resolvers_cache_middleware_createResolversCacheMiddleware);
  982. // EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js
  983. var equivalent_key_map = __webpack_require__(74);
  984. var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map);
  985. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
  986. var defineProperty = __webpack_require__(10);
  987. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/utils.js
  988. /**
  989. * Higher-order reducer creator which creates a combined reducer object, keyed
  990. * by a property on the action object.
  991. *
  992. * @param {string} actionProperty Action property by which to key object.
  993. *
  994. * @return {Function} Higher-order reducer.
  995. */
  996. var utils_onSubKey = function onSubKey(actionProperty) {
  997. return function (reducer) {
  998. return function () {
  999. var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1000. var action = arguments.length > 1 ? arguments[1] : undefined;
  1001. // Retrieve subkey from action. Do not track if undefined; useful for cases
  1002. // where reducer is scoped by action shape.
  1003. var key = action[actionProperty];
  1004. if (key === undefined) {
  1005. return state;
  1006. } // Avoid updating state if unchanged. Note that this also accounts for a
  1007. // reducer which returns undefined on a key which is not yet tracked.
  1008. var nextKeyState = reducer(state[key], action);
  1009. if (nextKeyState === state[key]) {
  1010. return state;
  1011. }
  1012. return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, key, nextKeyState));
  1013. };
  1014. };
  1015. };
  1016. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/reducer.js
  1017. /**
  1018. * External dependencies
  1019. */
  1020. /**
  1021. * Internal dependencies
  1022. */
  1023. /**
  1024. * Reducer function returning next state for selector resolution of
  1025. * subkeys, object form:
  1026. *
  1027. * selectorName -> EquivalentKeyMap<Array,boolean>
  1028. *
  1029. * @param {Object} state Current state.
  1030. * @param {Object} action Dispatched action.
  1031. *
  1032. * @return {Object} Next state.
  1033. */
  1034. var subKeysIsResolved = Object(external_lodash_["flowRight"])([utils_onSubKey('selectorName')])(function () {
  1035. var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new equivalent_key_map_default.a();
  1036. var action = arguments.length > 1 ? arguments[1] : undefined;
  1037. switch (action.type) {
  1038. case 'START_RESOLUTION':
  1039. case 'FINISH_RESOLUTION':
  1040. {
  1041. var isStarting = action.type === 'START_RESOLUTION';
  1042. var nextState = new equivalent_key_map_default.a(state);
  1043. nextState.set(action.args, isStarting);
  1044. return nextState;
  1045. }
  1046. case 'INVALIDATE_RESOLUTION':
  1047. {
  1048. var _nextState = new equivalent_key_map_default.a(state);
  1049. _nextState.delete(action.args);
  1050. return _nextState;
  1051. }
  1052. }
  1053. return state;
  1054. });
  1055. /**
  1056. * Reducer function returning next state for selector resolution, object form:
  1057. *
  1058. * selectorName -> EquivalentKeyMap<Array, boolean>
  1059. *
  1060. * @param {Object} state Current state.
  1061. * @param {Object} action Dispatched action.
  1062. *
  1063. * @return {Object} Next state.
  1064. */
  1065. var reducer_isResolved = function isResolved() {
  1066. var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1067. var action = arguments.length > 1 ? arguments[1] : undefined;
  1068. switch (action.type) {
  1069. case 'INVALIDATE_RESOLUTION_FOR_STORE':
  1070. return {};
  1071. case 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR':
  1072. return Object(external_lodash_["has"])(state, [action.selectorName]) ? Object(external_lodash_["omit"])(state, [action.selectorName]) : state;
  1073. case 'START_RESOLUTION':
  1074. case 'FINISH_RESOLUTION':
  1075. case 'INVALIDATE_RESOLUTION':
  1076. return subKeysIsResolved(state, action);
  1077. }
  1078. return state;
  1079. };
  1080. /* harmony default export */ var metadata_reducer = (reducer_isResolved);
  1081. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/selectors.js
  1082. /**
  1083. * External dependencies
  1084. */
  1085. /**
  1086. * Returns the raw `isResolving` value for a given selector name,
  1087. * and arguments set. May be undefined if the selector has never been resolved
  1088. * or not resolved for the given set of arguments, otherwise true or false for
  1089. * resolution started and completed respectively.
  1090. *
  1091. * @param {Object} state Data state.
  1092. * @param {string} selectorName Selector name.
  1093. * @param {Array} args Arguments passed to selector.
  1094. *
  1095. * @return {?boolean} isResolving value.
  1096. */
  1097. function getIsResolving(state, selectorName, args) {
  1098. var map = Object(external_lodash_["get"])(state, [selectorName]);
  1099. if (!map) {
  1100. return;
  1101. }
  1102. return map.get(args);
  1103. }
  1104. /**
  1105. * Returns true if resolution has already been triggered for a given
  1106. * selector name, and arguments set.
  1107. *
  1108. * @param {Object} state Data state.
  1109. * @param {string} selectorName Selector name.
  1110. * @param {?Array} args Arguments passed to selector (default `[]`).
  1111. *
  1112. * @return {boolean} Whether resolution has been triggered.
  1113. */
  1114. function hasStartedResolution(state, selectorName) {
  1115. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1116. return getIsResolving(state, selectorName, args) !== undefined;
  1117. }
  1118. /**
  1119. * Returns true if resolution has completed for a given selector
  1120. * name, and arguments set.
  1121. *
  1122. * @param {Object} state Data state.
  1123. * @param {string} selectorName Selector name.
  1124. * @param {?Array} args Arguments passed to selector.
  1125. *
  1126. * @return {boolean} Whether resolution has completed.
  1127. */
  1128. function hasFinishedResolution(state, selectorName) {
  1129. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1130. return getIsResolving(state, selectorName, args) === false;
  1131. }
  1132. /**
  1133. * Returns true if resolution has been triggered but has not yet completed for
  1134. * a given selector name, and arguments set.
  1135. *
  1136. * @param {Object} state Data state.
  1137. * @param {string} selectorName Selector name.
  1138. * @param {?Array} args Arguments passed to selector.
  1139. *
  1140. * @return {boolean} Whether resolution is in progress.
  1141. */
  1142. function isResolving(state, selectorName) {
  1143. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1144. return getIsResolving(state, selectorName, args) === true;
  1145. }
  1146. /**
  1147. * Returns the list of the cached resolvers.
  1148. *
  1149. * @param {Object} state Data state.
  1150. *
  1151. * @return {Object} Resolvers mapped by args and selectorName.
  1152. */
  1153. function getCachedResolvers(state) {
  1154. return state;
  1155. }
  1156. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/actions.js
  1157. /**
  1158. * Returns an action object used in signalling that selector resolution has
  1159. * started.
  1160. *
  1161. * @param {string} selectorName Name of selector for which resolver triggered.
  1162. * @param {...*} args Arguments to associate for uniqueness.
  1163. *
  1164. * @return {Object} Action object.
  1165. */
  1166. function startResolution(selectorName, args) {
  1167. return {
  1168. type: 'START_RESOLUTION',
  1169. selectorName: selectorName,
  1170. args: args
  1171. };
  1172. }
  1173. /**
  1174. * Returns an action object used in signalling that selector resolution has
  1175. * completed.
  1176. *
  1177. * @param {string} selectorName Name of selector for which resolver triggered.
  1178. * @param {...*} args Arguments to associate for uniqueness.
  1179. *
  1180. * @return {Object} Action object.
  1181. */
  1182. function finishResolution(selectorName, args) {
  1183. return {
  1184. type: 'FINISH_RESOLUTION',
  1185. selectorName: selectorName,
  1186. args: args
  1187. };
  1188. }
  1189. /**
  1190. * Returns an action object used in signalling that we should invalidate the resolution cache.
  1191. *
  1192. * @param {string} selectorName Name of selector for which resolver should be invalidated.
  1193. * @param {Array} args Arguments to associate for uniqueness.
  1194. *
  1195. * @return {Object} Action object.
  1196. */
  1197. function invalidateResolution(selectorName, args) {
  1198. return {
  1199. type: 'INVALIDATE_RESOLUTION',
  1200. selectorName: selectorName,
  1201. args: args
  1202. };
  1203. }
  1204. /**
  1205. * Returns an action object used in signalling that the resolution
  1206. * should be invalidated.
  1207. *
  1208. * @return {Object} Action object.
  1209. */
  1210. function invalidateResolutionForStore() {
  1211. return {
  1212. type: 'INVALIDATE_RESOLUTION_FOR_STORE'
  1213. };
  1214. }
  1215. /**
  1216. * Returns an action object used in signalling that the resolution cache for a
  1217. * given selectorName should be invalidated.
  1218. *
  1219. * @param {string} selectorName Name of selector for which all resolvers should
  1220. * be invalidated.
  1221. *
  1222. * @return {Object} Action object.
  1223. */
  1224. function invalidateResolutionForStoreSelector(selectorName) {
  1225. return {
  1226. type: 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR',
  1227. selectorName: selectorName
  1228. };
  1229. }
  1230. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/index.js
  1231. /**
  1232. * External dependencies
  1233. */
  1234. /**
  1235. * WordPress dependencies
  1236. */
  1237. /**
  1238. * Internal dependencies
  1239. */
  1240. /**
  1241. * @typedef {import('../registry').WPDataRegistry} WPDataRegistry
  1242. */
  1243. /**
  1244. * Creates a namespace object with a store derived from the reducer given.
  1245. *
  1246. * @param {string} key Unique namespace identifier.
  1247. * @param {Object} options Registered store options, with properties
  1248. * describing reducer, actions, selectors, and
  1249. * resolvers.
  1250. * @param {WPDataRegistry} registry Registry reference.
  1251. *
  1252. * @return {Object} Store Object.
  1253. */
  1254. function createNamespace(key, options, registry) {
  1255. var reducer = options.reducer;
  1256. var store = createReduxStore(key, options, registry);
  1257. var resolvers;
  1258. var actions = mapActions(Object(objectSpread["a" /* default */])({}, actions_namespaceObject, options.actions), store);
  1259. var selectors = mapSelectors(Object(objectSpread["a" /* default */])({}, Object(external_lodash_["mapValues"])(selectors_namespaceObject, function (selector) {
  1260. return function (state) {
  1261. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  1262. args[_key - 1] = arguments[_key];
  1263. }
  1264. return selector.apply(void 0, [state.metadata].concat(args));
  1265. };
  1266. }), Object(external_lodash_["mapValues"])(options.selectors, function (selector) {
  1267. if (selector.isRegistrySelector) {
  1268. selector.registry = registry;
  1269. }
  1270. return function (state) {
  1271. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  1272. args[_key2 - 1] = arguments[_key2];
  1273. }
  1274. return selector.apply(void 0, [state.root].concat(args));
  1275. };
  1276. })), store);
  1277. if (options.resolvers) {
  1278. var result = mapResolvers(options.resolvers, selectors, store);
  1279. resolvers = result.resolvers;
  1280. selectors = result.selectors;
  1281. }
  1282. var getSelectors = function getSelectors() {
  1283. return selectors;
  1284. };
  1285. var getActions = function getActions() {
  1286. return actions;
  1287. }; // We have some modules monkey-patching the store object
  1288. // It's wrong to do so but until we refactor all of our effects to controls
  1289. // We need to keep the same "store" instance here.
  1290. store.__unstableOriginalGetState = store.getState;
  1291. store.getState = function () {
  1292. return store.__unstableOriginalGetState().root;
  1293. }; // Customize subscribe behavior to call listeners only on effective change,
  1294. // not on every dispatch.
  1295. var subscribe = store && function (listener) {
  1296. var lastState = store.__unstableOriginalGetState();
  1297. store.subscribe(function () {
  1298. var state = store.__unstableOriginalGetState();
  1299. var hasChanged = state !== lastState;
  1300. lastState = state;
  1301. if (hasChanged) {
  1302. listener();
  1303. }
  1304. });
  1305. }; // This can be simplified to just { subscribe, getSelectors, getActions }
  1306. // Once we remove the use function.
  1307. return {
  1308. reducer: reducer,
  1309. store: store,
  1310. actions: actions,
  1311. selectors: selectors,
  1312. resolvers: resolvers,
  1313. getSelectors: getSelectors,
  1314. getActions: getActions,
  1315. subscribe: subscribe
  1316. };
  1317. }
  1318. /**
  1319. * Creates a redux store for a namespace.
  1320. *
  1321. * @param {string} key Unique namespace identifier.
  1322. * @param {Object} options Registered store options, with properties
  1323. * describing reducer, actions, selectors, and
  1324. * resolvers.
  1325. * @param {WPDataRegistry} registry Registry reference.
  1326. *
  1327. * @return {Object} Newly created redux store.
  1328. */
  1329. function createReduxStore(key, options, registry) {
  1330. var middlewares = [resolvers_cache_middleware(registry, key), promise_middleware];
  1331. if (options.controls) {
  1332. var normalizedControls = Object(external_lodash_["mapValues"])(options.controls, function (control) {
  1333. return control.isRegistryControl ? control(registry) : control;
  1334. });
  1335. middlewares.push(external_this_wp_reduxRoutine_default()(normalizedControls));
  1336. }
  1337. var enhancers = [applyMiddleware.apply(void 0, middlewares)];
  1338. if (typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__) {
  1339. enhancers.push(window.__REDUX_DEVTOOLS_EXTENSION__({
  1340. name: key,
  1341. instanceId: key
  1342. }));
  1343. }
  1344. var reducer = options.reducer,
  1345. initialState = options.initialState;
  1346. var enhancedReducer = turbo_combine_reducers_default()({
  1347. metadata: metadata_reducer,
  1348. root: reducer
  1349. });
  1350. return createStore(enhancedReducer, {
  1351. root: initialState
  1352. }, Object(external_lodash_["flowRight"])(enhancers));
  1353. }
  1354. /**
  1355. * Maps selectors to a store.
  1356. *
  1357. * @param {Object} selectors Selectors to register. Keys will be used as the
  1358. * public facing API. Selectors will get passed the
  1359. * state as first argument.
  1360. * @param {Object} store The store to which the selectors should be mapped.
  1361. *
  1362. * @return {Object} Selectors mapped to the provided store.
  1363. */
  1364. function mapSelectors(selectors, store) {
  1365. var createStateSelector = function createStateSelector(registrySelector) {
  1366. var selector = function runSelector() {
  1367. // This function is an optimized implementation of:
  1368. //
  1369. // selector( store.getState(), ...arguments )
  1370. //
  1371. // Where the above would incur an `Array#concat` in its application,
  1372. // the logic here instead efficiently constructs an arguments array via
  1373. // direct assignment.
  1374. var argsLength = arguments.length;
  1375. var args = new Array(argsLength + 1);
  1376. args[0] = store.__unstableOriginalGetState();
  1377. for (var i = 0; i < argsLength; i++) {
  1378. args[i + 1] = arguments[i];
  1379. }
  1380. return registrySelector.apply(void 0, args);
  1381. };
  1382. selector.hasResolver = false;
  1383. return selector;
  1384. };
  1385. return Object(external_lodash_["mapValues"])(selectors, createStateSelector);
  1386. }
  1387. /**
  1388. * Maps actions to dispatch from a given store.
  1389. *
  1390. * @param {Object} actions Actions to register.
  1391. * @param {Object} store The redux store to which the actions should be mapped.
  1392. * @return {Object} Actions mapped to the redux store provided.
  1393. */
  1394. function mapActions(actions, store) {
  1395. var createBoundAction = function createBoundAction(action) {
  1396. return function () {
  1397. return Promise.resolve(store.dispatch(action.apply(void 0, arguments)));
  1398. };
  1399. };
  1400. return Object(external_lodash_["mapValues"])(actions, createBoundAction);
  1401. }
  1402. /**
  1403. * Returns resolvers with matched selectors for a given namespace.
  1404. * Resolvers are side effects invoked once per argument set of a given selector call,
  1405. * used in ensuring that the data needs for the selector are satisfied.
  1406. *
  1407. * @param {Object} resolvers Resolvers to register.
  1408. * @param {Object} selectors The current selectors to be modified.
  1409. * @param {Object} store The redux store to which the resolvers should be mapped.
  1410. * @return {Object} An object containing updated selectors and resolvers.
  1411. */
  1412. function mapResolvers(resolvers, selectors, store) {
  1413. var mappedResolvers = Object(external_lodash_["mapValues"])(resolvers, function (resolver) {
  1414. var _resolver$fulfill = resolver.fulfill,
  1415. resolverFulfill = _resolver$fulfill === void 0 ? resolver : _resolver$fulfill;
  1416. return Object(objectSpread["a" /* default */])({}, resolver, {
  1417. fulfill: resolverFulfill
  1418. });
  1419. });
  1420. var mapSelector = function mapSelector(selector, selectorName) {
  1421. var resolver = resolvers[selectorName];
  1422. if (!resolver) {
  1423. selector.hasResolver = false;
  1424. return selector;
  1425. }
  1426. var selectorResolver = function selectorResolver() {
  1427. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  1428. args[_key3] = arguments[_key3];
  1429. }
  1430. function fulfillSelector() {
  1431. return _fulfillSelector.apply(this, arguments);
  1432. }
  1433. function _fulfillSelector() {
  1434. _fulfillSelector = Object(asyncToGenerator["a" /* default */])(
  1435. /*#__PURE__*/
  1436. regenerator_default.a.mark(function _callee() {
  1437. var state, _store$__unstableOrig, metadata;
  1438. return regenerator_default.a.wrap(function _callee$(_context) {
  1439. while (1) {
  1440. switch (_context.prev = _context.next) {
  1441. case 0:
  1442. state = store.getState();
  1443. if (!(typeof resolver.isFulfilled === 'function' && resolver.isFulfilled.apply(resolver, [state].concat(args)))) {
  1444. _context.next = 3;
  1445. break;
  1446. }
  1447. return _context.abrupt("return");
  1448. case 3:
  1449. _store$__unstableOrig = store.__unstableOriginalGetState(), metadata = _store$__unstableOrig.metadata;
  1450. if (!hasStartedResolution(metadata, selectorName, args)) {
  1451. _context.next = 6;
  1452. break;
  1453. }
  1454. return _context.abrupt("return");
  1455. case 6:
  1456. store.dispatch(startResolution(selectorName, args));
  1457. _context.next = 9;
  1458. return fulfillResolver.apply(void 0, [store, mappedResolvers, selectorName].concat(args));
  1459. case 9:
  1460. store.dispatch(finishResolution(selectorName, args));
  1461. case 10:
  1462. case "end":
  1463. return _context.stop();
  1464. }
  1465. }
  1466. }, _callee);
  1467. }));
  1468. return _fulfillSelector.apply(this, arguments);
  1469. }
  1470. fulfillSelector.apply(void 0, args);
  1471. return selector.apply(void 0, args);
  1472. };
  1473. selectorResolver.hasResolver = true;
  1474. return selectorResolver;
  1475. };
  1476. return {
  1477. resolvers: mappedResolvers,
  1478. selectors: Object(external_lodash_["mapValues"])(selectors, mapSelector)
  1479. };
  1480. }
  1481. /**
  1482. * Calls a resolver given arguments
  1483. *
  1484. * @param {Object} store Store reference, for fulfilling via resolvers
  1485. * @param {Object} resolvers Store Resolvers
  1486. * @param {string} selectorName Selector name to fulfill.
  1487. * @param {Array} args Selector Arguments.
  1488. */
  1489. function fulfillResolver(_x, _x2, _x3) {
  1490. return _fulfillResolver.apply(this, arguments);
  1491. }
  1492. function _fulfillResolver() {
  1493. _fulfillResolver = Object(asyncToGenerator["a" /* default */])(
  1494. /*#__PURE__*/
  1495. regenerator_default.a.mark(function _callee2(store, resolvers, selectorName) {
  1496. var resolver,
  1497. _len4,
  1498. args,
  1499. _key4,
  1500. action,
  1501. _args2 = arguments;
  1502. return regenerator_default.a.wrap(function _callee2$(_context2) {
  1503. while (1) {
  1504. switch (_context2.prev = _context2.next) {
  1505. case 0:
  1506. resolver = Object(external_lodash_["get"])(resolvers, [selectorName]);
  1507. if (resolver) {
  1508. _context2.next = 3;
  1509. break;
  1510. }
  1511. return _context2.abrupt("return");
  1512. case 3:
  1513. for (_len4 = _args2.length, args = new Array(_len4 > 3 ? _len4 - 3 : 0), _key4 = 3; _key4 < _len4; _key4++) {
  1514. args[_key4 - 3] = _args2[_key4];
  1515. }
  1516. action = resolver.fulfill.apply(resolver, args);
  1517. if (!action) {
  1518. _context2.next = 8;
  1519. break;
  1520. }
  1521. _context2.next = 8;
  1522. return store.dispatch(action);
  1523. case 8:
  1524. case "end":
  1525. return _context2.stop();
  1526. }
  1527. }
  1528. }, _callee2);
  1529. }));
  1530. return _fulfillResolver.apply(this, arguments);
  1531. }
  1532. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/store/index.js
  1533. function createCoreDataStore(registry) {
  1534. var getCoreDataSelector = function getCoreDataSelector(selectorName) {
  1535. return function (reducerKey) {
  1536. var _registry$select;
  1537. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  1538. args[_key - 1] = arguments[_key];
  1539. }
  1540. return (_registry$select = registry.select(reducerKey))[selectorName].apply(_registry$select, args);
  1541. };
  1542. };
  1543. var getCoreDataAction = function getCoreDataAction(actionName) {
  1544. return function (reducerKey) {
  1545. var _registry$dispatch;
  1546. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  1547. args[_key2 - 1] = arguments[_key2];
  1548. }
  1549. return (_registry$dispatch = registry.dispatch(reducerKey))[actionName].apply(_registry$dispatch, args);
  1550. };
  1551. };
  1552. return {
  1553. getSelectors: function getSelectors() {
  1554. return ['getIsResolving', 'hasStartedResolution', 'hasFinishedResolution', 'isResolving', 'getCachedResolvers'].reduce(function (memo, selectorName) {
  1555. return Object(objectSpread["a" /* default */])({}, memo, Object(defineProperty["a" /* default */])({}, selectorName, getCoreDataSelector(selectorName)));
  1556. }, {});
  1557. },
  1558. getActions: function getActions() {
  1559. return ['startResolution', 'finishResolution', 'invalidateResolution', 'invalidateResolutionForStore', 'invalidateResolutionForStoreSelector'].reduce(function (memo, actionName) {
  1560. return Object(objectSpread["a" /* default */])({}, memo, Object(defineProperty["a" /* default */])({}, actionName, getCoreDataAction(actionName)));
  1561. }, {});
  1562. },
  1563. subscribe: function subscribe() {
  1564. // There's no reasons to trigger any listener when we subscribe to this store
  1565. // because there's no state stored in this store that need to retrigger selectors
  1566. // if a change happens, the corresponding store where the tracking stated live
  1567. // would have already triggered a "subscribe" call.
  1568. return function () {};
  1569. }
  1570. };
  1571. }
  1572. /* harmony default export */ var build_module_store = (createCoreDataStore);
  1573. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/registry.js
  1574. /**
  1575. * External dependencies
  1576. */
  1577. /**
  1578. * Internal dependencies
  1579. */
  1580. /**
  1581. * @typedef {Object} WPDataRegistry An isolated orchestrator of store registrations.
  1582. *
  1583. * @property {Function} registerGenericStore Given a namespace key and settings
  1584. * object, registers a new generic
  1585. * store.
  1586. * @property {Function} registerStore Given a namespace key and settings
  1587. * object, registers a new namespace
  1588. * store.
  1589. * @property {Function} subscribe Given a function callback, invokes
  1590. * the callback on any change to state
  1591. * within any registered store.
  1592. * @property {Function} select Given a namespace key, returns an
  1593. * object of the store's registered
  1594. * selectors.
  1595. * @property {Function} dispatch Given a namespace key, returns an
  1596. * object of the store's registered
  1597. * action dispatchers.
  1598. */
  1599. /**
  1600. * @typedef {Object} WPDataPlugin An object of registry function overrides.
  1601. */
  1602. /**
  1603. * Creates a new store registry, given an optional object of initial store
  1604. * configurations.
  1605. *
  1606. * @param {Object} storeConfigs Initial store configurations.
  1607. * @param {Object?} parent Parent registry.
  1608. *
  1609. * @return {WPDataRegistry} Data registry.
  1610. */
  1611. function createRegistry() {
  1612. var storeConfigs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1613. var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  1614. var stores = {};
  1615. var listeners = [];
  1616. /**
  1617. * Global listener called for each store's update.
  1618. */
  1619. function globalListener() {
  1620. listeners.forEach(function (listener) {
  1621. return listener();
  1622. });
  1623. }
  1624. /**
  1625. * Subscribe to changes to any data.
  1626. *
  1627. * @param {Function} listener Listener function.
  1628. *
  1629. * @return {Function} Unsubscribe function.
  1630. */
  1631. var subscribe = function subscribe(listener) {
  1632. listeners.push(listener);
  1633. return function () {
  1634. listeners = Object(external_lodash_["without"])(listeners, listener);
  1635. };
  1636. };
  1637. /**
  1638. * Calls a selector given the current state and extra arguments.
  1639. *
  1640. * @param {string} reducerKey Part of the state shape to register the
  1641. * selectors for.
  1642. *
  1643. * @return {*} The selector's returned value.
  1644. */
  1645. function select(reducerKey) {
  1646. var store = stores[reducerKey];
  1647. if (store) {
  1648. return store.getSelectors();
  1649. }
  1650. return parent && parent.select(reducerKey);
  1651. }
  1652. /**
  1653. * Returns the available actions for a part of the state.
  1654. *
  1655. * @param {string} reducerKey Part of the state shape to dispatch the
  1656. * action for.
  1657. *
  1658. * @return {*} The action's returned value.
  1659. */
  1660. function dispatch(reducerKey) {
  1661. var store = stores[reducerKey];
  1662. if (store) {
  1663. return store.getActions();
  1664. }
  1665. return parent && parent.dispatch(reducerKey);
  1666. } //
  1667. // Deprecated
  1668. // TODO: Remove this after `use()` is removed.
  1669. //
  1670. function withPlugins(attributes) {
  1671. return Object(external_lodash_["mapValues"])(attributes, function (attribute, key) {
  1672. if (typeof attribute !== 'function') {
  1673. return attribute;
  1674. }
  1675. return function () {
  1676. return registry[key].apply(null, arguments);
  1677. };
  1678. });
  1679. }
  1680. /**
  1681. * Registers a generic store.
  1682. *
  1683. * @param {string} key Store registry key.
  1684. * @param {Object} config Configuration (getSelectors, getActions, subscribe).
  1685. */
  1686. function registerGenericStore(key, config) {
  1687. if (typeof config.getSelectors !== 'function') {
  1688. throw new TypeError('config.getSelectors must be a function');
  1689. }
  1690. if (typeof config.getActions !== 'function') {
  1691. throw new TypeError('config.getActions must be a function');
  1692. }
  1693. if (typeof config.subscribe !== 'function') {
  1694. throw new TypeError('config.subscribe must be a function');
  1695. }
  1696. stores[key] = config;
  1697. config.subscribe(globalListener);
  1698. }
  1699. var registry = {
  1700. registerGenericStore: registerGenericStore,
  1701. stores: stores,
  1702. namespaces: stores,
  1703. // TODO: Deprecate/remove this.
  1704. subscribe: subscribe,
  1705. select: select,
  1706. dispatch: dispatch,
  1707. use: use
  1708. };
  1709. /**
  1710. * Registers a standard `@wordpress/data` store.
  1711. *
  1712. * @param {string} reducerKey Reducer key.
  1713. * @param {Object} options Store description (reducer, actions, selectors, resolvers).
  1714. *
  1715. * @return {Object} Registered store object.
  1716. */
  1717. registry.registerStore = function (reducerKey, options) {
  1718. if (!options.reducer) {
  1719. throw new TypeError('Must specify store reducer');
  1720. }
  1721. var namespace = createNamespace(reducerKey, options, registry);
  1722. registerGenericStore(reducerKey, namespace);
  1723. return namespace.store;
  1724. }; //
  1725. // TODO:
  1726. // This function will be deprecated as soon as it is no longer internally referenced.
  1727. //
  1728. function use(plugin, options) {
  1729. registry = Object(objectSpread["a" /* default */])({}, registry, plugin(registry, options));
  1730. return registry;
  1731. }
  1732. registerGenericStore('core/data', build_module_store(registry));
  1733. Object.entries(storeConfigs).forEach(function (_ref) {
  1734. var _ref2 = Object(slicedToArray["a" /* default */])(_ref, 2),
  1735. name = _ref2[0],
  1736. config = _ref2[1];
  1737. return registry.registerStore(name, config);
  1738. });
  1739. if (parent) {
  1740. parent.subscribe(globalListener);
  1741. }
  1742. return withPlugins(registry);
  1743. }
  1744. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/default-registry.js
  1745. /**
  1746. * Internal dependencies
  1747. */
  1748. /* harmony default export */ var default_registry = (createRegistry());
  1749. // EXTERNAL MODULE: external {"this":["wp","deprecated"]}
  1750. var external_this_wp_deprecated_ = __webpack_require__(37);
  1751. var external_this_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_deprecated_);
  1752. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/controls/index.js
  1753. /**
  1754. * WordPress dependencies
  1755. */
  1756. /* harmony default export */ var controls = (function (registry) {
  1757. external_this_wp_deprecated_default()('wp.data.plugins.controls', {
  1758. hint: 'The controls plugins is now baked-in.'
  1759. });
  1760. return registry;
  1761. });
  1762. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/object.js
  1763. var objectStorage;
  1764. var object_storage = {
  1765. getItem: function getItem(key) {
  1766. if (!objectStorage || !objectStorage[key]) {
  1767. return null;
  1768. }
  1769. return objectStorage[key];
  1770. },
  1771. setItem: function setItem(key, value) {
  1772. if (!objectStorage) {
  1773. object_storage.clear();
  1774. }
  1775. objectStorage[key] = String(value);
  1776. },
  1777. clear: function clear() {
  1778. objectStorage = Object.create(null);
  1779. }
  1780. };
  1781. /* harmony default export */ var object = (object_storage);
  1782. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/default.js
  1783. /**
  1784. * Internal dependencies
  1785. */
  1786. var default_storage;
  1787. try {
  1788. // Private Browsing in Safari 10 and earlier will throw an error when
  1789. // attempting to set into localStorage. The test here is intentional in
  1790. // causing a thrown error as condition for using fallback object storage.
  1791. default_storage = window.localStorage;
  1792. default_storage.setItem('__wpDataTestLocalStorage', '');
  1793. default_storage.removeItem('__wpDataTestLocalStorage');
  1794. } catch (error) {
  1795. default_storage = object;
  1796. }
  1797. /* harmony default export */ var storage_default = (default_storage);
  1798. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/index.js
  1799. /**
  1800. * External dependencies
  1801. */
  1802. /**
  1803. * Internal dependencies
  1804. */
  1805. /**
  1806. * @typedef {Object} WPDataPersistencePluginOptions Persistence plugin options.
  1807. *
  1808. * @property {Storage} storage Persistent storage implementation. This must
  1809. * at least implement `getItem` and `setItem` of
  1810. * the Web Storage API.
  1811. * @property {string} storageKey Key on which to set in persistent storage.
  1812. *
  1813. */
  1814. /**
  1815. * Default plugin storage.
  1816. *
  1817. * @type {Storage}
  1818. */
  1819. var DEFAULT_STORAGE = storage_default;
  1820. /**
  1821. * Default plugin storage key.
  1822. *
  1823. * @type {string}
  1824. */
  1825. var DEFAULT_STORAGE_KEY = 'WP_DATA';
  1826. /**
  1827. * Higher-order reducer which invokes the original reducer only if state is
  1828. * inequal from that of the action's `nextState` property, otherwise returning
  1829. * the original state reference.
  1830. *
  1831. * @param {Function} reducer Original reducer.
  1832. *
  1833. * @return {Function} Enhanced reducer.
  1834. */
  1835. var withLazySameState = function withLazySameState(reducer) {
  1836. return function (state, action) {
  1837. if (action.nextState === state) {
  1838. return state;
  1839. }
  1840. return reducer(state, action);
  1841. };
  1842. };
  1843. /**
  1844. * Creates a persistence interface, exposing getter and setter methods (`get`
  1845. * and `set` respectively).
  1846. *
  1847. * @param {WPDataPersistencePluginOptions} options Plugin options.
  1848. *
  1849. * @return {Object} Persistence interface.
  1850. */
  1851. function createPersistenceInterface(options) {
  1852. var _options$storage = options.storage,
  1853. storage = _options$storage === void 0 ? DEFAULT_STORAGE : _options$storage,
  1854. _options$storageKey = options.storageKey,
  1855. storageKey = _options$storageKey === void 0 ? DEFAULT_STORAGE_KEY : _options$storageKey;
  1856. var data;
  1857. /**
  1858. * Returns the persisted data as an object, defaulting to an empty object.
  1859. *
  1860. * @return {Object} Persisted data.
  1861. */
  1862. function getData() {
  1863. if (data === undefined) {
  1864. // If unset, getItem is expected to return null. Fall back to
  1865. // empty object.
  1866. var persisted = storage.getItem(storageKey);
  1867. if (persisted === null) {
  1868. data = {};
  1869. } else {
  1870. try {
  1871. data = JSON.parse(persisted);
  1872. } catch (error) {
  1873. // Similarly, should any error be thrown during parse of
  1874. // the string (malformed JSON), fall back to empty object.
  1875. data = {};
  1876. }
  1877. }
  1878. }
  1879. return data;
  1880. }
  1881. /**
  1882. * Merges an updated reducer state into the persisted data.
  1883. *
  1884. * @param {string} key Key to update.
  1885. * @param {*} value Updated value.
  1886. */
  1887. function setData(key, value) {
  1888. data = Object(objectSpread["a" /* default */])({}, data, Object(defineProperty["a" /* default */])({}, key, value));
  1889. storage.setItem(storageKey, JSON.stringify(data));
  1890. }
  1891. return {
  1892. get: getData,
  1893. set: setData
  1894. };
  1895. }
  1896. /**
  1897. * Data plugin to persist store state into a single storage key.
  1898. *
  1899. * @param {WPDataRegistry} registry Data registry.
  1900. * @param {?WPDataPersistencePluginOptions} pluginOptions Plugin options.
  1901. *
  1902. * @return {WPDataPlugin} Data plugin.
  1903. */
  1904. var persistence_persistencePlugin = function persistencePlugin(registry, pluginOptions) {
  1905. var persistence = createPersistenceInterface(pluginOptions);
  1906. /**
  1907. * Creates an enhanced store dispatch function, triggering the state of the
  1908. * given reducer key to be persisted when changed.
  1909. *
  1910. * @param {Function} getState Function which returns current state.
  1911. * @param {string} reducerKey Reducer key.
  1912. * @param {?Array<string>} keys Optional subset of keys to save.
  1913. *
  1914. * @return {Function} Enhanced dispatch function.
  1915. */
  1916. function createPersistOnChange(getState, reducerKey, keys) {
  1917. var getPersistedState;
  1918. if (Array.isArray(keys)) {
  1919. // Given keys, the persisted state should by produced as an object
  1920. // of the subset of keys. This implementation uses combineReducers
  1921. // to leverage its behavior of returning the same object when none
  1922. // of the property values changes. This allows a strict reference
  1923. // equality to bypass a persistence set on an unchanging state.
  1924. var reducers = keys.reduce(function (result, key) {
  1925. return Object.assign(result, Object(defineProperty["a" /* default */])({}, key, function (state, action) {
  1926. return action.nextState[key];
  1927. }));
  1928. }, {});
  1929. getPersistedState = withLazySameState(turbo_combine_reducers_default()(reducers));
  1930. } else {
  1931. getPersistedState = function getPersistedState(state, action) {
  1932. return action.nextState;
  1933. };
  1934. }
  1935. var lastState = getPersistedState(undefined, {
  1936. nextState: getState()
  1937. });
  1938. return function () {
  1939. var state = getPersistedState(lastState, {
  1940. nextState: getState()
  1941. });
  1942. if (state !== lastState) {
  1943. persistence.set(reducerKey, state);
  1944. lastState = state;
  1945. }
  1946. };
  1947. }
  1948. return {
  1949. registerStore: function registerStore(reducerKey, options) {
  1950. if (!options.persist) {
  1951. return registry.registerStore(reducerKey, options);
  1952. } // Load from persistence to use as initial state.
  1953. var persistedState = persistence.get()[reducerKey];
  1954. if (persistedState !== undefined) {
  1955. var initialState = options.reducer(undefined, {
  1956. type: '@@WP/PERSISTENCE_RESTORE'
  1957. });
  1958. if (Object(external_lodash_["isPlainObject"])(initialState) && Object(external_lodash_["isPlainObject"])(persistedState)) {
  1959. // If state is an object, ensure that:
  1960. // - Other keys are left intact when persisting only a
  1961. // subset of keys.
  1962. // - New keys in what would otherwise be used as initial
  1963. // state are deeply merged as base for persisted value.
  1964. initialState = Object(external_lodash_["merge"])({}, initialState, persistedState);
  1965. } else {
  1966. // If there is a mismatch in object-likeness of default
  1967. // initial or persisted state, defer to persisted value.
  1968. initialState = persistedState;
  1969. }
  1970. options = Object(objectSpread["a" /* default */])({}, options, {
  1971. initialState: initialState
  1972. });
  1973. }
  1974. var store = registry.registerStore(reducerKey, options);
  1975. store.subscribe(createPersistOnChange(store.getState, reducerKey, options.persist));
  1976. return store;
  1977. }
  1978. };
  1979. };
  1980. /**
  1981. * Deprecated: Remove this function once WordPress 5.3 is released.
  1982. */
  1983. persistence_persistencePlugin.__unstableMigrate = function (pluginOptions) {
  1984. var persistence = createPersistenceInterface(pluginOptions); // Preferences migration to introduce the block editor module
  1985. var insertUsage = Object(external_lodash_["get"])(persistence.get(), ['core/editor', 'preferences', 'insertUsage']);
  1986. if (insertUsage) {
  1987. persistence.set('core/block-editor', {
  1988. preferences: {
  1989. insertUsage: insertUsage
  1990. }
  1991. });
  1992. }
  1993. };
  1994. /* harmony default export */ var plugins_persistence = (persistence_persistencePlugin);
  1995. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/index.js
  1996. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
  1997. var esm_extends = __webpack_require__(18);
  1998. // EXTERNAL MODULE: external {"this":["wp","element"]}
  1999. var external_this_wp_element_ = __webpack_require__(0);
  2000. // EXTERNAL MODULE: external {"this":["wp","compose"]}
  2001. var external_this_wp_compose_ = __webpack_require__(8);
  2002. // EXTERNAL MODULE: external {"this":["wp","priorityQueue"]}
  2003. var external_this_wp_priorityQueue_ = __webpack_require__(230);
  2004. // EXTERNAL MODULE: external {"this":["wp","isShallowEqual"]}
  2005. var external_this_wp_isShallowEqual_ = __webpack_require__(41);
  2006. var external_this_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_isShallowEqual_);
  2007. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/registry-provider/context.js
  2008. /**
  2009. * WordPress dependencies
  2010. */
  2011. /**
  2012. * Internal dependencies
  2013. */
  2014. var Context = Object(external_this_wp_element_["createContext"])(default_registry);
  2015. var Consumer = Context.Consumer,
  2016. Provider = Context.Provider;
  2017. /**
  2018. * A custom react Context consumer exposing the provided `registry` to
  2019. * children components. Used along with the RegistryProvider.
  2020. *
  2021. * You can read more about the react context api here:
  2022. * https://reactjs.org/docs/context.html#contextprovider
  2023. *
  2024. * @example
  2025. * ```js
  2026. * const {
  2027. * RegistryProvider,
  2028. * RegistryConsumer,
  2029. * createRegistry
  2030. * } = wp.data;
  2031. *
  2032. * const registry = createRegistry( {} );
  2033. *
  2034. * const App = ( { props } ) => {
  2035. * return <RegistryProvider value={ registry }>
  2036. * <div>Hello There</div>
  2037. * <RegistryConsumer>
  2038. * { ( registry ) => (
  2039. * <ComponentUsingRegistry
  2040. * { ...props }
  2041. * registry={ registry }
  2042. * ) }
  2043. * </RegistryConsumer>
  2044. * </RegistryProvider>
  2045. * }
  2046. * ```
  2047. */
  2048. var RegistryConsumer = Consumer;
  2049. /**
  2050. * A custom Context provider for exposing the provided `registry` to children
  2051. * components via a consumer.
  2052. *
  2053. * See <a name="#RegistryConsumer">RegistryConsumer</a> documentation for
  2054. * example.
  2055. */
  2056. /* harmony default export */ var context = (Provider);
  2057. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.js
  2058. /**
  2059. * WordPress dependencies
  2060. */
  2061. /**
  2062. * Internal dependencies
  2063. */
  2064. /**
  2065. * A custom react hook exposing the registry context for use.
  2066. *
  2067. * This exposes the `registry` value provided via the
  2068. * <a href="#RegistryProvider">Registry Provider</a> to a component implementing
  2069. * this hook.
  2070. *
  2071. * It acts similarly to the `useContext` react hook.
  2072. *
  2073. * Note: Generally speaking, `useRegistry` is a low level hook that in most cases
  2074. * won't be needed for implementation. Most interactions with the wp.data api
  2075. * can be performed via the `useSelect` hook, or the `withSelect` and
  2076. * `withDispatch` higher order components.
  2077. *
  2078. * @example
  2079. * ```js
  2080. * const {
  2081. * RegistryProvider,
  2082. * createRegistry,
  2083. * useRegistry,
  2084. * } = wp.data
  2085. *
  2086. * const registry = createRegistry( {} );
  2087. *
  2088. * const SomeChildUsingRegistry = ( props ) => {
  2089. * const registry = useRegistry( registry );
  2090. * // ...logic implementing the registry in other react hooks.
  2091. * };
  2092. *
  2093. *
  2094. * const ParentProvidingRegistry = ( props ) => {
  2095. * return <RegistryProvider value={ registry }>
  2096. * <SomeChildUsingRegistry { ...props } />
  2097. * </RegistryProvider>
  2098. * };
  2099. * ```
  2100. *
  2101. * @return {Function} A custom react hook exposing the registry context value.
  2102. */
  2103. function useRegistry() {
  2104. return Object(external_this_wp_element_["useContext"])(Context);
  2105. }
  2106. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/async-mode-provider/context.js
  2107. /**
  2108. * WordPress dependencies
  2109. */
  2110. var context_Context = Object(external_this_wp_element_["createContext"])(false);
  2111. var context_Consumer = context_Context.Consumer,
  2112. context_Provider = context_Context.Provider;
  2113. var AsyncModeConsumer = context_Consumer;
  2114. /* harmony default export */ var async_mode_provider_context = (context_Provider);
  2115. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/async-mode-provider/use-async-mode.js
  2116. /**
  2117. * WordPress dependencies
  2118. */
  2119. /**
  2120. * Internal dependencies
  2121. */
  2122. function useAsyncMode() {
  2123. return Object(external_this_wp_element_["useContext"])(context_Context);
  2124. }
  2125. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-select/index.js
  2126. /**
  2127. * WordPress dependencies
  2128. */
  2129. /**
  2130. * Internal dependencies
  2131. */
  2132. /**
  2133. * Favor useLayoutEffect to ensure the store subscription callback always has
  2134. * the selector from the latest render. If a store update happens between render
  2135. * and the effect, this could cause missed/stale updates or inconsistent state.
  2136. *
  2137. * Fallback to useEffect for server rendered components because currently React
  2138. * throws a warning when using useLayoutEffect in that environment.
  2139. */
  2140. var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? external_this_wp_element_["useLayoutEffect"] : external_this_wp_element_["useEffect"];
  2141. var renderQueue = Object(external_this_wp_priorityQueue_["createQueue"])();
  2142. /**
  2143. * Custom react hook for retrieving props from registered selectors.
  2144. *
  2145. * In general, this custom React hook follows the
  2146. * [rules of hooks](https://reactjs.org/docs/hooks-rules.html).
  2147. *
  2148. * @param {Function} _mapSelect Function called on every state change. The
  2149. * returned value is exposed to the component
  2150. * implementing this hook. The function receives
  2151. * the `registry.select` method on the first
  2152. * argument and the `registry` on the second
  2153. * argument.
  2154. * @param {Array} deps If provided, this memoizes the mapSelect so the
  2155. * same `mapSelect` is invoked on every state
  2156. * change unless the dependencies change.
  2157. *
  2158. * @example
  2159. * ```js
  2160. * const { useSelect } = wp.data;
  2161. *
  2162. * function HammerPriceDisplay( { currency } ) {
  2163. * const price = useSelect( ( select ) => {
  2164. * return select( 'my-shop' ).getPrice( 'hammer', currency )
  2165. * }, [ currency ] );
  2166. * return new Intl.NumberFormat( 'en-US', {
  2167. * style: 'currency',
  2168. * currency,
  2169. * } ).format( price );
  2170. * }
  2171. *
  2172. * // Rendered in the application:
  2173. * // <HammerPriceDisplay currency="USD" />
  2174. * ```
  2175. *
  2176. * In the above example, when `HammerPriceDisplay` is rendered into an
  2177. * application, the price will be retrieved from the store state using the
  2178. * `mapSelect` callback on `useSelect`. If the currency prop changes then
  2179. * any price in the state for that currency is retrieved. If the currency prop
  2180. * doesn't change and other props are passed in that do change, the price will
  2181. * not change because the dependency is just the currency.
  2182. *
  2183. * @return {Function} A custom react hook.
  2184. */
  2185. function useSelect(_mapSelect, deps) {
  2186. var mapSelect = Object(external_this_wp_element_["useCallback"])(_mapSelect, deps);
  2187. var registry = useRegistry();
  2188. var isAsync = useAsyncMode();
  2189. var queueContext = Object(external_this_wp_element_["useMemo"])(function () {
  2190. return {
  2191. queue: true
  2192. };
  2193. }, [registry]);
  2194. var _useReducer = Object(external_this_wp_element_["useReducer"])(function (s) {
  2195. return s + 1;
  2196. }, 0),
  2197. _useReducer2 = Object(slicedToArray["a" /* default */])(_useReducer, 2),
  2198. forceRender = _useReducer2[1];
  2199. var latestMapSelect = Object(external_this_wp_element_["useRef"])();
  2200. var latestIsAsync = Object(external_this_wp_element_["useRef"])(isAsync);
  2201. var latestMapOutput = Object(external_this_wp_element_["useRef"])();
  2202. var latestMapOutputError = Object(external_this_wp_element_["useRef"])();
  2203. var isMounted = Object(external_this_wp_element_["useRef"])();
  2204. var mapOutput;
  2205. try {
  2206. if (latestMapSelect.current !== mapSelect || latestMapOutputError.current) {
  2207. mapOutput = mapSelect(registry.select, registry);
  2208. } else {
  2209. mapOutput = latestMapOutput.current;
  2210. }
  2211. } catch (error) {
  2212. var errorMessage = "An error occurred while running 'mapSelect': ".concat(error.message);
  2213. if (latestMapOutputError.current) {
  2214. errorMessage += "\nThe error may be correlated with this previous error:\n";
  2215. errorMessage += "".concat(latestMapOutputError.current.stack, "\n\n");
  2216. errorMessage += 'Original stack trace:';
  2217. throw new Error(errorMessage);
  2218. }
  2219. }
  2220. useIsomorphicLayoutEffect(function () {
  2221. latestMapSelect.current = mapSelect;
  2222. if (latestIsAsync.current !== isAsync) {
  2223. latestIsAsync.current = isAsync;
  2224. renderQueue.flush(queueContext);
  2225. }
  2226. latestMapOutput.current = mapOutput;
  2227. latestMapOutputError.current = undefined;
  2228. isMounted.current = true;
  2229. });
  2230. useIsomorphicLayoutEffect(function () {
  2231. var onStoreChange = function onStoreChange() {
  2232. if (isMounted.current) {
  2233. try {
  2234. var newMapOutput = latestMapSelect.current(registry.select, registry);
  2235. if (external_this_wp_isShallowEqual_default()(latestMapOutput.current, newMapOutput)) {
  2236. return;
  2237. }
  2238. latestMapOutput.current = newMapOutput;
  2239. } catch (error) {
  2240. latestMapOutputError.current = error;
  2241. }
  2242. forceRender({});
  2243. }
  2244. }; // catch any possible state changes during mount before the subscription
  2245. // could be set.
  2246. if (latestIsAsync.current) {
  2247. renderQueue.add(queueContext, onStoreChange);
  2248. } else {
  2249. onStoreChange();
  2250. }
  2251. var unsubscribe = registry.subscribe(function () {
  2252. if (latestIsAsync.current) {
  2253. renderQueue.add(queueContext, onStoreChange);
  2254. } else {
  2255. onStoreChange();
  2256. }
  2257. });
  2258. return function () {
  2259. isMounted.current = false;
  2260. unsubscribe();
  2261. renderQueue.flush(queueContext);
  2262. };
  2263. }, [registry]);
  2264. return mapOutput;
  2265. }
  2266. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-select/index.js
  2267. /**
  2268. * WordPress dependencies
  2269. */
  2270. /**
  2271. * Internal dependencies
  2272. */
  2273. /**
  2274. * Higher-order component used to inject state-derived props using registered
  2275. * selectors.
  2276. *
  2277. * @param {Function} mapSelectToProps Function called on every state change,
  2278. * expected to return object of props to
  2279. * merge with the component's own props.
  2280. *
  2281. * @example
  2282. * ```js
  2283. * function PriceDisplay( { price, currency } ) {
  2284. * return new Intl.NumberFormat( 'en-US', {
  2285. * style: 'currency',
  2286. * currency,
  2287. * } ).format( price );
  2288. * }
  2289. *
  2290. * const { withSelect } = wp.data;
  2291. *
  2292. * const HammerPriceDisplay = withSelect( ( select, ownProps ) => {
  2293. * const { getPrice } = select( 'my-shop' );
  2294. * const { currency } = ownProps;
  2295. *
  2296. * return {
  2297. * price: getPrice( 'hammer', currency ),
  2298. * };
  2299. * } )( PriceDisplay );
  2300. *
  2301. * // Rendered in the application:
  2302. * //
  2303. * // <HammerPriceDisplay currency="USD" />
  2304. * ```
  2305. * In the above example, when `HammerPriceDisplay` is rendered into an
  2306. * application, it will pass the price into the underlying `PriceDisplay`
  2307. * component and update automatically if the price of a hammer ever changes in
  2308. * the store.
  2309. *
  2310. * @return {Component} Enhanced component with merged state data props.
  2311. */
  2312. var with_select_withSelect = function withSelect(mapSelectToProps) {
  2313. return Object(external_this_wp_compose_["createHigherOrderComponent"])(function (WrappedComponent) {
  2314. return Object(external_this_wp_compose_["pure"])(function (ownProps) {
  2315. var mapSelect = function mapSelect(select, registry) {
  2316. return mapSelectToProps(select, ownProps, registry);
  2317. };
  2318. var mergeProps = useSelect(mapSelect);
  2319. return Object(external_this_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, ownProps, mergeProps));
  2320. });
  2321. }, 'withSelect');
  2322. };
  2323. /* harmony default export */ var with_select = (with_select_withSelect);
  2324. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch.js
  2325. /**
  2326. * Internal dependencies
  2327. */
  2328. /**
  2329. * A custom react hook returning the current registry dispatch actions creators.
  2330. *
  2331. * Note: The component using this hook must be within the context of a
  2332. * RegistryProvider.
  2333. *
  2334. * @param {string} [storeName] Optionally provide the name of the store from
  2335. * which to retrieve action creators. If not
  2336. * provided, the registry.dispatch function is
  2337. * returned instead.
  2338. *
  2339. * @example
  2340. * This illustrates a pattern where you may need to retrieve dynamic data from
  2341. * the server via the `useSelect` hook to use in combination with the dispatch
  2342. * action.
  2343. *
  2344. * ```jsx
  2345. * const { useDispatch, useSelect } = wp.data;
  2346. * const { useCallback } = wp.element;
  2347. *
  2348. * function Button( { onClick, children } ) {
  2349. * return <button type="button" onClick={ onClick }>{ children }</button>
  2350. * }
  2351. *
  2352. * const SaleButton = ( { children } ) => {
  2353. * const { stockNumber } = useSelect(
  2354. * ( select ) => select( 'my-shop' ).getStockNumber()
  2355. * );
  2356. * const { startSale } = useDispatch( 'my-shop' );
  2357. * const onClick = useCallback( () => {
  2358. * const discountPercent = stockNumber > 50 ? 10: 20;
  2359. * startSale( discountPercent );
  2360. * }, [ stockNumber ] );
  2361. * return <Button onClick={ onClick }>{ children }</Button>
  2362. * }
  2363. *
  2364. * // Rendered somewhere in the application:
  2365. * //
  2366. * // <SaleButton>Start Sale!</SaleButton>
  2367. * ```
  2368. * @return {Function} A custom react hook.
  2369. */
  2370. var use_dispatch_useDispatch = function useDispatch(storeName) {
  2371. var _useRegistry = useRegistry(),
  2372. dispatch = _useRegistry.dispatch;
  2373. return storeName === void 0 ? dispatch : dispatch(storeName);
  2374. };
  2375. /* harmony default export */ var use_dispatch = (use_dispatch_useDispatch);
  2376. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch-with-map.js
  2377. /**
  2378. * External dependencies
  2379. */
  2380. /**
  2381. * WordPress dependencies
  2382. */
  2383. /**
  2384. * Internal dependencies
  2385. */
  2386. /**
  2387. * Favor useLayoutEffect to ensure the store subscription callback always has
  2388. * the dispatchMap from the latest render. If a store update happens between
  2389. * render and the effect, this could cause missed/stale updates or
  2390. * inconsistent state.
  2391. *
  2392. * Fallback to useEffect for server rendered components because currently React
  2393. * throws a warning when using useLayoutEffect in that environment.
  2394. */
  2395. var use_dispatch_with_map_useIsomorphicLayoutEffect = typeof window !== 'undefined' ? external_this_wp_element_["useLayoutEffect"] : external_this_wp_element_["useEffect"];
  2396. /**
  2397. * Custom react hook for returning aggregate dispatch actions using the provided
  2398. * dispatchMap.
  2399. *
  2400. * Currently this is an internal api only and is implemented by `withDispatch`
  2401. *
  2402. * @param {Function} dispatchMap Receives the `registry.dispatch` function as
  2403. * the first argument and the `registry` object
  2404. * as the second argument. Should return an
  2405. * object mapping props to functions.
  2406. * @param {Array} deps An array of dependencies for the hook.
  2407. * @return {Object} An object mapping props to functions created by the passed
  2408. * in dispatchMap.
  2409. */
  2410. var use_dispatch_with_map_useDispatchWithMap = function useDispatchWithMap(dispatchMap, deps) {
  2411. var registry = useRegistry();
  2412. var currentDispatchMap = Object(external_this_wp_element_["useRef"])(dispatchMap);
  2413. use_dispatch_with_map_useIsomorphicLayoutEffect(function () {
  2414. currentDispatchMap.current = dispatchMap;
  2415. });
  2416. return Object(external_this_wp_element_["useMemo"])(function () {
  2417. var currentDispatchProps = currentDispatchMap.current(registry.dispatch, registry);
  2418. return Object(external_lodash_["mapValues"])(currentDispatchProps, function (dispatcher, propName) {
  2419. if (typeof dispatcher !== 'function') {
  2420. // eslint-disable-next-line no-console
  2421. console.warn("Property ".concat(propName, " returned from dispatchMap in useDispatchWithMap must be a function."));
  2422. }
  2423. return function () {
  2424. var _currentDispatchMap$c;
  2425. return (_currentDispatchMap$c = currentDispatchMap.current(registry.dispatch, registry))[propName].apply(_currentDispatchMap$c, arguments);
  2426. };
  2427. });
  2428. }, [registry].concat(Object(toConsumableArray["a" /* default */])(deps)));
  2429. };
  2430. /* harmony default export */ var use_dispatch_with_map = (use_dispatch_with_map_useDispatchWithMap);
  2431. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-dispatch/index.js
  2432. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-dispatch/index.js
  2433. /**
  2434. * WordPress dependencies
  2435. */
  2436. /**
  2437. * Internal dependencies
  2438. */
  2439. /**
  2440. * Higher-order component used to add dispatch props using registered action
  2441. * creators.
  2442. *
  2443. * @param {Function} mapDispatchToProps A function of returning an object of
  2444. * prop names where value is a
  2445. * dispatch-bound action creator, or a
  2446. * function to be called with the
  2447. * component's props and returning an
  2448. * action creator.
  2449. *
  2450. * @example
  2451. * ```jsx
  2452. * function Button( { onClick, children } ) {
  2453. * return <button type="button" onClick={ onClick }>{ children }</button>;
  2454. * }
  2455. *
  2456. * const { withDispatch } = wp.data;
  2457. *
  2458. * const SaleButton = withDispatch( ( dispatch, ownProps ) => {
  2459. * const { startSale } = dispatch( 'my-shop' );
  2460. * const { discountPercent } = ownProps;
  2461. *
  2462. * return {
  2463. * onClick() {
  2464. * startSale( discountPercent );
  2465. * },
  2466. * };
  2467. * } )( Button );
  2468. *
  2469. * // Rendered in the application:
  2470. * //
  2471. * // <SaleButton discountPercent="20">Start Sale!</SaleButton>
  2472. * ```
  2473. *
  2474. * @example
  2475. * In the majority of cases, it will be sufficient to use only two first params
  2476. * passed to `mapDispatchToProps` as illustrated in the previous example.
  2477. * However, there might be some very advanced use cases where using the
  2478. * `registry` object might be used as a tool to optimize the performance of
  2479. * your component. Using `select` function from the registry might be useful
  2480. * when you need to fetch some dynamic data from the store at the time when the
  2481. * event is fired, but at the same time, you never use it to render your
  2482. * component. In such scenario, you can avoid using the `withSelect` higher
  2483. * order component to compute such prop, which might lead to unnecessary
  2484. * re-renders of your component caused by its frequent value change.
  2485. * Keep in mind, that `mapDispatchToProps` must return an object with functions
  2486. * only.
  2487. *
  2488. * ```jsx
  2489. * function Button( { onClick, children } ) {
  2490. * return <button type="button" onClick={ onClick }>{ children }</button>;
  2491. * }
  2492. *
  2493. * const { withDispatch } = wp.data;
  2494. *
  2495. * const SaleButton = withDispatch( ( dispatch, ownProps, { select } ) => {
  2496. * // Stock number changes frequently.
  2497. * const { getStockNumber } = select( 'my-shop' );
  2498. * const { startSale } = dispatch( 'my-shop' );
  2499. * return {
  2500. * onClick() {
  2501. * const discountPercent = getStockNumber() > 50 ? 10 : 20;
  2502. * startSale( discountPercent );
  2503. * },
  2504. * };
  2505. * } )( Button );
  2506. *
  2507. * // Rendered in the application:
  2508. * //
  2509. * // <SaleButton>Start Sale!</SaleButton>
  2510. * ```
  2511. *
  2512. * _Note:_ It is important that the `mapDispatchToProps` function always
  2513. * returns an object with the same keys. For example, it should not contain
  2514. * conditions under which a different value would be returned.
  2515. *
  2516. * @return {Component} Enhanced component with merged dispatcher props.
  2517. */
  2518. var with_dispatch_withDispatch = function withDispatch(mapDispatchToProps) {
  2519. return Object(external_this_wp_compose_["createHigherOrderComponent"])(function (WrappedComponent) {
  2520. return function (ownProps) {
  2521. var mapDispatch = function mapDispatch(dispatch, registry) {
  2522. return mapDispatchToProps(dispatch, ownProps, registry);
  2523. };
  2524. var dispatchProps = use_dispatch_with_map(mapDispatch, []);
  2525. return Object(external_this_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, ownProps, dispatchProps));
  2526. };
  2527. }, 'withDispatch');
  2528. };
  2529. /* harmony default export */ var with_dispatch = (with_dispatch_withDispatch);
  2530. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/registry-provider/index.js
  2531. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-registry/index.js
  2532. /**
  2533. * WordPress dependencies
  2534. */
  2535. /**
  2536. * Internal dependencies
  2537. */
  2538. /**
  2539. * Higher-order component which renders the original component with the current
  2540. * registry context passed as its `registry` prop.
  2541. *
  2542. * @param {WPComponent} OriginalComponent Original component.
  2543. *
  2544. * @return {WPComponent} Enhanced component.
  2545. */
  2546. var withRegistry = Object(external_this_wp_compose_["createHigherOrderComponent"])(function (OriginalComponent) {
  2547. return function (props) {
  2548. return Object(external_this_wp_element_["createElement"])(RegistryConsumer, null, function (registry) {
  2549. return Object(external_this_wp_element_["createElement"])(OriginalComponent, Object(esm_extends["a" /* default */])({}, props, {
  2550. registry: registry
  2551. }));
  2552. });
  2553. };
  2554. }, 'withRegistry');
  2555. /* harmony default export */ var with_registry = (withRegistry);
  2556. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/async-mode-provider/index.js
  2557. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/factory.js
  2558. /**
  2559. * Internal dependencies
  2560. */
  2561. /**
  2562. * @typedef {import('./registry').WPDataRegistry} WPDataRegistry
  2563. */
  2564. /**
  2565. * Mark a selector as a registry selector.
  2566. *
  2567. * @param {Function} registrySelector Function receiving a registry object and returning a state selector.
  2568. *
  2569. * @return {Function} marked registry selector.
  2570. */
  2571. function createRegistrySelector(registrySelector) {
  2572. var selector = function selector() {
  2573. return registrySelector(selector.registry.select).apply(void 0, arguments);
  2574. };
  2575. /**
  2576. * Flag indicating to selector registration mapping that the selector should
  2577. * be mapped as a registry selector.
  2578. *
  2579. * @type {boolean}
  2580. */
  2581. selector.isRegistrySelector = true;
  2582. /**
  2583. * Registry on which to call `select`, stubbed for non-standard usage to
  2584. * use the default registry.
  2585. *
  2586. * @type {WPDataRegistry}
  2587. */
  2588. selector.registry = default_registry;
  2589. return selector;
  2590. }
  2591. /**
  2592. * Mark a control as a registry control.
  2593. *
  2594. * @param {Function} registryControl Function receiving a registry object and returning a control.
  2595. *
  2596. * @return {Function} marked registry control.
  2597. */
  2598. function createRegistryControl(registryControl) {
  2599. registryControl.isRegistryControl = true;
  2600. return registryControl;
  2601. }
  2602. // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/index.js
  2603. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "select", function() { return build_module_select; });
  2604. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispatch", function() { return build_module_dispatch; });
  2605. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribe", function() { return build_module_subscribe; });
  2606. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerGenericStore", function() { return build_module_registerGenericStore; });
  2607. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerStore", function() { return build_module_registerStore; });
  2608. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "use", function() { return build_module_use; });
  2609. /* concated harmony reexport withSelect */__webpack_require__.d(__webpack_exports__, "withSelect", function() { return with_select; });
  2610. /* concated harmony reexport withDispatch */__webpack_require__.d(__webpack_exports__, "withDispatch", function() { return with_dispatch; });
  2611. /* concated harmony reexport withRegistry */__webpack_require__.d(__webpack_exports__, "withRegistry", function() { return with_registry; });
  2612. /* concated harmony reexport RegistryProvider */__webpack_require__.d(__webpack_exports__, "RegistryProvider", function() { return context; });
  2613. /* concated harmony reexport RegistryConsumer */__webpack_require__.d(__webpack_exports__, "RegistryConsumer", function() { return RegistryConsumer; });
  2614. /* concated harmony reexport useRegistry */__webpack_require__.d(__webpack_exports__, "useRegistry", function() { return useRegistry; });
  2615. /* concated harmony reexport useSelect */__webpack_require__.d(__webpack_exports__, "useSelect", function() { return useSelect; });
  2616. /* concated harmony reexport useDispatch */__webpack_require__.d(__webpack_exports__, "useDispatch", function() { return use_dispatch; });
  2617. /* concated harmony reexport __experimentalAsyncModeProvider */__webpack_require__.d(__webpack_exports__, "__experimentalAsyncModeProvider", function() { return async_mode_provider_context; });
  2618. /* concated harmony reexport createRegistry */__webpack_require__.d(__webpack_exports__, "createRegistry", function() { return createRegistry; });
  2619. /* concated harmony reexport createRegistrySelector */__webpack_require__.d(__webpack_exports__, "createRegistrySelector", function() { return createRegistrySelector; });
  2620. /* concated harmony reexport createRegistryControl */__webpack_require__.d(__webpack_exports__, "createRegistryControl", function() { return createRegistryControl; });
  2621. /* concated harmony reexport plugins */__webpack_require__.d(__webpack_exports__, "plugins", function() { return plugins_namespaceObject; });
  2622. /* concated harmony reexport combineReducers */__webpack_require__.d(__webpack_exports__, "combineReducers", function() { return turbo_combine_reducers_default.a; });
  2623. /**
  2624. * External dependencies
  2625. */
  2626. /**
  2627. * Internal dependencies
  2628. */
  2629. /**
  2630. * Object of available plugins to use with a registry.
  2631. *
  2632. * @see [use](#use)
  2633. *
  2634. * @type {Object}
  2635. */
  2636. /**
  2637. * The combineReducers helper function turns an object whose values are different
  2638. * reducing functions into a single reducing function you can pass to registerReducer.
  2639. *
  2640. * @param {Object} reducers An object whose values correspond to different reducing
  2641. * functions that need to be combined into one.
  2642. *
  2643. * @example
  2644. * ```js
  2645. * const { combineReducers, registerStore } = wp.data;
  2646. *
  2647. * const prices = ( state = {}, action ) => {
  2648. * return action.type === 'SET_PRICE' ?
  2649. * {
  2650. * ...state,
  2651. * [ action.item ]: action.price,
  2652. * } :
  2653. * state;
  2654. * };
  2655. *
  2656. * const discountPercent = ( state = 0, action ) => {
  2657. * return action.type === 'START_SALE' ?
  2658. * action.discountPercent :
  2659. * state;
  2660. * };
  2661. *
  2662. * registerStore( 'my-shop', {
  2663. * reducer: combineReducers( {
  2664. * prices,
  2665. * discountPercent,
  2666. * } ),
  2667. * } );
  2668. * ```
  2669. *
  2670. * @return {Function} A reducer that invokes every reducer inside the reducers
  2671. * object, and constructs a state object with the same shape.
  2672. */
  2673. /**
  2674. * Given the name of a registered store, returns an object of the store's selectors.
  2675. * The selector functions are been pre-bound to pass the current state automatically.
  2676. * As a consumer, you need only pass arguments of the selector, if applicable.
  2677. *
  2678. * @param {string} name Store name
  2679. *
  2680. * @example
  2681. * ```js
  2682. * const { select } = wp.data;
  2683. *
  2684. * select( 'my-shop' ).getPrice( 'hammer' );
  2685. * ```
  2686. *
  2687. * @return {Object} Object containing the store's selectors.
  2688. */
  2689. var build_module_select = default_registry.select;
  2690. /**
  2691. * Given the name of a registered store, returns an object of the store's action creators.
  2692. * Calling an action creator will cause it to be dispatched, updating the state value accordingly.
  2693. *
  2694. * Note: Action creators returned by the dispatch will return a promise when
  2695. * they are called.
  2696. *
  2697. * @param {string} name Store name
  2698. *
  2699. * @example
  2700. * ```js
  2701. * const { dispatch } = wp.data;
  2702. *
  2703. * dispatch( 'my-shop' ).setPrice( 'hammer', 9.75 );
  2704. * ```
  2705. * @return {Object} Object containing the action creators.
  2706. */
  2707. var build_module_dispatch = default_registry.dispatch;
  2708. /**
  2709. * Given a listener function, the function will be called any time the state value
  2710. * of one of the registered stores has changed. This function returns a `unsubscribe`
  2711. * function used to stop the subscription.
  2712. *
  2713. * @param {Function} listener Callback function.
  2714. *
  2715. * @example
  2716. * ```js
  2717. * const { subscribe } = wp.data;
  2718. *
  2719. * const unsubscribe = subscribe( () => {
  2720. * // You could use this opportunity to test whether the derived result of a
  2721. * // selector has subsequently changed as the result of a state update.
  2722. * } );
  2723. *
  2724. * // Later, if necessary...
  2725. * unsubscribe();
  2726. * ```
  2727. */
  2728. var build_module_subscribe = default_registry.subscribe;
  2729. /**
  2730. * Registers a generic store.
  2731. *
  2732. * @param {string} key Store registry key.
  2733. * @param {Object} config Configuration (getSelectors, getActions, subscribe).
  2734. */
  2735. var build_module_registerGenericStore = default_registry.registerGenericStore;
  2736. /**
  2737. * Registers a standard `@wordpress/data` store.
  2738. *
  2739. * @param {string} reducerKey Reducer key.
  2740. * @param {Object} options Store description (reducer, actions, selectors, resolvers).
  2741. *
  2742. * @return {Object} Registered store object.
  2743. */
  2744. var build_module_registerStore = default_registry.registerStore;
  2745. /**
  2746. * Extends a registry to inherit functionality provided by a given plugin. A
  2747. * plugin is an object with properties aligning to that of a registry, merged
  2748. * to extend the default registry behavior.
  2749. *
  2750. * @param {Object} plugin Plugin object.
  2751. */
  2752. var build_module_use = default_registry.use;
  2753. /***/ }),
  2754. /***/ 37:
  2755. /***/ (function(module, exports) {
  2756. (function() { module.exports = this["wp"]["deprecated"]; }());
  2757. /***/ }),
  2758. /***/ 38:
  2759. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2760. "use strict";
  2761. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
  2762. function _arrayWithHoles(arr) {
  2763. if (Array.isArray(arr)) return arr;
  2764. }
  2765. /***/ }),
  2766. /***/ 39:
  2767. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2768. "use strict";
  2769. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
  2770. function _nonIterableRest() {
  2771. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  2772. }
  2773. /***/ }),
  2774. /***/ 41:
  2775. /***/ (function(module, exports) {
  2776. (function() { module.exports = this["wp"]["isShallowEqual"]; }());
  2777. /***/ }),
  2778. /***/ 43:
  2779. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2780. "use strict";
  2781. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _asyncToGenerator; });
  2782. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  2783. try {
  2784. var info = gen[key](arg);
  2785. var value = info.value;
  2786. } catch (error) {
  2787. reject(error);
  2788. return;
  2789. }
  2790. if (info.done) {
  2791. resolve(value);
  2792. } else {
  2793. Promise.resolve(value).then(_next, _throw);
  2794. }
  2795. }
  2796. function _asyncToGenerator(fn) {
  2797. return function () {
  2798. var self = this,
  2799. args = arguments;
  2800. return new Promise(function (resolve, reject) {
  2801. var gen = fn.apply(self, args);
  2802. function _next(value) {
  2803. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  2804. }
  2805. function _throw(err) {
  2806. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  2807. }
  2808. _next(undefined);
  2809. });
  2810. };
  2811. }
  2812. /***/ }),
  2813. /***/ 47:
  2814. /***/ (function(module, exports, __webpack_require__) {
  2815. /**
  2816. * Copyright (c) 2014-present, Facebook, Inc.
  2817. *
  2818. * This source code is licensed under the MIT license found in the
  2819. * LICENSE file in the root directory of this source tree.
  2820. */
  2821. var runtime = (function (exports) {
  2822. "use strict";
  2823. var Op = Object.prototype;
  2824. var hasOwn = Op.hasOwnProperty;
  2825. var undefined; // More compressible than void 0.
  2826. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  2827. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  2828. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  2829. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  2830. function wrap(innerFn, outerFn, self, tryLocsList) {
  2831. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  2832. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  2833. var generator = Object.create(protoGenerator.prototype);
  2834. var context = new Context(tryLocsList || []);
  2835. // The ._invoke method unifies the implementations of the .next,
  2836. // .throw, and .return methods.
  2837. generator._invoke = makeInvokeMethod(innerFn, self, context);
  2838. return generator;
  2839. }
  2840. exports.wrap = wrap;
  2841. // Try/catch helper to minimize deoptimizations. Returns a completion
  2842. // record like context.tryEntries[i].completion. This interface could
  2843. // have been (and was previously) designed to take a closure to be
  2844. // invoked without arguments, but in all the cases we care about we
  2845. // already have an existing method we want to call, so there's no need
  2846. // to create a new function object. We can even get away with assuming
  2847. // the method takes exactly one argument, since that happens to be true
  2848. // in every case, so we don't have to touch the arguments object. The
  2849. // only additional allocation required is the completion record, which
  2850. // has a stable shape and so hopefully should be cheap to allocate.
  2851. function tryCatch(fn, obj, arg) {
  2852. try {
  2853. return { type: "normal", arg: fn.call(obj, arg) };
  2854. } catch (err) {
  2855. return { type: "throw", arg: err };
  2856. }
  2857. }
  2858. var GenStateSuspendedStart = "suspendedStart";
  2859. var GenStateSuspendedYield = "suspendedYield";
  2860. var GenStateExecuting = "executing";
  2861. var GenStateCompleted = "completed";
  2862. // Returning this object from the innerFn has the same effect as
  2863. // breaking out of the dispatch switch statement.
  2864. var ContinueSentinel = {};
  2865. // Dummy constructor functions that we use as the .constructor and
  2866. // .constructor.prototype properties for functions that return Generator
  2867. // objects. For full spec compliance, you may wish to configure your
  2868. // minifier not to mangle the names of these two functions.
  2869. function Generator() {}
  2870. function GeneratorFunction() {}
  2871. function GeneratorFunctionPrototype() {}
  2872. // This is a polyfill for %IteratorPrototype% for environments that
  2873. // don't natively support it.
  2874. var IteratorPrototype = {};
  2875. IteratorPrototype[iteratorSymbol] = function () {
  2876. return this;
  2877. };
  2878. var getProto = Object.getPrototypeOf;
  2879. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  2880. if (NativeIteratorPrototype &&
  2881. NativeIteratorPrototype !== Op &&
  2882. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  2883. // This environment has a native %IteratorPrototype%; use it instead
  2884. // of the polyfill.
  2885. IteratorPrototype = NativeIteratorPrototype;
  2886. }
  2887. var Gp = GeneratorFunctionPrototype.prototype =
  2888. Generator.prototype = Object.create(IteratorPrototype);
  2889. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  2890. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  2891. GeneratorFunctionPrototype[toStringTagSymbol] =
  2892. GeneratorFunction.displayName = "GeneratorFunction";
  2893. // Helper for defining the .next, .throw, and .return methods of the
  2894. // Iterator interface in terms of a single ._invoke method.
  2895. function defineIteratorMethods(prototype) {
  2896. ["next", "throw", "return"].forEach(function(method) {
  2897. prototype[method] = function(arg) {
  2898. return this._invoke(method, arg);
  2899. };
  2900. });
  2901. }
  2902. exports.isGeneratorFunction = function(genFun) {
  2903. var ctor = typeof genFun === "function" && genFun.constructor;
  2904. return ctor
  2905. ? ctor === GeneratorFunction ||
  2906. // For the native GeneratorFunction constructor, the best we can
  2907. // do is to check its .name property.
  2908. (ctor.displayName || ctor.name) === "GeneratorFunction"
  2909. : false;
  2910. };
  2911. exports.mark = function(genFun) {
  2912. if (Object.setPrototypeOf) {
  2913. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  2914. } else {
  2915. genFun.__proto__ = GeneratorFunctionPrototype;
  2916. if (!(toStringTagSymbol in genFun)) {
  2917. genFun[toStringTagSymbol] = "GeneratorFunction";
  2918. }
  2919. }
  2920. genFun.prototype = Object.create(Gp);
  2921. return genFun;
  2922. };
  2923. // Within the body of any async function, `await x` is transformed to
  2924. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  2925. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  2926. // meant to be awaited.
  2927. exports.awrap = function(arg) {
  2928. return { __await: arg };
  2929. };
  2930. function AsyncIterator(generator) {
  2931. function invoke(method, arg, resolve, reject) {
  2932. var record = tryCatch(generator[method], generator, arg);
  2933. if (record.type === "throw") {
  2934. reject(record.arg);
  2935. } else {
  2936. var result = record.arg;
  2937. var value = result.value;
  2938. if (value &&
  2939. typeof value === "object" &&
  2940. hasOwn.call(value, "__await")) {
  2941. return Promise.resolve(value.__await).then(function(value) {
  2942. invoke("next", value, resolve, reject);
  2943. }, function(err) {
  2944. invoke("throw", err, resolve, reject);
  2945. });
  2946. }
  2947. return Promise.resolve(value).then(function(unwrapped) {
  2948. // When a yielded Promise is resolved, its final value becomes
  2949. // the .value of the Promise<{value,done}> result for the
  2950. // current iteration.
  2951. result.value = unwrapped;
  2952. resolve(result);
  2953. }, function(error) {
  2954. // If a rejected Promise was yielded, throw the rejection back
  2955. // into the async generator function so it can be handled there.
  2956. return invoke("throw", error, resolve, reject);
  2957. });
  2958. }
  2959. }
  2960. var previousPromise;
  2961. function enqueue(method, arg) {
  2962. function callInvokeWithMethodAndArg() {
  2963. return new Promise(function(resolve, reject) {
  2964. invoke(method, arg, resolve, reject);
  2965. });
  2966. }
  2967. return previousPromise =
  2968. // If enqueue has been called before, then we want to wait until
  2969. // all previous Promises have been resolved before calling invoke,
  2970. // so that results are always delivered in the correct order. If
  2971. // enqueue has not been called before, then it is important to
  2972. // call invoke immediately, without waiting on a callback to fire,
  2973. // so that the async generator function has the opportunity to do
  2974. // any necessary setup in a predictable way. This predictability
  2975. // is why the Promise constructor synchronously invokes its
  2976. // executor callback, and why async functions synchronously
  2977. // execute code before the first await. Since we implement simple
  2978. // async functions in terms of async generators, it is especially
  2979. // important to get this right, even though it requires care.
  2980. previousPromise ? previousPromise.then(
  2981. callInvokeWithMethodAndArg,
  2982. // Avoid propagating failures to Promises returned by later
  2983. // invocations of the iterator.
  2984. callInvokeWithMethodAndArg
  2985. ) : callInvokeWithMethodAndArg();
  2986. }
  2987. // Define the unified helper method that is used to implement .next,
  2988. // .throw, and .return (see defineIteratorMethods).
  2989. this._invoke = enqueue;
  2990. }
  2991. defineIteratorMethods(AsyncIterator.prototype);
  2992. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  2993. return this;
  2994. };
  2995. exports.AsyncIterator = AsyncIterator;
  2996. // Note that simple async functions are implemented on top of
  2997. // AsyncIterator objects; they just return a Promise for the value of
  2998. // the final result produced by the iterator.
  2999. exports.async = function(innerFn, outerFn, self, tryLocsList) {
  3000. var iter = new AsyncIterator(
  3001. wrap(innerFn, outerFn, self, tryLocsList)
  3002. );
  3003. return exports.isGeneratorFunction(outerFn)
  3004. ? iter // If outerFn is a generator, return the full iterator.
  3005. : iter.next().then(function(result) {
  3006. return result.done ? result.value : iter.next();
  3007. });
  3008. };
  3009. function makeInvokeMethod(innerFn, self, context) {
  3010. var state = GenStateSuspendedStart;
  3011. return function invoke(method, arg) {
  3012. if (state === GenStateExecuting) {
  3013. throw new Error("Generator is already running");
  3014. }
  3015. if (state === GenStateCompleted) {
  3016. if (method === "throw") {
  3017. throw arg;
  3018. }
  3019. // Be forgiving, per 25.3.3.3.3 of the spec:
  3020. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  3021. return doneResult();
  3022. }
  3023. context.method = method;
  3024. context.arg = arg;
  3025. while (true) {
  3026. var delegate = context.delegate;
  3027. if (delegate) {
  3028. var delegateResult = maybeInvokeDelegate(delegate, context);
  3029. if (delegateResult) {
  3030. if (delegateResult === ContinueSentinel) continue;
  3031. return delegateResult;
  3032. }
  3033. }
  3034. if (context.method === "next") {
  3035. // Setting context._sent for legacy support of Babel's
  3036. // function.sent implementation.
  3037. context.sent = context._sent = context.arg;
  3038. } else if (context.method === "throw") {
  3039. if (state === GenStateSuspendedStart) {
  3040. state = GenStateCompleted;
  3041. throw context.arg;
  3042. }
  3043. context.dispatchException(context.arg);
  3044. } else if (context.method === "return") {
  3045. context.abrupt("return", context.arg);
  3046. }
  3047. state = GenStateExecuting;
  3048. var record = tryCatch(innerFn, self, context);
  3049. if (record.type === "normal") {
  3050. // If an exception is thrown from innerFn, we leave state ===
  3051. // GenStateExecuting and loop back for another invocation.
  3052. state = context.done
  3053. ? GenStateCompleted
  3054. : GenStateSuspendedYield;
  3055. if (record.arg === ContinueSentinel) {
  3056. continue;
  3057. }
  3058. return {
  3059. value: record.arg,
  3060. done: context.done
  3061. };
  3062. } else if (record.type === "throw") {
  3063. state = GenStateCompleted;
  3064. // Dispatch the exception by looping back around to the
  3065. // context.dispatchException(context.arg) call above.
  3066. context.method = "throw";
  3067. context.arg = record.arg;
  3068. }
  3069. }
  3070. };
  3071. }
  3072. // Call delegate.iterator[context.method](context.arg) and handle the
  3073. // result, either by returning a { value, done } result from the
  3074. // delegate iterator, or by modifying context.method and context.arg,
  3075. // setting context.delegate to null, and returning the ContinueSentinel.
  3076. function maybeInvokeDelegate(delegate, context) {
  3077. var method = delegate.iterator[context.method];
  3078. if (method === undefined) {
  3079. // A .throw or .return when the delegate iterator has no .throw
  3080. // method always terminates the yield* loop.
  3081. context.delegate = null;
  3082. if (context.method === "throw") {
  3083. // Note: ["return"] must be used for ES3 parsing compatibility.
  3084. if (delegate.iterator["return"]) {
  3085. // If the delegate iterator has a return method, give it a
  3086. // chance to clean up.
  3087. context.method = "return";
  3088. context.arg = undefined;
  3089. maybeInvokeDelegate(delegate, context);
  3090. if (context.method === "throw") {
  3091. // If maybeInvokeDelegate(context) changed context.method from
  3092. // "return" to "throw", let that override the TypeError below.
  3093. return ContinueSentinel;
  3094. }
  3095. }
  3096. context.method = "throw";
  3097. context.arg = new TypeError(
  3098. "The iterator does not provide a 'throw' method");
  3099. }
  3100. return ContinueSentinel;
  3101. }
  3102. var record = tryCatch(method, delegate.iterator, context.arg);
  3103. if (record.type === "throw") {
  3104. context.method = "throw";
  3105. context.arg = record.arg;
  3106. context.delegate = null;
  3107. return ContinueSentinel;
  3108. }
  3109. var info = record.arg;
  3110. if (! info) {
  3111. context.method = "throw";
  3112. context.arg = new TypeError("iterator result is not an object");
  3113. context.delegate = null;
  3114. return ContinueSentinel;
  3115. }
  3116. if (info.done) {
  3117. // Assign the result of the finished delegate to the temporary
  3118. // variable specified by delegate.resultName (see delegateYield).
  3119. context[delegate.resultName] = info.value;
  3120. // Resume execution at the desired location (see delegateYield).
  3121. context.next = delegate.nextLoc;
  3122. // If context.method was "throw" but the delegate handled the
  3123. // exception, let the outer generator proceed normally. If
  3124. // context.method was "next", forget context.arg since it has been
  3125. // "consumed" by the delegate iterator. If context.method was
  3126. // "return", allow the original .return call to continue in the
  3127. // outer generator.
  3128. if (context.method !== "return") {
  3129. context.method = "next";
  3130. context.arg = undefined;
  3131. }
  3132. } else {
  3133. // Re-yield the result returned by the delegate method.
  3134. return info;
  3135. }
  3136. // The delegate iterator is finished, so forget it and continue with
  3137. // the outer generator.
  3138. context.delegate = null;
  3139. return ContinueSentinel;
  3140. }
  3141. // Define Generator.prototype.{next,throw,return} in terms of the
  3142. // unified ._invoke helper method.
  3143. defineIteratorMethods(Gp);
  3144. Gp[toStringTagSymbol] = "Generator";
  3145. // A Generator should always return itself as the iterator object when the
  3146. // @@iterator function is called on it. Some browsers' implementations of the
  3147. // iterator prototype chain incorrectly implement this, causing the Generator
  3148. // object to not be returned from this call. This ensures that doesn't happen.
  3149. // See https://github.com/facebook/regenerator/issues/274 for more details.
  3150. Gp[iteratorSymbol] = function() {
  3151. return this;
  3152. };
  3153. Gp.toString = function() {
  3154. return "[object Generator]";
  3155. };
  3156. function pushTryEntry(locs) {
  3157. var entry = { tryLoc: locs[0] };
  3158. if (1 in locs) {
  3159. entry.catchLoc = locs[1];
  3160. }
  3161. if (2 in locs) {
  3162. entry.finallyLoc = locs[2];
  3163. entry.afterLoc = locs[3];
  3164. }
  3165. this.tryEntries.push(entry);
  3166. }
  3167. function resetTryEntry(entry) {
  3168. var record = entry.completion || {};
  3169. record.type = "normal";
  3170. delete record.arg;
  3171. entry.completion = record;
  3172. }
  3173. function Context(tryLocsList) {
  3174. // The root entry object (effectively a try statement without a catch
  3175. // or a finally block) gives us a place to store values thrown from
  3176. // locations where there is no enclosing try statement.
  3177. this.tryEntries = [{ tryLoc: "root" }];
  3178. tryLocsList.forEach(pushTryEntry, this);
  3179. this.reset(true);
  3180. }
  3181. exports.keys = function(object) {
  3182. var keys = [];
  3183. for (var key in object) {
  3184. keys.push(key);
  3185. }
  3186. keys.reverse();
  3187. // Rather than returning an object with a next method, we keep
  3188. // things simple and return the next function itself.
  3189. return function next() {
  3190. while (keys.length) {
  3191. var key = keys.pop();
  3192. if (key in object) {
  3193. next.value = key;
  3194. next.done = false;
  3195. return next;
  3196. }
  3197. }
  3198. // To avoid creating an additional object, we just hang the .value
  3199. // and .done properties off the next function object itself. This
  3200. // also ensures that the minifier will not anonymize the function.
  3201. next.done = true;
  3202. return next;
  3203. };
  3204. };
  3205. function values(iterable) {
  3206. if (iterable) {
  3207. var iteratorMethod = iterable[iteratorSymbol];
  3208. if (iteratorMethod) {
  3209. return iteratorMethod.call(iterable);
  3210. }
  3211. if (typeof iterable.next === "function") {
  3212. return iterable;
  3213. }
  3214. if (!isNaN(iterable.length)) {
  3215. var i = -1, next = function next() {
  3216. while (++i < iterable.length) {
  3217. if (hasOwn.call(iterable, i)) {
  3218. next.value = iterable[i];
  3219. next.done = false;
  3220. return next;
  3221. }
  3222. }
  3223. next.value = undefined;
  3224. next.done = true;
  3225. return next;
  3226. };
  3227. return next.next = next;
  3228. }
  3229. }
  3230. // Return an iterator with no values.
  3231. return { next: doneResult };
  3232. }
  3233. exports.values = values;
  3234. function doneResult() {
  3235. return { value: undefined, done: true };
  3236. }
  3237. Context.prototype = {
  3238. constructor: Context,
  3239. reset: function(skipTempReset) {
  3240. this.prev = 0;
  3241. this.next = 0;
  3242. // Resetting context._sent for legacy support of Babel's
  3243. // function.sent implementation.
  3244. this.sent = this._sent = undefined;
  3245. this.done = false;
  3246. this.delegate = null;
  3247. this.method = "next";
  3248. this.arg = undefined;
  3249. this.tryEntries.forEach(resetTryEntry);
  3250. if (!skipTempReset) {
  3251. for (var name in this) {
  3252. // Not sure about the optimal order of these conditions:
  3253. if (name.charAt(0) === "t" &&
  3254. hasOwn.call(this, name) &&
  3255. !isNaN(+name.slice(1))) {
  3256. this[name] = undefined;
  3257. }
  3258. }
  3259. }
  3260. },
  3261. stop: function() {
  3262. this.done = true;
  3263. var rootEntry = this.tryEntries[0];
  3264. var rootRecord = rootEntry.completion;
  3265. if (rootRecord.type === "throw") {
  3266. throw rootRecord.arg;
  3267. }
  3268. return this.rval;
  3269. },
  3270. dispatchException: function(exception) {
  3271. if (this.done) {
  3272. throw exception;
  3273. }
  3274. var context = this;
  3275. function handle(loc, caught) {
  3276. record.type = "throw";
  3277. record.arg = exception;
  3278. context.next = loc;
  3279. if (caught) {
  3280. // If the dispatched exception was caught by a catch block,
  3281. // then let that catch block handle the exception normally.
  3282. context.method = "next";
  3283. context.arg = undefined;
  3284. }
  3285. return !! caught;
  3286. }
  3287. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  3288. var entry = this.tryEntries[i];
  3289. var record = entry.completion;
  3290. if (entry.tryLoc === "root") {
  3291. // Exception thrown outside of any try block that could handle
  3292. // it, so set the completion value of the entire function to
  3293. // throw the exception.
  3294. return handle("end");
  3295. }
  3296. if (entry.tryLoc <= this.prev) {
  3297. var hasCatch = hasOwn.call(entry, "catchLoc");
  3298. var hasFinally = hasOwn.call(entry, "finallyLoc");
  3299. if (hasCatch && hasFinally) {
  3300. if (this.prev < entry.catchLoc) {
  3301. return handle(entry.catchLoc, true);
  3302. } else if (this.prev < entry.finallyLoc) {
  3303. return handle(entry.finallyLoc);
  3304. }
  3305. } else if (hasCatch) {
  3306. if (this.prev < entry.catchLoc) {
  3307. return handle(entry.catchLoc, true);
  3308. }
  3309. } else if (hasFinally) {
  3310. if (this.prev < entry.finallyLoc) {
  3311. return handle(entry.finallyLoc);
  3312. }
  3313. } else {
  3314. throw new Error("try statement without catch or finally");
  3315. }
  3316. }
  3317. }
  3318. },
  3319. abrupt: function(type, arg) {
  3320. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  3321. var entry = this.tryEntries[i];
  3322. if (entry.tryLoc <= this.prev &&
  3323. hasOwn.call(entry, "finallyLoc") &&
  3324. this.prev < entry.finallyLoc) {
  3325. var finallyEntry = entry;
  3326. break;
  3327. }
  3328. }
  3329. if (finallyEntry &&
  3330. (type === "break" ||
  3331. type === "continue") &&
  3332. finallyEntry.tryLoc <= arg &&
  3333. arg <= finallyEntry.finallyLoc) {
  3334. // Ignore the finally entry if control is not jumping to a
  3335. // location outside the try/catch block.
  3336. finallyEntry = null;
  3337. }
  3338. var record = finallyEntry ? finallyEntry.completion : {};
  3339. record.type = type;
  3340. record.arg = arg;
  3341. if (finallyEntry) {
  3342. this.method = "next";
  3343. this.next = finallyEntry.finallyLoc;
  3344. return ContinueSentinel;
  3345. }
  3346. return this.complete(record);
  3347. },
  3348. complete: function(record, afterLoc) {
  3349. if (record.type === "throw") {
  3350. throw record.arg;
  3351. }
  3352. if (record.type === "break" ||
  3353. record.type === "continue") {
  3354. this.next = record.arg;
  3355. } else if (record.type === "return") {
  3356. this.rval = this.arg = record.arg;
  3357. this.method = "return";
  3358. this.next = "end";
  3359. } else if (record.type === "normal" && afterLoc) {
  3360. this.next = afterLoc;
  3361. }
  3362. return ContinueSentinel;
  3363. },
  3364. finish: function(finallyLoc) {
  3365. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  3366. var entry = this.tryEntries[i];
  3367. if (entry.finallyLoc === finallyLoc) {
  3368. this.complete(entry.completion, entry.afterLoc);
  3369. resetTryEntry(entry);
  3370. return ContinueSentinel;
  3371. }
  3372. }
  3373. },
  3374. "catch": function(tryLoc) {
  3375. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  3376. var entry = this.tryEntries[i];
  3377. if (entry.tryLoc === tryLoc) {
  3378. var record = entry.completion;
  3379. if (record.type === "throw") {
  3380. var thrown = record.arg;
  3381. resetTryEntry(entry);
  3382. }
  3383. return thrown;
  3384. }
  3385. }
  3386. // The context.catch method must only be called with a location
  3387. // argument that corresponds to a known catch block.
  3388. throw new Error("illegal catch attempt");
  3389. },
  3390. delegateYield: function(iterable, resultName, nextLoc) {
  3391. this.delegate = {
  3392. iterator: values(iterable),
  3393. resultName: resultName,
  3394. nextLoc: nextLoc
  3395. };
  3396. if (this.method === "next") {
  3397. // Deliberately forget the last sent value so that we don't
  3398. // accidentally pass it on to the delegate.
  3399. this.arg = undefined;
  3400. }
  3401. return ContinueSentinel;
  3402. }
  3403. };
  3404. // Regardless of whether this script is executing as a CommonJS module
  3405. // or not, return the runtime object so that we can declare the variable
  3406. // regeneratorRuntime in the outer scope, which allows this module to be
  3407. // injected easily by `bin/regenerator --include-runtime script.js`.
  3408. return exports;
  3409. }(
  3410. // If this script is executing as a CommonJS module, use module.exports
  3411. // as the regeneratorRuntime namespace. Otherwise create a new empty
  3412. // object. Either way, the resulting object will be used to initialize
  3413. // the regeneratorRuntime variable at the top of this file.
  3414. true ? module.exports : undefined
  3415. ));
  3416. try {
  3417. regeneratorRuntime = runtime;
  3418. } catch (accidentalStrictMode) {
  3419. // This module should not be running in strict mode, so the above
  3420. // assignment should always work unless something is misconfigured. Just
  3421. // in case runtime.js accidentally runs in strict mode, we can escape
  3422. // strict mode using a global Function call. This could conceivably fail
  3423. // if a Content Security Policy forbids using Function, but in that case
  3424. // the proper solution is to fix the accidental strict mode problem. If
  3425. // you've misconfigured your bundler to force strict mode and applied a
  3426. // CSP to forbid Function, and you're not willing to fix either of those
  3427. // problems, please detail your unique predicament in a GitHub issue.
  3428. Function("r", "regeneratorRuntime = r")(runtime);
  3429. }
  3430. /***/ }),
  3431. /***/ 65:
  3432. /***/ (function(module, exports) {
  3433. var g;
  3434. // This works in non-strict mode
  3435. g = (function() {
  3436. return this;
  3437. })();
  3438. try {
  3439. // This works if eval is allowed (see CSP)
  3440. g = g || new Function("return this")();
  3441. } catch (e) {
  3442. // This works if the window reference is available
  3443. if (typeof window === "object") g = window;
  3444. }
  3445. // g can still be undefined, but nothing to do about it...
  3446. // We return undefined, instead of nothing here, so it's
  3447. // easier to handle this case. if(!global) { ...}
  3448. module.exports = g;
  3449. /***/ }),
  3450. /***/ 7:
  3451. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3452. "use strict";
  3453. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectSpread; });
  3454. /* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10);
  3455. function _objectSpread(target) {
  3456. for (var i = 1; i < arguments.length; i++) {
  3457. var source = arguments[i] != null ? arguments[i] : {};
  3458. var ownKeys = Object.keys(source);
  3459. if (typeof Object.getOwnPropertySymbols === 'function') {
  3460. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
  3461. return Object.getOwnPropertyDescriptor(source, sym).enumerable;
  3462. }));
  3463. }
  3464. ownKeys.forEach(function (key) {
  3465. Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]);
  3466. });
  3467. }
  3468. return target;
  3469. }
  3470. /***/ }),
  3471. /***/ 74:
  3472. /***/ (function(module, exports, __webpack_require__) {
  3473. "use strict";
  3474. function _typeof(obj) {
  3475. if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
  3476. _typeof = function (obj) {
  3477. return typeof obj;
  3478. };
  3479. } else {
  3480. _typeof = function (obj) {
  3481. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  3482. };
  3483. }
  3484. return _typeof(obj);
  3485. }
  3486. function _classCallCheck(instance, Constructor) {
  3487. if (!(instance instanceof Constructor)) {
  3488. throw new TypeError("Cannot call a class as a function");
  3489. }
  3490. }
  3491. function _defineProperties(target, props) {
  3492. for (var i = 0; i < props.length; i++) {
  3493. var descriptor = props[i];
  3494. descriptor.enumerable = descriptor.enumerable || false;
  3495. descriptor.configurable = true;
  3496. if ("value" in descriptor) descriptor.writable = true;
  3497. Object.defineProperty(target, descriptor.key, descriptor);
  3498. }
  3499. }
  3500. function _createClass(Constructor, protoProps, staticProps) {
  3501. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  3502. if (staticProps) _defineProperties(Constructor, staticProps);
  3503. return Constructor;
  3504. }
  3505. /**
  3506. * Given an instance of EquivalentKeyMap, returns its internal value pair tuple
  3507. * for a key, if one exists. The tuple members consist of the last reference
  3508. * value for the key (used in efficient subsequent lookups) and the value
  3509. * assigned for the key at the leaf node.
  3510. *
  3511. * @param {EquivalentKeyMap} instance EquivalentKeyMap instance.
  3512. * @param {*} key The key for which to return value pair.
  3513. *
  3514. * @return {?Array} Value pair, if exists.
  3515. */
  3516. function getValuePair(instance, key) {
  3517. var _map = instance._map,
  3518. _arrayTreeMap = instance._arrayTreeMap,
  3519. _objectTreeMap = instance._objectTreeMap; // Map keeps a reference to the last object-like key used to set the
  3520. // value, which can be used to shortcut immediately to the value.
  3521. if (_map.has(key)) {
  3522. return _map.get(key);
  3523. } // Sort keys to ensure stable retrieval from tree.
  3524. var properties = Object.keys(key).sort(); // Tree by type to avoid conflicts on numeric object keys, empty value.
  3525. var map = Array.isArray(key) ? _arrayTreeMap : _objectTreeMap;
  3526. for (var i = 0; i < properties.length; i++) {
  3527. var property = properties[i];
  3528. map = map.get(property);
  3529. if (map === undefined) {
  3530. return;
  3531. }
  3532. var propertyValue = key[property];
  3533. map = map.get(propertyValue);
  3534. if (map === undefined) {
  3535. return;
  3536. }
  3537. }
  3538. var valuePair = map.get('_ekm_value');
  3539. if (!valuePair) {
  3540. return;
  3541. } // If reached, it implies that an object-like key was set with another
  3542. // reference, so delete the reference and replace with the current.
  3543. _map.delete(valuePair[0]);
  3544. valuePair[0] = key;
  3545. map.set('_ekm_value', valuePair);
  3546. _map.set(key, valuePair);
  3547. return valuePair;
  3548. }
  3549. /**
  3550. * Variant of a Map object which enables lookup by equivalent (deeply equal)
  3551. * object and array keys.
  3552. */
  3553. var EquivalentKeyMap =
  3554. /*#__PURE__*/
  3555. function () {
  3556. /**
  3557. * Constructs a new instance of EquivalentKeyMap.
  3558. *
  3559. * @param {Iterable.<*>} iterable Initial pair of key, value for map.
  3560. */
  3561. function EquivalentKeyMap(iterable) {
  3562. _classCallCheck(this, EquivalentKeyMap);
  3563. this.clear();
  3564. if (iterable instanceof EquivalentKeyMap) {
  3565. // Map#forEach is only means of iterating with support for IE11.
  3566. var iterablePairs = [];
  3567. iterable.forEach(function (value, key) {
  3568. iterablePairs.push([key, value]);
  3569. });
  3570. iterable = iterablePairs;
  3571. }
  3572. if (iterable != null) {
  3573. for (var i = 0; i < iterable.length; i++) {
  3574. this.set(iterable[i][0], iterable[i][1]);
  3575. }
  3576. }
  3577. }
  3578. /**
  3579. * Accessor property returning the number of elements.
  3580. *
  3581. * @return {number} Number of elements.
  3582. */
  3583. _createClass(EquivalentKeyMap, [{
  3584. key: "set",
  3585. /**
  3586. * Add or update an element with a specified key and value.
  3587. *
  3588. * @param {*} key The key of the element to add.
  3589. * @param {*} value The value of the element to add.
  3590. *
  3591. * @return {EquivalentKeyMap} Map instance.
  3592. */
  3593. value: function set(key, value) {
  3594. // Shortcut non-object-like to set on internal Map.
  3595. if (key === null || _typeof(key) !== 'object') {
  3596. this._map.set(key, value);
  3597. return this;
  3598. } // Sort keys to ensure stable assignment into tree.
  3599. var properties = Object.keys(key).sort();
  3600. var valuePair = [key, value]; // Tree by type to avoid conflicts on numeric object keys, empty value.
  3601. var map = Array.isArray(key) ? this._arrayTreeMap : this._objectTreeMap;
  3602. for (var i = 0; i < properties.length; i++) {
  3603. var property = properties[i];
  3604. if (!map.has(property)) {
  3605. map.set(property, new EquivalentKeyMap());
  3606. }
  3607. map = map.get(property);
  3608. var propertyValue = key[property];
  3609. if (!map.has(propertyValue)) {
  3610. map.set(propertyValue, new EquivalentKeyMap());
  3611. }
  3612. map = map.get(propertyValue);
  3613. } // If an _ekm_value exists, there was already an equivalent key. Before
  3614. // overriding, ensure that the old key reference is removed from map to
  3615. // avoid memory leak of accumulating equivalent keys. This is, in a
  3616. // sense, a poor man's WeakMap, while still enabling iterability.
  3617. var previousValuePair = map.get('_ekm_value');
  3618. if (previousValuePair) {
  3619. this._map.delete(previousValuePair[0]);
  3620. }
  3621. map.set('_ekm_value', valuePair);
  3622. this._map.set(key, valuePair);
  3623. return this;
  3624. }
  3625. /**
  3626. * Returns a specified element.
  3627. *
  3628. * @param {*} key The key of the element to return.
  3629. *
  3630. * @return {?*} The element associated with the specified key or undefined
  3631. * if the key can't be found.
  3632. */
  3633. }, {
  3634. key: "get",
  3635. value: function get(key) {
  3636. // Shortcut non-object-like to get from internal Map.
  3637. if (key === null || _typeof(key) !== 'object') {
  3638. return this._map.get(key);
  3639. }
  3640. var valuePair = getValuePair(this, key);
  3641. if (valuePair) {
  3642. return valuePair[1];
  3643. }
  3644. }
  3645. /**
  3646. * Returns a boolean indicating whether an element with the specified key
  3647. * exists or not.
  3648. *
  3649. * @param {*} key The key of the element to test for presence.
  3650. *
  3651. * @return {boolean} Whether an element with the specified key exists.
  3652. */
  3653. }, {
  3654. key: "has",
  3655. value: function has(key) {
  3656. if (key === null || _typeof(key) !== 'object') {
  3657. return this._map.has(key);
  3658. } // Test on the _presence_ of the pair, not its value, as even undefined
  3659. // can be a valid member value for a key.
  3660. return getValuePair(this, key) !== undefined;
  3661. }
  3662. /**
  3663. * Removes the specified element.
  3664. *
  3665. * @param {*} key The key of the element to remove.
  3666. *
  3667. * @return {boolean} Returns true if an element existed and has been
  3668. * removed, or false if the element does not exist.
  3669. */
  3670. }, {
  3671. key: "delete",
  3672. value: function _delete(key) {
  3673. if (!this.has(key)) {
  3674. return false;
  3675. } // This naive implementation will leave orphaned child trees. A better
  3676. // implementation should traverse and remove orphans.
  3677. this.set(key, undefined);
  3678. return true;
  3679. }
  3680. /**
  3681. * Executes a provided function once per each key/value pair, in insertion
  3682. * order.
  3683. *
  3684. * @param {Function} callback Function to execute for each element.
  3685. * @param {*} thisArg Value to use as `this` when executing
  3686. * `callback`.
  3687. */
  3688. }, {
  3689. key: "forEach",
  3690. value: function forEach(callback) {
  3691. var _this = this;
  3692. var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this;
  3693. this._map.forEach(function (value, key) {
  3694. // Unwrap value from object-like value pair.
  3695. if (key !== null && _typeof(key) === 'object') {
  3696. value = value[1];
  3697. }
  3698. callback.call(thisArg, value, key, _this);
  3699. });
  3700. }
  3701. /**
  3702. * Removes all elements.
  3703. */
  3704. }, {
  3705. key: "clear",
  3706. value: function clear() {
  3707. this._map = new Map();
  3708. this._arrayTreeMap = new Map();
  3709. this._objectTreeMap = new Map();
  3710. }
  3711. }, {
  3712. key: "size",
  3713. get: function get() {
  3714. return this._map.size;
  3715. }
  3716. }]);
  3717. return EquivalentKeyMap;
  3718. }();
  3719. module.exports = EquivalentKeyMap;
  3720. /***/ }),
  3721. /***/ 8:
  3722. /***/ (function(module, exports) {
  3723. (function() { module.exports = this["wp"]["compose"]; }());
  3724. /***/ }),
  3725. /***/ 98:
  3726. /***/ (function(module, exports) {
  3727. module.exports = isPromise;
  3728. function isPromise(obj) {
  3729. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  3730. }
  3731. /***/ })
  3732. /******/ });