WordPress/wp-includes/js/dist/api-fetch.min.js

2 lines
14 KiB
JavaScript
Raw Normal View History

/*! This file is auto-generated */
Block Editor: Update the WordPress Packages to the ones used in the Gutenberg 6.8 release. Updated packages: @wordpress/a11y@2.5.1 @wordpress/annotations@1.7.2 @wordpress/api-fetch@3.6.2 @wordpress/autop@2.5.1 @wordpress/babel-preset-default@4.6.2 @wordpress/blob@2.5.1 @wordpress/block-directory@1.0.2 @wordpress/block-editor@3.2.2 @wordpress/block-library@2.9.2 @wordpress/block-serialization-default-parser@3.4.1 @wordpress/block-serialization-spec-parser@3.3.1 @wordpress/blocks@6.7.2 @wordpress/components@8.3.2 @wordpress/compose@3.7.2 @wordpress/core-data@2.7.2 @wordpress/data-controls@1.3.2 @wordpress/data@4.9.2 @wordpress/deprecated@2.6.1 @wordpress/dom-ready@2.5.1 @wordpress/dom@2.5.2 @wordpress/e2e-test-utils@2.4.2 @wordpress/e2e-tests@1.7.2 @wordpress/edit-post@3.8.2 @wordpress/editor@9.7.2 @wordpress/element@2.8.2 @wordpress/escape-html@1.5.1 @wordpress/format-library@1.9.2 @wordpress/is-shallow-equal@1.6.1 @wordpress/keycodes@2.6.2 @wordpress/list-reusable-blocks@1.8.2 @wordpress/media-utils@1.2.2 @wordpress/notices@1.8.2 @wordpress/nux@3.7.2 @wordpress/plugins@2.7.2 @wordpress/priority-queue@1.3.1 @wordpress/redux-routine@3.6.2 @wordpress/rich-text@3.7.2 @wordpress/scripts@5.1.0 @wordpress/server-side-render@1.3.2 @wordpress/url@2.8.1 @wordpress/viewport@2.8.2 @wordpress/wordcount@2.6.2 Props gziolo, youknowriad. Fixes: #48310 Built from https://develop.svn.wordpress.org/trunk@46546 git-svn-id: http://core.svn.wordpress.org/trunk@46343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-15 18:17:12 +02:00
this.wp=this.wp||{},this.wp.apiFetch=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=353)}({1:function(t,e){!function(){t.exports=this.wp.i18n}()},10:function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.d(e,"a",(function(){return n}))},20:function(t,e,r){t.exports=r(47)},21:function(t,e,r){"use strict";function n(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},a=Object.keys(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}r.d(e,"a",(function(){return n}))},26:function(t,e){!function(){t.exports=this.wp.url}()},353:function(t,e,r){"use strict";r.r(e);var n=r(7),o=r(21);var a=function(t){function e(t,r){var o=t.headers,a=void 0===o?{}:o;for(var i in a)if("x-wp-nonce"===i.toLowerCase())return r(t);return r(Object(n.a)({},t,{headers:Object(n.a)({},a,{"X-WP-Nonce":e.nonce})}))}return e.nonce=t,e},i=function(t,e){var r,o,a=t.path;return"string"==typeof t.namespace&&"string"==typeof t.endpoint&&(r=t.namespace.replace(/^\/|\/$/g,""),a=(o=t.endpoint.replace(/^\//,""))?r+"/"+o:r),delete t.namespace,delete t.endpoint,e(Object(n.a)({},t,{path:a}))},c=function(t){return function(e,r){return i(e,(function(e){var o,a=e.url,i=e.path;return"string"==typeof i&&(o=t,-1!==t.indexOf("?")&&(i=i.replace("?","&")),i=i.replace(/^\//,""),"string"==typeof o&&-1!==o.indexOf("?")&&(i=i.replace("?","&")),a=o+i),r(Object(n.a)({},e,{url:a}))}))}},u=function(t){return function(e,r){var n=e.parse,o=void 0===n||n;if("string"==typeof e.path){var a=e.method||"GET",i=function(t){var e=t.split("?"),r=e[1],n=e[0];return r?n+"?"+r.split("&").map((function(t){return t.split("=")})).sort((function(t,e){return t[0].localeCompare(e[0])})).map((function(t){return t.join("=")})).join("&"):n}(e.path);if(o&&"GET"===a&&t[i])return Promise.resolve(t[i].body);if("OPTIONS"===a&&t[a]&&t[a][i])return Promise.resolve(t[a][i])}return r(e)}},s=r(20),f=r.n(s),l=r(43),h=r(26),p=function(t,e){var r=t.path,a=t.url,i=Object(o.a)(t,["path","url"]);return Object(n.a)({},i,{url:a&&Object(h.addQueryArgs)(a,e),path:r&&Object(h.addQueryArgs)(r,e)})},d=function(t){return t.json?t.json():Promise.reject(t)},v=function(t){return function(t){if(!t)return{};var e=t.match(/<([^>]+)>; rel="next"/);return e?{next:e[1]}:{}}(t.headers.get("link")).next},y=function(t){var e=t.path&&-1!==t.path.indexOf("per_page=-1"),r=t.url&&-1!==t.url.indexOf("per_page=-1");return e||r},g=function(){var t=Object(l.a)(f.a.mark((function t(e,r){var o,a,i,c,u,s;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!1!==e.parse){t.next=2;break}return t.abrupt("return",r(e));case 2:if(y(e)){t.next=4;break}return t.abrupt("return",r(e));case 4:return t.next=6,r(Object(n.a)({},p(e,{per_page:100}),{parse:!1}));case 6:return o=t.sent,t.next=9,d(o);case 9:if(a=t.sent,Array.isArray(a)){t.next=12;break}return t.abrupt("return",a);case 12:if(i=v(o)){t.next=15;break}return t.abrupt("return",a);case 15:c=[].concat(a);case 16:i