1 line
32 KiB
Plaintext
1 line
32 KiB
Plaintext
{"version":3,"sources":["webpack://wp.[name]/webpack/bootstrap","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/objectSpread.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/api-fetch/src/index.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/api-fetch/src/middlewares/fetch-all-middleware.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/api-fetch/src/middlewares/http-v1.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/api-fetch/src/middlewares/namespace-endpoint.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/api-fetch/src/middlewares/nonce.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/api-fetch/src/middlewares/preloading.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/api-fetch/src/middlewares/root-url.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/api-fetch/src/middlewares/user-locale.js","webpack://wp.[name]/external {\"this\":[\"wp\",\"hooks\"]}","webpack://wp.[name]/external {\"this\":[\"wp\",\"i18n\"]}","webpack://wp.[name]/external {\"this\":[\"wp\",\"url\"]}"],"names":["middlewares","registerMiddleware","middleware","push","checkCloudflareError","error","indexOf","code","apiFetch","options","raw","nextOptions","url","path","body","data","parse","remainingOptions","headers","responsePromise","window","fetch","credentials","JSON","stringify","checkStatus","response","status","parseResponse","json","Promise","reject","then","catch","invalidJsonError","message","__","responseClone","clone","text","unknownError","steps","fetchAllMiddleware","httpV1Middleware","namespaceEndpointMiddleware","userLocaleMiddleware","reverse","runMiddleware","index","nextMiddleware","next","use","createNonceMiddleware","createPreloadingMiddleware","createRootURLMiddleware","modifyQuery","queryArgs","addQueryArgs","parseLinkHeader","linkHeader","match","getNextPageUrl","get","requestContainsUnboundedQuery","pathIsUnbounded","urlIsUnbounded","per_page","results","Array","isArray","nextPage","mergedResults","concat","undefined","nextResponse","nextResults","newOptions","method","toUpperCase","namespaceAndEndpointMiddleware","namespaceTrimmed","endpointTrimmed","namespace","endpoint","replace","nonce","usedNonce","addAction","addNonceHeader","headerName","hasOwnProperty","toLowerCase","preloadedData","getStablePath","splitted","split","query","base","map","entry","sort","a","b","localeCompare","pair","join","resolve","rootURL","optionsWithPath","apiRoot","hasQueryArg","_locale"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;AClFA;AAAA;AAAA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA,C;;;;;;;;;;;;AClCA;AAAA;AAAe;AACf;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EAAY,CAAEhD,OAAO,CAACI,IAAV,EAAgB;AAAEkG,aAAO,EAAE;AAAX,KAAhB,CAA3B;AACA;;AAED,SAAO7D,IAAI,CAAEzC,OAAF,EAAWyC,IAAX,CAAX;AACA;;AAEcL,mFAAf;;;;;;;;;;;;ACjBA,aAAa,sCAAsC,EAAE,I;;;;;;;;;;;ACArD,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,oCAAoC,EAAE,I","file":"api-fetch.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./node_modules/@wordpress/api-fetch/build-module/index.js\");\n","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import defineProperty from \"./defineProperty\";\nexport default function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport createNonceMiddleware from './middlewares/nonce';\nimport createRootURLMiddleware from './middlewares/root-url';\nimport createPreloadingMiddleware from './middlewares/preloading';\nimport fetchAllMiddleware from './middlewares/fetch-all-middleware';\nimport namespaceEndpointMiddleware from './middlewares/namespace-endpoint';\nimport httpV1Middleware from './middlewares/http-v1';\nimport userLocaleMiddleware from './middlewares/user-locale';\n\nconst middlewares = [];\n\nfunction registerMiddleware( middleware ) {\n\tmiddlewares.push( middleware );\n}\n\nfunction checkCloudflareError( error ) {\n\tif ( typeof error === 'string' && error.indexOf( 'Cloudflare Ray ID' ) >= 0 ) {\n\t\tthrow {\n\t\t\tcode: 'cloudflare_error',\n\t\t};\n\t}\n}\n\nfunction apiFetch( options ) {\n\tconst raw = ( nextOptions ) => {\n\t\tconst { url, path, body, data, parse = true, ...remainingOptions } = nextOptions;\n\t\tconst headers = remainingOptions.headers || {};\n\t\tif ( ! headers[ 'Content-Type' ] && data ) {\n\t\t\theaders[ 'Content-Type' ] = 'application/json';\n\t\t}\n\n\t\tconst responsePromise = window.fetch(\n\t\t\turl || path,\n\t\t\t{\n\t\t\t\t...remainingOptions,\n\t\t\t\tcredentials: 'include',\n\t\t\t\tbody: body || JSON.stringify( data ),\n\t\t\t\theaders,\n\t\t\t}\n\t\t);\n\t\tconst checkStatus = ( response ) => {\n\t\t\tif ( response.status >= 200 && response.status < 300 ) {\n\t\t\t\treturn response;\n\t\t\t}\n\n\t\t\tthrow response;\n\t\t};\n\n\t\tconst parseResponse = ( response ) => {\n\t\t\tif ( parse ) {\n\t\t\t\tif ( response.status === 204 ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn response.json ? response.json() : Promise.reject( response );\n\t\t\t}\n\n\t\t\treturn response;\n\t\t};\n\n\t\treturn responsePromise\n\t\t\t.then( checkStatus )\n\t\t\t.then( parseResponse )\n\t\t\t.catch( ( response ) => {\n\t\t\t\tif ( ! parse ) {\n\t\t\t\t\tthrow response;\n\t\t\t\t}\n\n\t\t\t\tconst invalidJsonError = {\n\t\t\t\t\tcode: 'invalid_json',\n\t\t\t\t\tmessage: __( 'The response is not a valid JSON response.' ),\n\t\t\t\t};\n\n\t\t\t\tif ( ! response || ! response.json ) {\n\t\t\t\t\tthrow invalidJsonError;\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t * Response data is a stream, which will be consumed by the .json() call.\n\t\t\t\t * If we need to re-use this data to send to the Cloudflare error handler,\n\t\t\t\t * we need a clone of the original response, so the stream can be consumed\n\t\t\t\t * in the .text() call, instead.\n\t\t\t\t */\n\t\t\t\tconst responseClone = response.clone();\n\n\t\t\t\treturn response.json()\n\t\t\t\t\t.catch( async () => {\n\t\t\t\t\t\tconst text = await responseClone.text();\n\t\t\t\t\t\tcheckCloudflareError( text );\n\t\t\t\t\t\tthrow invalidJsonError;\n\t\t\t\t\t} )\n\t\t\t\t\t.then( ( error ) => {\n\t\t\t\t\t\tconst unknownError = {\n\t\t\t\t\t\t\tcode: 'unknown_error',\n\t\t\t\t\t\t\tmessage: __( 'An unknown error occurred.' ),\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tcheckCloudflareError( error );\n\n\t\t\t\t\t\tthrow error || unknownError;\n\t\t\t\t\t} );\n\t\t\t} );\n\t};\n\n\tconst steps = [\n\t\traw,\n\t\tfetchAllMiddleware,\n\t\thttpV1Middleware,\n\t\tnamespaceEndpointMiddleware,\n\t\tuserLocaleMiddleware,\n\t\t...middlewares,\n\t].reverse();\n\n\tconst runMiddleware = ( index ) => ( nextOptions ) => {\n\t\tconst nextMiddleware = steps[ index ];\n\t\tconst next = runMiddleware( index + 1 );\n\t\treturn nextMiddleware( nextOptions, next );\n\t};\n\n\treturn runMiddleware( 0 )( options );\n}\n\napiFetch.use = registerMiddleware;\n\napiFetch.createNonceMiddleware = createNonceMiddleware;\napiFetch.createPreloadingMiddleware = createPreloadingMiddleware;\napiFetch.createRootURLMiddleware = createRootURLMiddleware;\napiFetch.fetchAllMiddleware = fetchAllMiddleware;\n\nexport default apiFetch;\n","/**\n * WordPress dependencies\n */\nimport { addQueryArgs } from '@wordpress/url';\n\n// Apply query arguments to both URL and Path, whichever is present.\nconst modifyQuery = ( { path, url, ...options }, queryArgs ) => ( {\n\t...options,\n\turl: url && addQueryArgs( url, queryArgs ),\n\tpath: path && addQueryArgs( path, queryArgs ),\n} );\n\n// Duplicates parsing functionality from apiFetch.\nconst parseResponse = ( response ) => response.json ?\n\tresponse.json() :\n\tPromise.reject( response );\n\nconst parseLinkHeader = ( linkHeader ) => {\n\tif ( ! linkHeader ) {\n\t\treturn {};\n\t}\n\tconst match = linkHeader.match( /<([^>]+)>; rel=\"next\"/ );\n\treturn match ? {\n\t\tnext: match[ 1 ],\n\t} : {};\n};\n\nconst getNextPageUrl = ( response ) => {\n\tconst { next } = parseLinkHeader( response.headers.get( 'link' ) );\n\treturn next;\n};\n\nconst requestContainsUnboundedQuery = ( options ) => {\n\tconst pathIsUnbounded = options.path && options.path.indexOf( 'per_page=-1' ) !== -1;\n\tconst urlIsUnbounded = options.url && options.url.indexOf( 'per_page=-1' ) !== -1;\n\treturn pathIsUnbounded || urlIsUnbounded;\n};\n\n// The REST API enforces an upper limit on the per_page option. To handle large\n// collections, apiFetch consumers can pass `per_page=-1`; this middleware will\n// then recursively assemble a full response array from all available pages.\nconst fetchAllMiddleware = async ( options, next ) => {\n\tif ( options.parse === false ) {\n\t\t// If a consumer has opted out of parsing, do not apply middleware.\n\t\treturn next( options );\n\t}\n\tif ( ! requestContainsUnboundedQuery( options ) ) {\n\t\t// If neither url nor path is requesting all items, do not apply middleware.\n\t\treturn next( options );\n\t}\n\n\t// Retrieve requested page of results.\n\tconst response = await next( {\n\t\t...modifyQuery( options, {\n\t\t\tper_page: 100,\n\t\t} ),\n\t\t// Ensure headers are returned for page 1.\n\t\tparse: false,\n\t} );\n\n\tconst results = await parseResponse( response );\n\n\tif ( ! Array.isArray( results ) ) {\n\t\t// We have no reliable way of merging non-array results.\n\t\treturn results;\n\t}\n\n\tlet nextPage = getNextPageUrl( response );\n\n\tif ( ! nextPage ) {\n\t\t// There are no further pages to request.\n\t\treturn results;\n\t}\n\n\t// Iteratively fetch all remaining pages until no \"next\" header is found.\n\tlet mergedResults = [].concat( results );\n\twhile ( nextPage ) {\n\t\tconst nextResponse = await next( {\n\t\t\t...options,\n\t\t\t// Ensure the URL for the next page is used instead of any provided path.\n\t\t\tpath: undefined,\n\t\t\turl: nextPage,\n\t\t\t// Ensure we still get headers so we can identify the next page.\n\t\t\tparse: false,\n\t\t} );\n\t\tconst nextResults = await parseResponse( nextResponse );\n\t\tmergedResults = mergedResults.concat( nextResults );\n\t\tnextPage = getNextPageUrl( nextResponse );\n\t}\n\treturn mergedResults;\n};\n\nexport default fetchAllMiddleware;\n","function httpV1Middleware( options, next ) {\n\tconst newOptions = { ...options };\n\tif ( newOptions.method ) {\n\t\tif ( [ 'PATCH', 'PUT', 'DELETE' ].indexOf( newOptions.method.toUpperCase() ) >= 0 ) {\n\t\t\tif ( ! newOptions.headers ) {\n\t\t\t\tnewOptions.headers = {};\n\t\t\t}\n\t\t\tnewOptions.headers[ 'X-HTTP-Method-Override' ] = newOptions.method;\n\t\t\tnewOptions.headers[ 'Content-Type' ] = 'application/json';\n\t\t\tnewOptions.method = 'POST';\n\t\t}\n\t}\n\n\treturn next( newOptions, next );\n}\n\nexport default httpV1Middleware;\n","const namespaceAndEndpointMiddleware = ( options, next ) => {\n\tlet path = options.path;\n\tlet namespaceTrimmed, endpointTrimmed;\n\n\tif (\n\t\ttypeof options.namespace === 'string' &&\n\t\t\ttypeof options.endpoint === 'string'\n\t) {\n\t\tnamespaceTrimmed = options.namespace.replace( /^\\/|\\/$/g, '' );\n\t\tendpointTrimmed = options.endpoint.replace( /^\\//, '' );\n\t\tif ( endpointTrimmed ) {\n\t\t\tpath = namespaceTrimmed + '/' + endpointTrimmed;\n\t\t} else {\n\t\t\tpath = namespaceTrimmed;\n\t\t}\n\t}\n\n\tdelete options.namespace;\n\tdelete options.endpoint;\n\n\treturn next( {\n\t\t...options,\n\t\tpath,\n\t} );\n};\n\nexport default namespaceAndEndpointMiddleware;\n","/**\n * External dependencies\n */\nimport { addAction } from '@wordpress/hooks';\n\nconst createNonceMiddleware = ( nonce ) => ( options, next ) => {\n\tlet usedNonce = nonce;\n\t/**\n\t * This is not ideal but it's fine for now.\n\t *\n\t * Configure heartbeat to refresh the wp-api nonce, keeping the editor\n\t * authorization intact.\n\t */\n\taddAction( 'heartbeat.tick', 'core/api-fetch/create-nonce-middleware', ( response ) => {\n\t\tif ( response[ 'rest-nonce' ] ) {\n\t\t\tusedNonce = response[ 'rest-nonce' ];\n\t\t}\n\t} );\n\n\tlet headers = options.headers || {};\n\t// If an 'X-WP-Nonce' header (or any case-insensitive variation\n\t// thereof) was specified, no need to add a nonce header.\n\tlet addNonceHeader = true;\n\tfor ( const headerName in headers ) {\n\t\tif ( headers.hasOwnProperty( headerName ) ) {\n\t\t\tif ( headerName.toLowerCase() === 'x-wp-nonce' ) {\n\t\t\t\taddNonceHeader = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( addNonceHeader ) {\n\t// Do not mutate the original headers object, if any.\n\t\theaders = {\n\t\t\t...headers,\n\t\t\t'X-WP-Nonce': usedNonce,\n\t\t};\n\t}\n\n\treturn next( {\n\t\t...options,\n\t\theaders,\n\t} );\n};\n\nexport default createNonceMiddleware;\n","const createPreloadingMiddleware = ( preloadedData ) => ( options, next ) => {\n\tfunction getStablePath( path ) {\n\t\tconst splitted = path.split( '?' );\n\t\tconst query = splitted[ 1 ];\n\t\tconst base = splitted[ 0 ];\n\t\tif ( ! query ) {\n\t\t\treturn base;\n\t\t}\n\n\t\t// 'b=1&c=2&a=5'\n\t\treturn base + '?' + query\n\t\t\t// [ 'b=1', 'c=2', 'a=5' ]\n\t\t\t.split( '&' )\n\t\t\t// [ [ 'b, '1' ], [ 'c', '2' ], [ 'a', '5' ] ]\n\t\t\t.map( function( entry ) {\n\t\t\t\treturn entry.split( '=' );\n\t\t\t} )\n\t\t\t// [ [ 'a', '5' ], [ 'b, '1' ], [ 'c', '2' ] ]\n\t\t\t.sort( function( a, b ) {\n\t\t\t\treturn a[ 0 ].localeCompare( b[ 0 ] );\n\t\t\t} )\n\t\t\t// [ 'a=5', 'b=1', 'c=2' ]\n\t\t\t.map( function( pair ) {\n\t\t\t\treturn pair.join( '=' );\n\t\t\t} )\n\t\t\t// 'a=5&b=1&c=2'\n\t\t\t.join( '&' );\n\t}\n\n\tconst { parse = true } = options;\n\tif ( typeof options.path === 'string' && parse ) {\n\t\tconst method = options.method || 'GET';\n\t\tconst path = getStablePath( options.path );\n\n\t\tif ( 'GET' === method && preloadedData[ path ] ) {\n\t\t\treturn Promise.resolve( preloadedData[ path ].body );\n\t\t}\n\t}\n\n\treturn next( options );\n};\n\nexport default createPreloadingMiddleware;\n","/**\n * Internal dependencies\n */\nimport namespaceAndEndpointMiddleware from './namespace-endpoint';\n\nconst createRootURLMiddleware = ( rootURL ) => ( options, next ) => {\n\treturn namespaceAndEndpointMiddleware( options, ( optionsWithPath ) => {\n\t\tlet url = optionsWithPath.url;\n\t\tlet path = optionsWithPath.path;\n\t\tlet apiRoot;\n\n\t\tif ( typeof path === 'string' ) {\n\t\t\tapiRoot = rootURL;\n\n\t\t\tif ( -1 !== rootURL.indexOf( '?' ) ) {\n\t\t\t\tpath = path.replace( '?', '&' );\n\t\t\t}\n\n\t\t\tpath = path.replace( /^\\//, '' );\n\n\t\t\t// API root may already include query parameter prefix if site is\n\t\t\t// configured to use plain permalinks.\n\t\t\tif ( 'string' === typeof apiRoot && -1 !== apiRoot.indexOf( '?' ) ) {\n\t\t\t\tpath = path.replace( '?', '&' );\n\t\t\t}\n\n\t\t\turl = apiRoot + path;\n\t\t}\n\n\t\treturn next( {\n\t\t\t...optionsWithPath,\n\t\t\turl,\n\t\t} );\n\t} );\n};\n\nexport default createRootURLMiddleware;\n","/**\n * WordPress dependencies\n */\nimport { addQueryArgs, hasQueryArg } from '@wordpress/url';\n\nfunction userLocaleMiddleware( options, next ) {\n\tif ( typeof options.url === 'string' && ! hasQueryArg( options.url, '_locale' ) ) {\n\t\toptions.url = addQueryArgs( options.url, { _locale: 'user' } );\n\t}\n\n\tif ( typeof options.path === 'string' && ! hasQueryArg( options.path, '_locale' ) ) {\n\t\toptions.path = addQueryArgs( options.path, { _locale: 'user' } );\n\t}\n\n\treturn next( options, next );\n}\n\nexport default userLocaleMiddleware;\n","(function() { module.exports = this[\"wp\"][\"hooks\"]; }());","(function() { module.exports = this[\"wp\"][\"i18n\"]; }());","(function() { module.exports = this[\"wp\"][\"url\"]; }());"],"sourceRoot":""} |