wp/wp-includes/js/dist/url.js
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
equal deleted inserted replaced
21:48c4eec2b7e6 22:8c2e4d02f4ef
   556 /******/ 		};
   556 /******/ 		};
   557 /******/ 	})();
   557 /******/ 	})();
   558 /******/ 	
   558 /******/ 	
   559 /************************************************************************/
   559 /************************************************************************/
   560 var __webpack_exports__ = {};
   560 var __webpack_exports__ = {};
   561 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
   561 // This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
   562 (() => {
   562 (() => {
   563 "use strict";
   563 "use strict";
   564 // ESM COMPAT FLAG
   564 // ESM COMPAT FLAG
   565 __webpack_require__.r(__webpack_exports__);
   565 __webpack_require__.r(__webpack_exports__);
   566 
   566 
   579   getQueryArg: () => (/* reexport */ getQueryArg),
   579   getQueryArg: () => (/* reexport */ getQueryArg),
   580   getQueryArgs: () => (/* reexport */ getQueryArgs),
   580   getQueryArgs: () => (/* reexport */ getQueryArgs),
   581   getQueryString: () => (/* reexport */ getQueryString),
   581   getQueryString: () => (/* reexport */ getQueryString),
   582   hasQueryArg: () => (/* reexport */ hasQueryArg),
   582   hasQueryArg: () => (/* reexport */ hasQueryArg),
   583   isEmail: () => (/* reexport */ isEmail),
   583   isEmail: () => (/* reexport */ isEmail),
       
   584   isPhoneNumber: () => (/* reexport */ isPhoneNumber),
   584   isURL: () => (/* reexport */ isURL),
   585   isURL: () => (/* reexport */ isURL),
   585   isValidAuthority: () => (/* reexport */ isValidAuthority),
   586   isValidAuthority: () => (/* reexport */ isValidAuthority),
   586   isValidFragment: () => (/* reexport */ isValidFragment),
   587   isValidFragment: () => (/* reexport */ isValidFragment),
   587   isValidPath: () => (/* reexport */ isValidPath),
   588   isValidPath: () => (/* reexport */ isValidPath),
   588   isValidProtocol: () => (/* reexport */ isValidProtocol),
   589   isValidProtocol: () => (/* reexport */ isValidProtocol),
   593   removeQueryArgs: () => (/* reexport */ removeQueryArgs),
   594   removeQueryArgs: () => (/* reexport */ removeQueryArgs),
   594   safeDecodeURI: () => (/* reexport */ safeDecodeURI),
   595   safeDecodeURI: () => (/* reexport */ safeDecodeURI),
   595   safeDecodeURIComponent: () => (/* reexport */ safeDecodeURIComponent)
   596   safeDecodeURIComponent: () => (/* reexport */ safeDecodeURIComponent)
   596 });
   597 });
   597 
   598 
   598 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-url.js
   599 ;// ./node_modules/@wordpress/url/build-module/is-url.js
       
   600 /* wp:polyfill */
   599 /**
   601 /**
   600  * Determines whether the given string looks like a URL.
   602  * Determines whether the given string looks like a URL.
   601  *
   603  *
   602  * @param {string} url The string to scrutinise.
   604  * @param {string} url The string to scrutinise.
   603  *
   605  *
   620   } catch {
   622   } catch {
   621     return false;
   623     return false;
   622   }
   624   }
   623 }
   625 }
   624 
   626 
   625 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-email.js
   627 ;// ./node_modules/@wordpress/url/build-module/is-email.js
   626 const EMAIL_REGEXP = /^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;
   628 const EMAIL_REGEXP = /^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;
   627 
   629 
   628 /**
   630 /**
   629  * Determines whether the given string looks like an email.
   631  * Determines whether the given string looks like an email.
   630  *
   632  *
   639  */
   641  */
   640 function isEmail(email) {
   642 function isEmail(email) {
   641   return EMAIL_REGEXP.test(email);
   643   return EMAIL_REGEXP.test(email);
   642 }
   644 }
   643 
   645 
   644 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-protocol.js
   646 ;// ./node_modules/@wordpress/url/build-module/is-phone-number.js
       
   647 const PHONE_REGEXP = /^(tel:)?(\+)?\d{6,15}$/;
       
   648 
       
   649 /**
       
   650  * Determines whether the given string looks like a phone number.
       
   651  *
       
   652  * @param {string} phoneNumber The string to scrutinize.
       
   653  *
       
   654  * @example
       
   655  * ```js
       
   656  * const isPhoneNumber = isPhoneNumber('+1 (555) 123-4567'); // true
       
   657  * ```
       
   658  *
       
   659  * @return {boolean} Whether or not it looks like a phone number.
       
   660  */
       
   661 function isPhoneNumber(phoneNumber) {
       
   662   // Remove any separator from phone number.
       
   663   phoneNumber = phoneNumber.replace(/[-.() ]/g, '');
       
   664   return PHONE_REGEXP.test(phoneNumber);
       
   665 }
       
   666 
       
   667 ;// ./node_modules/@wordpress/url/build-module/get-protocol.js
   645 /**
   668 /**
   646  * Returns the protocol part of the URL.
   669  * Returns the protocol part of the URL.
   647  *
   670  *
   648  * @param {string} url The full URL.
   671  * @param {string} url The full URL.
   649  *
   672  *
   660   if (matches) {
   683   if (matches) {
   661     return matches[1];
   684     return matches[1];
   662   }
   685   }
   663 }
   686 }
   664 
   687 
   665 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-protocol.js
   688 ;// ./node_modules/@wordpress/url/build-module/is-valid-protocol.js
   666 /**
   689 /**
   667  * Tests if a url protocol is valid.
   690  * Tests if a url protocol is valid.
   668  *
   691  *
   669  * @param {string} protocol The url protocol.
   692  * @param {string} protocol The url protocol.
   670  *
   693  *
   681     return false;
   704     return false;
   682   }
   705   }
   683   return /^[a-z\-.\+]+[0-9]*:$/i.test(protocol);
   706   return /^[a-z\-.\+]+[0-9]*:$/i.test(protocol);
   684 }
   707 }
   685 
   708 
   686 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-authority.js
   709 ;// ./node_modules/@wordpress/url/build-module/get-authority.js
   687 /**
   710 /**
   688  * Returns the authority part of the URL.
   711  * Returns the authority part of the URL.
   689  *
   712  *
   690  * @param {string} url The full URL.
   713  * @param {string} url The full URL.
   691  *
   714  *
   702   if (matches) {
   725   if (matches) {
   703     return matches[1];
   726     return matches[1];
   704   }
   727   }
   705 }
   728 }
   706 
   729 
   707 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-authority.js
   730 ;// ./node_modules/@wordpress/url/build-module/is-valid-authority.js
   708 /**
   731 /**
   709  * Checks for invalid characters within the provided authority.
   732  * Checks for invalid characters within the provided authority.
   710  *
   733  *
   711  * @param {string} authority A string containing the URL authority.
   734  * @param {string} authority A string containing the URL authority.
   712  *
   735  *
   723     return false;
   746     return false;
   724   }
   747   }
   725   return /^[^\s#?]+$/.test(authority);
   748   return /^[^\s#?]+$/.test(authority);
   726 }
   749 }
   727 
   750 
   728 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-path.js
   751 ;// ./node_modules/@wordpress/url/build-module/get-path.js
   729 /**
   752 /**
   730  * Returns the path part of the URL.
   753  * Returns the path part of the URL.
   731  *
   754  *
   732  * @param {string} url The full URL.
   755  * @param {string} url The full URL.
   733  *
   756  *
   744   if (matches) {
   767   if (matches) {
   745     return matches[1];
   768     return matches[1];
   746   }
   769   }
   747 }
   770 }
   748 
   771 
   749 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-path.js
   772 ;// ./node_modules/@wordpress/url/build-module/is-valid-path.js
   750 /**
   773 /**
   751  * Checks for invalid characters within the provided path.
   774  * Checks for invalid characters within the provided path.
   752  *
   775  *
   753  * @param {string} path The URL path.
   776  * @param {string} path The URL path.
   754  *
   777  *
   765     return false;
   788     return false;
   766   }
   789   }
   767   return /^[^\s#?]+$/.test(path);
   790   return /^[^\s#?]+$/.test(path);
   768 }
   791 }
   769 
   792 
   770 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-query-string.js
   793 ;// ./node_modules/@wordpress/url/build-module/get-query-string.js
       
   794 /* wp:polyfill */
   771 /**
   795 /**
   772  * Returns the query string part of the URL.
   796  * Returns the query string part of the URL.
   773  *
   797  *
   774  * @param {string} url The full URL.
   798  * @param {string} url The full URL.
   775  *
   799  *
   788   if (query) {
   812   if (query) {
   789     return query;
   813     return query;
   790   }
   814   }
   791 }
   815 }
   792 
   816 
   793 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/build-query-string.js
   817 ;// ./node_modules/@wordpress/url/build-module/build-query-string.js
   794 /**
   818 /**
   795  * Generates URL-encoded query string using input query data.
   819  * Generates URL-encoded query string using input query data.
   796  *
   820  *
   797  * It is intended to behave equivalent as PHP's `http_build_query`, configured
   821  * It is intended to behave equivalent as PHP's `http_build_query`, configured
   798  * with encoding type PHP_QUERY_RFC3986 (spaces as `%20`).
   822  * with encoding type PHP_QUERY_RFC3986 (spaces as `%20`).
   845   // but the first query parameter. This strips the leading `&`, while still
   869   // but the first query parameter. This strips the leading `&`, while still
   846   // accounting for the case that the string may in-fact be empty.
   870   // accounting for the case that the string may in-fact be empty.
   847   return string.substr(1);
   871   return string.substr(1);
   848 }
   872 }
   849 
   873 
   850 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-query-string.js
   874 ;// ./node_modules/@wordpress/url/build-module/is-valid-query-string.js
   851 /**
   875 /**
   852  * Checks for invalid characters within the provided query string.
   876  * Checks for invalid characters within the provided query string.
   853  *
   877  *
   854  * @param {string} queryString The query string.
   878  * @param {string} queryString The query string.
   855  *
   879  *
   866     return false;
   890     return false;
   867   }
   891   }
   868   return /^[^\s#?\/]+$/.test(queryString);
   892   return /^[^\s#?\/]+$/.test(queryString);
   869 }
   893 }
   870 
   894 
   871 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-path-and-query-string.js
   895 ;// ./node_modules/@wordpress/url/build-module/get-path-and-query-string.js
   872 /**
   896 /**
   873  * Internal dependencies
   897  * Internal dependencies
   874  */
   898  */
   875 
   899 
   876 
   900 
   898     value += `?${queryString}`;
   922     value += `?${queryString}`;
   899   }
   923   }
   900   return value;
   924   return value;
   901 }
   925 }
   902 
   926 
   903 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-fragment.js
   927 ;// ./node_modules/@wordpress/url/build-module/get-fragment.js
   904 /**
   928 /**
   905  * Returns the fragment part of the URL.
   929  * Returns the fragment part of the URL.
   906  *
   930  *
   907  * @param {string} url The full URL
   931  * @param {string} url The full URL
   908  *
   932  *
   919   if (matches) {
   943   if (matches) {
   920     return matches[1];
   944     return matches[1];
   921   }
   945   }
   922 }
   946 }
   923 
   947 
   924 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-fragment.js
   948 ;// ./node_modules/@wordpress/url/build-module/is-valid-fragment.js
   925 /**
   949 /**
   926  * Checks for invalid characters within the provided fragment.
   950  * Checks for invalid characters within the provided fragment.
   927  *
   951  *
   928  * @param {string} fragment The url fragment.
   952  * @param {string} fragment The url fragment.
   929  *
   953  *
   940     return false;
   964     return false;
   941   }
   965   }
   942   return /^#[^\s#?\/]*$/.test(fragment);
   966   return /^#[^\s#?\/]*$/.test(fragment);
   943 }
   967 }
   944 
   968 
   945 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/safe-decode-uri-component.js
   969 ;// ./node_modules/@wordpress/url/build-module/safe-decode-uri-component.js
   946 /**
   970 /**
   947  * Safely decodes a URI component with `decodeURIComponent`. Returns the URI component unmodified if
   971  * Safely decodes a URI component with `decodeURIComponent`. Returns the URI component unmodified if
   948  * `decodeURIComponent` throws an error.
   972  * `decodeURIComponent` throws an error.
   949  *
   973  *
   950  * @param {string} uriComponent URI component to decode.
   974  * @param {string} uriComponent URI component to decode.
   957   } catch (uriComponentError) {
   981   } catch (uriComponentError) {
   958     return uriComponent;
   982     return uriComponent;
   959   }
   983   }
   960 }
   984 }
   961 
   985 
   962 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-query-args.js
   986 ;// ./node_modules/@wordpress/url/build-module/get-query-args.js
   963 /**
   987 /**
   964  * Internal dependencies
   988  * Internal dependencies
   965  */
   989  */
   966 
   990 
   967 
   991 
  1045     }
  1069     }
  1046     return accumulator;
  1070     return accumulator;
  1047   }, Object.create(null));
  1071   }, Object.create(null));
  1048 }
  1072 }
  1049 
  1073 
  1050 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/add-query-args.js
  1074 ;// ./node_modules/@wordpress/url/build-module/add-query-args.js
  1051 /**
  1075 /**
  1052  * Internal dependencies
  1076  * Internal dependencies
  1053  */
  1077  */
       
  1078 
  1054 
  1079 
  1055 
  1080 
  1056 
  1081 
  1057 /**
  1082 /**
  1058  * Appends arguments as querystring to the provided URL. If the URL already
  1083  * Appends arguments as querystring to the provided URL. If the URL already
  1073 function addQueryArgs(url = '', args) {
  1098 function addQueryArgs(url = '', args) {
  1074   // If no arguments are to be appended, return original URL.
  1099   // If no arguments are to be appended, return original URL.
  1075   if (!args || !Object.keys(args).length) {
  1100   if (!args || !Object.keys(args).length) {
  1076     return url;
  1101     return url;
  1077   }
  1102   }
  1078   let baseUrl = url;
  1103   const fragment = getFragment(url) || '';
       
  1104   let baseUrl = url.replace(fragment, '');
  1079 
  1105 
  1080   // Determine whether URL already had query arguments.
  1106   // Determine whether URL already had query arguments.
  1081   const queryStringIndex = url.indexOf('?');
  1107   const queryStringIndex = url.indexOf('?');
  1082   if (queryStringIndex !== -1) {
  1108   if (queryStringIndex !== -1) {
  1083     // Merge into existing query arguments.
  1109     // Merge into existing query arguments.
  1084     args = Object.assign(getQueryArgs(url), args);
  1110     args = Object.assign(getQueryArgs(url), args);
  1085 
  1111 
  1086     // Change working base URL to omit previous query arguments.
  1112     // Change working base URL to omit previous query arguments.
  1087     baseUrl = baseUrl.substr(0, queryStringIndex);
  1113     baseUrl = baseUrl.substr(0, queryStringIndex);
  1088   }
  1114   }
  1089   return baseUrl + '?' + buildQueryString(args);
  1115   return baseUrl + '?' + buildQueryString(args) + fragment;
  1090 }
  1116 }
  1091 
  1117 
  1092 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-query-arg.js
  1118 ;// ./node_modules/@wordpress/url/build-module/get-query-arg.js
  1093 /**
  1119 /**
  1094  * Internal dependencies
  1120  * Internal dependencies
  1095  */
  1121  */
  1096 
  1122 
  1097 
  1123 
  1118  */
  1144  */
  1119 function getQueryArg(url, arg) {
  1145 function getQueryArg(url, arg) {
  1120   return getQueryArgs(url)[arg];
  1146   return getQueryArgs(url)[arg];
  1121 }
  1147 }
  1122 
  1148 
  1123 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/has-query-arg.js
  1149 ;// ./node_modules/@wordpress/url/build-module/has-query-arg.js
  1124 /**
  1150 /**
  1125  * Internal dependencies
  1151  * Internal dependencies
  1126  */
  1152  */
  1127 
  1153 
  1128 
  1154 
  1141  */
  1167  */
  1142 function hasQueryArg(url, arg) {
  1168 function hasQueryArg(url, arg) {
  1143   return getQueryArg(url, arg) !== undefined;
  1169   return getQueryArg(url, arg) !== undefined;
  1144 }
  1170 }
  1145 
  1171 
  1146 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/remove-query-args.js
  1172 ;// ./node_modules/@wordpress/url/build-module/remove-query-args.js
  1147 /**
  1173 /**
  1148  * Internal dependencies
  1174  * Internal dependencies
  1149  */
  1175  */
  1150 
  1176 
  1151 
  1177 
  1162  * ```
  1188  * ```
  1163  *
  1189  *
  1164  * @return {string} Updated URL.
  1190  * @return {string} Updated URL.
  1165  */
  1191  */
  1166 function removeQueryArgs(url, ...args) {
  1192 function removeQueryArgs(url, ...args) {
       
  1193   const fragment = url.replace(/^[^#]*/, '');
       
  1194   url = url.replace(/#.*/, '');
  1167   const queryStringIndex = url.indexOf('?');
  1195   const queryStringIndex = url.indexOf('?');
  1168   if (queryStringIndex === -1) {
  1196   if (queryStringIndex === -1) {
  1169     return url;
  1197     return url + fragment;
  1170   }
  1198   }
  1171   const query = getQueryArgs(url);
  1199   const query = getQueryArgs(url);
  1172   const baseURL = url.substr(0, queryStringIndex);
  1200   const baseURL = url.substr(0, queryStringIndex);
  1173   args.forEach(arg => delete query[arg]);
  1201   args.forEach(arg => delete query[arg]);
  1174   const queryString = buildQueryString(query);
  1202   const queryString = buildQueryString(query);
  1175   return queryString ? baseURL + '?' + queryString : baseURL;
  1203   const updatedUrl = queryString ? baseURL + '?' + queryString : baseURL;
  1176 }
  1204   return updatedUrl + fragment;
  1177 
  1205 }
  1178 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/prepend-http.js
  1206 
       
  1207 ;// ./node_modules/@wordpress/url/build-module/prepend-http.js
  1179 /**
  1208 /**
  1180  * Internal dependencies
  1209  * Internal dependencies
  1181  */
  1210  */
  1182 
  1211 
  1183 const USABLE_HREF_REGEXP = /^(?:[a-z]+:|#|\?|\.|\/)/i;
  1212 const USABLE_HREF_REGEXP = /^(?:[a-z]+:|#|\?|\.|\/)/i;
  1203     return 'http://' + url;
  1232     return 'http://' + url;
  1204   }
  1233   }
  1205   return url;
  1234   return url;
  1206 }
  1235 }
  1207 
  1236 
  1208 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/safe-decode-uri.js
  1237 ;// ./node_modules/@wordpress/url/build-module/safe-decode-uri.js
  1209 /**
  1238 /**
  1210  * Safely decodes a URI with `decodeURI`. Returns the URI unmodified if
  1239  * Safely decodes a URI with `decodeURI`. Returns the URI unmodified if
  1211  * `decodeURI` throws an error.
  1240  * `decodeURI` throws an error.
  1212  *
  1241  *
  1213  * @param {string} uri URI to decode.
  1242  * @param {string} uri URI to decode.
  1225   } catch (uriError) {
  1254   } catch (uriError) {
  1226     return uri;
  1255     return uri;
  1227   }
  1256   }
  1228 }
  1257 }
  1229 
  1258 
  1230 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/filter-url-for-display.js
  1259 ;// ./node_modules/@wordpress/url/build-module/filter-url-for-display.js
  1231 /**
  1260 /**
  1232  * Returns a URL for display.
  1261  * Returns a URL for display.
  1233  *
  1262  *
  1234  * @param {string}      url       Original URL.
  1263  * @param {string}      url       Original URL.
  1235  * @param {number|null} maxLength URL length.
  1264  * @param {number|null} maxLength URL length.
  1241  * ```
  1270  * ```
  1242  *
  1271  *
  1243  * @return {string} Displayed URL.
  1272  * @return {string} Displayed URL.
  1244  */
  1273  */
  1245 function filterURLForDisplay(url, maxLength = null) {
  1274 function filterURLForDisplay(url, maxLength = null) {
       
  1275   if (!url) {
       
  1276     return '';
       
  1277   }
       
  1278 
  1246   // Remove protocol and www prefixes.
  1279   // Remove protocol and www prefixes.
  1247   let filteredURL = url.replace(/^(?:https?:)\/\/(?:www\.)?/, '');
  1280   let filteredURL = url.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i, '').replace(/^www\./i, '');
  1248 
  1281 
  1249   // Ends with / and only has that single slash, strip it.
  1282   // Ends with / and only has that single slash, strip it.
  1250   if (filteredURL.match(/^[^\/]+\/$/)) {
  1283   if (filteredURL.match(/^[^\/]+\/$/)) {
  1251     filteredURL = filteredURL.replace('/', '');
  1284     filteredURL = filteredURL.replace('/', '');
  1252   }
  1285   }
  1273 }
  1306 }
  1274 
  1307 
  1275 // EXTERNAL MODULE: ./node_modules/remove-accents/index.js
  1308 // EXTERNAL MODULE: ./node_modules/remove-accents/index.js
  1276 var remove_accents = __webpack_require__(9681);
  1309 var remove_accents = __webpack_require__(9681);
  1277 var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents);
  1310 var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents);
  1278 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/clean-for-slug.js
  1311 ;// ./node_modules/@wordpress/url/build-module/clean-for-slug.js
  1279 /**
  1312 /**
  1280  * External dependencies
  1313  * External dependencies
  1281  */
  1314  */
  1282 
  1315 
  1283 
  1316 
  1284 /**
  1317 /**
  1285  * Performs some basic cleanup of a string for use as a post slug.
  1318  * Performs some basic cleanup of a string for use as a post slug.
  1286  *
  1319  *
  1287  * This replicates some of what `sanitize_title()` does in WordPress core, but
  1320  * This replicates some of what `sanitize_title_with_dashes()` does in WordPress core, but
  1288  * is only designed to approximate what the slug will be.
  1321  * is only designed to approximate what the slug will be.
  1289  *
  1322  *
  1290  * Converts Latin-1 Supplement and Latin Extended-A letters to basic Latin
  1323  * Converts Latin-1 Supplement and Latin Extended-A letters to basic Latin
  1291  * letters. Removes combining diacritical marks. Converts whitespace, periods,
  1324  * letters. Removes combining diacritical marks. Converts whitespace, periods,
  1292  * and forward slashes to hyphens. Removes any remaining non-word characters
  1325  * and forward slashes to hyphens. Removes any remaining non-word characters
  1300 function cleanForSlug(string) {
  1333 function cleanForSlug(string) {
  1301   if (!string) {
  1334   if (!string) {
  1302     return '';
  1335     return '';
  1303   }
  1336   }
  1304   return remove_accents_default()(string)
  1337   return remove_accents_default()(string)
       
  1338   // Convert &nbsp, &ndash, and &mdash to hyphens.
       
  1339   .replace(/( |–|—)/g, '-')
  1305   // Convert each group of whitespace, periods, and forward slashes to a hyphen.
  1340   // Convert each group of whitespace, periods, and forward slashes to a hyphen.
  1306   .replace(/[\s\./]+/g, '-')
  1341   .replace(/[\s\./]+/g, '-')
       
  1342   // Remove all HTML entities.
       
  1343   .replace(/&\S+?;/g, '')
  1307   // Remove anything that's not a letter, number, underscore or hyphen.
  1344   // Remove anything that's not a letter, number, underscore or hyphen.
  1308   .replace(/[^\p{L}\p{N}_-]+/gu, '')
  1345   .replace(/[^\p{L}\p{N}_-]+/gu, '')
  1309   // Convert to lowercase
  1346   // Convert to lowercase
  1310   .toLowerCase()
  1347   .toLowerCase()
  1311   // Replace multiple hyphens with a single one.
  1348   // Replace multiple hyphens with a single one.
  1312   .replace(/-+/g, '-')
  1349   .replace(/-+/g, '-')
  1313   // Remove any remaining leading or trailing hyphens.
  1350   // Remove any remaining leading or trailing hyphens.
  1314   .replace(/(^-+)|(-+$)/g, '');
  1351   .replace(/(^-+)|(-+$)/g, '');
  1315 }
  1352 }
  1316 
  1353 
  1317 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-filename.js
  1354 ;// ./node_modules/@wordpress/url/build-module/get-filename.js
       
  1355 /* wp:polyfill */
  1318 /**
  1356 /**
  1319  * Returns the filename part of the URL.
  1357  * Returns the filename part of the URL.
  1320  *
  1358  *
  1321  * @param {string} url The full URL.
  1359  * @param {string} url The full URL.
  1322  *
  1360  *
  1339   if (filename) {
  1377   if (filename) {
  1340     return filename;
  1378     return filename;
  1341   }
  1379   }
  1342 }
  1380 }
  1343 
  1381 
  1344 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/normalize-path.js
  1382 ;// ./node_modules/@wordpress/url/build-module/normalize-path.js
  1345 /**
  1383 /**
  1346  * Given a path, returns a normalized path where equal query parameter values
  1384  * Given a path, returns a normalized path where equal query parameter values
  1347  * will be treated as identical, regardless of order they appear in the original
  1385  * will be treated as identical, regardless of order they appear in the original
  1348  * text.
  1386  * text.
  1349  *
  1387  *
  1350  * @param {string} path Original path.
  1388  * @param {string} path Original path.
  1351  *
  1389  *
  1352  * @return {string} Normalized path.
  1390  * @return {string} Normalized path.
  1353  */
  1391  */
  1354 function normalizePath(path) {
  1392 function normalizePath(path) {
  1355   const splitted = path.split('?');
  1393   const split = path.split('?');
  1356   const query = splitted[1];
  1394   const query = split[1];
  1357   const base = splitted[0];
  1395   const base = split[0];
  1358   if (!query) {
  1396   if (!query) {
  1359     return base;
  1397     return base;
  1360   }
  1398   }
  1361 
  1399 
  1362   // 'b=1%2C2&c=2&a=5'
  1400   // 'b=1%2C2&c=2&a=5'
  1375   .map(pair => pair.join('='))
  1413   .map(pair => pair.join('='))
  1376   // 'a=5&b=1%2C2&c=2'
  1414   // 'a=5&b=1%2C2&c=2'
  1377   .join('&');
  1415   .join('&');
  1378 }
  1416 }
  1379 
  1417 
  1380 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/prepend-https.js
  1418 ;// ./node_modules/@wordpress/url/build-module/prepend-https.js
  1381 /**
  1419 /**
  1382  * Internal dependencies
  1420  * Internal dependencies
  1383  */
  1421  */
  1384 
  1422 
  1385 
  1423 
  1408   }
  1446   }
  1409   url = prependHTTP(url);
  1447   url = prependHTTP(url);
  1410   return url.replace(/^http:/, 'https:');
  1448   return url.replace(/^http:/, 'https:');
  1411 }
  1449 }
  1412 
  1450 
  1413 ;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/index.js
  1451 ;// ./node_modules/@wordpress/url/build-module/index.js
       
  1452 
  1414 
  1453 
  1415 
  1454 
  1416 
  1455 
  1417 
  1456 
  1418 
  1457