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 * |
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 * |
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 * |
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. |
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 |
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  , &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' |