[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 /******/ (() => { // webpackBootstrap 2 /******/ var __webpack_modules__ = ({ 3 4 /***/ 9681: 5 /***/ ((module) => { 6 7 var characterMap = { 8 "À": "A", 9 "Á": "A", 10 "Â": "A", 11 "Ã": "A", 12 "Ä": "A", 13 "Å": "A", 14 "Ấ": "A", 15 "Ắ": "A", 16 "Ẳ": "A", 17 "Ẵ": "A", 18 "Ặ": "A", 19 "Æ": "AE", 20 "Ầ": "A", 21 "Ằ": "A", 22 "Ȃ": "A", 23 "Ả": "A", 24 "Ạ": "A", 25 "Ẩ": "A", 26 "Ẫ": "A", 27 "Ậ": "A", 28 "Ç": "C", 29 "Ḉ": "C", 30 "È": "E", 31 "É": "E", 32 "Ê": "E", 33 "Ë": "E", 34 "Ế": "E", 35 "Ḗ": "E", 36 "Ề": "E", 37 "Ḕ": "E", 38 "Ḝ": "E", 39 "Ȇ": "E", 40 "Ẻ": "E", 41 "Ẽ": "E", 42 "Ẹ": "E", 43 "Ể": "E", 44 "Ễ": "E", 45 "Ệ": "E", 46 "Ì": "I", 47 "Í": "I", 48 "Î": "I", 49 "Ï": "I", 50 "Ḯ": "I", 51 "Ȋ": "I", 52 "Ỉ": "I", 53 "Ị": "I", 54 "Ð": "D", 55 "Ñ": "N", 56 "Ò": "O", 57 "Ó": "O", 58 "Ô": "O", 59 "Õ": "O", 60 "Ö": "O", 61 "Ø": "O", 62 "Ố": "O", 63 "Ṍ": "O", 64 "Ṓ": "O", 65 "Ȏ": "O", 66 "Ỏ": "O", 67 "Ọ": "O", 68 "Ổ": "O", 69 "Ỗ": "O", 70 "Ộ": "O", 71 "Ờ": "O", 72 "Ở": "O", 73 "Ỡ": "O", 74 "Ớ": "O", 75 "Ợ": "O", 76 "Ù": "U", 77 "Ú": "U", 78 "Û": "U", 79 "Ü": "U", 80 "Ủ": "U", 81 "Ụ": "U", 82 "Ử": "U", 83 "Ữ": "U", 84 "Ự": "U", 85 "Ý": "Y", 86 "à": "a", 87 "á": "a", 88 "â": "a", 89 "ã": "a", 90 "ä": "a", 91 "å": "a", 92 "ấ": "a", 93 "ắ": "a", 94 "ẳ": "a", 95 "ẵ": "a", 96 "ặ": "a", 97 "æ": "ae", 98 "ầ": "a", 99 "ằ": "a", 100 "ȃ": "a", 101 "ả": "a", 102 "ạ": "a", 103 "ẩ": "a", 104 "ẫ": "a", 105 "ậ": "a", 106 "ç": "c", 107 "ḉ": "c", 108 "è": "e", 109 "é": "e", 110 "ê": "e", 111 "ë": "e", 112 "ế": "e", 113 "ḗ": "e", 114 "ề": "e", 115 "ḕ": "e", 116 "ḝ": "e", 117 "ȇ": "e", 118 "ẻ": "e", 119 "ẽ": "e", 120 "ẹ": "e", 121 "ể": "e", 122 "ễ": "e", 123 "ệ": "e", 124 "ì": "i", 125 "í": "i", 126 "î": "i", 127 "ï": "i", 128 "ḯ": "i", 129 "ȋ": "i", 130 "ỉ": "i", 131 "ị": "i", 132 "ð": "d", 133 "ñ": "n", 134 "ò": "o", 135 "ó": "o", 136 "ô": "o", 137 "õ": "o", 138 "ö": "o", 139 "ø": "o", 140 "ố": "o", 141 "ṍ": "o", 142 "ṓ": "o", 143 "ȏ": "o", 144 "ỏ": "o", 145 "ọ": "o", 146 "ổ": "o", 147 "ỗ": "o", 148 "ộ": "o", 149 "ờ": "o", 150 "ở": "o", 151 "ỡ": "o", 152 "ớ": "o", 153 "ợ": "o", 154 "ù": "u", 155 "ú": "u", 156 "û": "u", 157 "ü": "u", 158 "ủ": "u", 159 "ụ": "u", 160 "ử": "u", 161 "ữ": "u", 162 "ự": "u", 163 "ý": "y", 164 "ÿ": "y", 165 "Ā": "A", 166 "ā": "a", 167 "Ă": "A", 168 "ă": "a", 169 "Ą": "A", 170 "ą": "a", 171 "Ć": "C", 172 "ć": "c", 173 "Ĉ": "C", 174 "ĉ": "c", 175 "Ċ": "C", 176 "ċ": "c", 177 "Č": "C", 178 "č": "c", 179 "C̆": "C", 180 "c̆": "c", 181 "Ď": "D", 182 "ď": "d", 183 "Đ": "D", 184 "đ": "d", 185 "Ē": "E", 186 "ē": "e", 187 "Ĕ": "E", 188 "ĕ": "e", 189 "Ė": "E", 190 "ė": "e", 191 "Ę": "E", 192 "ę": "e", 193 "Ě": "E", 194 "ě": "e", 195 "Ĝ": "G", 196 "Ǵ": "G", 197 "ĝ": "g", 198 "ǵ": "g", 199 "Ğ": "G", 200 "ğ": "g", 201 "Ġ": "G", 202 "ġ": "g", 203 "Ģ": "G", 204 "ģ": "g", 205 "Ĥ": "H", 206 "ĥ": "h", 207 "Ħ": "H", 208 "ħ": "h", 209 "Ḫ": "H", 210 "ḫ": "h", 211 "Ĩ": "I", 212 "ĩ": "i", 213 "Ī": "I", 214 "ī": "i", 215 "Ĭ": "I", 216 "ĭ": "i", 217 "Į": "I", 218 "į": "i", 219 "İ": "I", 220 "ı": "i", 221 "IJ": "IJ", 222 "ij": "ij", 223 "Ĵ": "J", 224 "ĵ": "j", 225 "Ķ": "K", 226 "ķ": "k", 227 "Ḱ": "K", 228 "ḱ": "k", 229 "K̆": "K", 230 "k̆": "k", 231 "Ĺ": "L", 232 "ĺ": "l", 233 "Ļ": "L", 234 "ļ": "l", 235 "Ľ": "L", 236 "ľ": "l", 237 "Ŀ": "L", 238 "ŀ": "l", 239 "Ł": "l", 240 "ł": "l", 241 "Ḿ": "M", 242 "ḿ": "m", 243 "M̆": "M", 244 "m̆": "m", 245 "Ń": "N", 246 "ń": "n", 247 "Ņ": "N", 248 "ņ": "n", 249 "Ň": "N", 250 "ň": "n", 251 "ʼn": "n", 252 "N̆": "N", 253 "n̆": "n", 254 "Ō": "O", 255 "ō": "o", 256 "Ŏ": "O", 257 "ŏ": "o", 258 "Ő": "O", 259 "ő": "o", 260 "Œ": "OE", 261 "œ": "oe", 262 "P̆": "P", 263 "p̆": "p", 264 "Ŕ": "R", 265 "ŕ": "r", 266 "Ŗ": "R", 267 "ŗ": "r", 268 "Ř": "R", 269 "ř": "r", 270 "R̆": "R", 271 "r̆": "r", 272 "Ȓ": "R", 273 "ȓ": "r", 274 "Ś": "S", 275 "ś": "s", 276 "Ŝ": "S", 277 "ŝ": "s", 278 "Ş": "S", 279 "Ș": "S", 280 "ș": "s", 281 "ş": "s", 282 "Š": "S", 283 "š": "s", 284 "Ţ": "T", 285 "ţ": "t", 286 "ț": "t", 287 "Ț": "T", 288 "Ť": "T", 289 "ť": "t", 290 "Ŧ": "T", 291 "ŧ": "t", 292 "T̆": "T", 293 "t̆": "t", 294 "Ũ": "U", 295 "ũ": "u", 296 "Ū": "U", 297 "ū": "u", 298 "Ŭ": "U", 299 "ŭ": "u", 300 "Ů": "U", 301 "ů": "u", 302 "Ű": "U", 303 "ű": "u", 304 "Ų": "U", 305 "ų": "u", 306 "Ȗ": "U", 307 "ȗ": "u", 308 "V̆": "V", 309 "v̆": "v", 310 "Ŵ": "W", 311 "ŵ": "w", 312 "Ẃ": "W", 313 "ẃ": "w", 314 "X̆": "X", 315 "x̆": "x", 316 "Ŷ": "Y", 317 "ŷ": "y", 318 "Ÿ": "Y", 319 "Y̆": "Y", 320 "y̆": "y", 321 "Ź": "Z", 322 "ź": "z", 323 "Ż": "Z", 324 "ż": "z", 325 "Ž": "Z", 326 "ž": "z", 327 "ſ": "s", 328 "ƒ": "f", 329 "Ơ": "O", 330 "ơ": "o", 331 "Ư": "U", 332 "ư": "u", 333 "Ǎ": "A", 334 "ǎ": "a", 335 "Ǐ": "I", 336 "ǐ": "i", 337 "Ǒ": "O", 338 "ǒ": "o", 339 "Ǔ": "U", 340 "ǔ": "u", 341 "Ǖ": "U", 342 "ǖ": "u", 343 "Ǘ": "U", 344 "ǘ": "u", 345 "Ǚ": "U", 346 "ǚ": "u", 347 "Ǜ": "U", 348 "ǜ": "u", 349 "Ứ": "U", 350 "ứ": "u", 351 "Ṹ": "U", 352 "ṹ": "u", 353 "Ǻ": "A", 354 "ǻ": "a", 355 "Ǽ": "AE", 356 "ǽ": "ae", 357 "Ǿ": "O", 358 "ǿ": "o", 359 "Þ": "TH", 360 "þ": "th", 361 "Ṕ": "P", 362 "ṕ": "p", 363 "Ṥ": "S", 364 "ṥ": "s", 365 "X́": "X", 366 "x́": "x", 367 "Ѓ": "Г", 368 "ѓ": "г", 369 "Ќ": "К", 370 "ќ": "к", 371 "A̋": "A", 372 "a̋": "a", 373 "E̋": "E", 374 "e̋": "e", 375 "I̋": "I", 376 "i̋": "i", 377 "Ǹ": "N", 378 "ǹ": "n", 379 "Ồ": "O", 380 "ồ": "o", 381 "Ṑ": "O", 382 "ṑ": "o", 383 "Ừ": "U", 384 "ừ": "u", 385 "Ẁ": "W", 386 "ẁ": "w", 387 "Ỳ": "Y", 388 "ỳ": "y", 389 "Ȁ": "A", 390 "ȁ": "a", 391 "Ȅ": "E", 392 "ȅ": "e", 393 "Ȉ": "I", 394 "ȉ": "i", 395 "Ȍ": "O", 396 "ȍ": "o", 397 "Ȑ": "R", 398 "ȑ": "r", 399 "Ȕ": "U", 400 "ȕ": "u", 401 "B̌": "B", 402 "b̌": "b", 403 "Č̣": "C", 404 "č̣": "c", 405 "Ê̌": "E", 406 "ê̌": "e", 407 "F̌": "F", 408 "f̌": "f", 409 "Ǧ": "G", 410 "ǧ": "g", 411 "Ȟ": "H", 412 "ȟ": "h", 413 "J̌": "J", 414 "ǰ": "j", 415 "Ǩ": "K", 416 "ǩ": "k", 417 "M̌": "M", 418 "m̌": "m", 419 "P̌": "P", 420 "p̌": "p", 421 "Q̌": "Q", 422 "q̌": "q", 423 "Ř̩": "R", 424 "ř̩": "r", 425 "Ṧ": "S", 426 "ṧ": "s", 427 "V̌": "V", 428 "v̌": "v", 429 "W̌": "W", 430 "w̌": "w", 431 "X̌": "X", 432 "x̌": "x", 433 "Y̌": "Y", 434 "y̌": "y", 435 "A̧": "A", 436 "a̧": "a", 437 "B̧": "B", 438 "b̧": "b", 439 "Ḑ": "D", 440 "ḑ": "d", 441 "Ȩ": "E", 442 "ȩ": "e", 443 "Ɛ̧": "E", 444 "ɛ̧": "e", 445 "Ḩ": "H", 446 "ḩ": "h", 447 "I̧": "I", 448 "i̧": "i", 449 "Ɨ̧": "I", 450 "ɨ̧": "i", 451 "M̧": "M", 452 "m̧": "m", 453 "O̧": "O", 454 "o̧": "o", 455 "Q̧": "Q", 456 "q̧": "q", 457 "U̧": "U", 458 "u̧": "u", 459 "X̧": "X", 460 "x̧": "x", 461 "Z̧": "Z", 462 "z̧": "z", 463 "й":"и", 464 "Й":"И", 465 "ё":"е", 466 "Ё":"Е", 467 }; 468 469 var chars = Object.keys(characterMap).join('|'); 470 var allAccents = new RegExp(chars, 'g'); 471 var firstAccent = new RegExp(chars, ''); 472 473 function matcher(match) { 474 return characterMap[match]; 475 } 476 477 var removeAccents = function(string) { 478 return string.replace(allAccents, matcher); 479 }; 480 481 var hasAccents = function(string) { 482 return !!string.match(firstAccent); 483 }; 484 485 module.exports = removeAccents; 486 module.exports.has = hasAccents; 487 module.exports.remove = removeAccents; 488 489 490 /***/ }) 491 492 /******/ }); 493 /************************************************************************/ 494 /******/ // The module cache 495 /******/ var __webpack_module_cache__ = {}; 496 /******/ 497 /******/ // The require function 498 /******/ function __webpack_require__(moduleId) { 499 /******/ // Check if module is in cache 500 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 501 /******/ if (cachedModule !== undefined) { 502 /******/ return cachedModule.exports; 503 /******/ } 504 /******/ // Create a new module (and put it into the cache) 505 /******/ var module = __webpack_module_cache__[moduleId] = { 506 /******/ // no module.id needed 507 /******/ // no module.loaded needed 508 /******/ exports: {} 509 /******/ }; 510 /******/ 511 /******/ // Execute the module function 512 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 513 /******/ 514 /******/ // Return the exports of the module 515 /******/ return module.exports; 516 /******/ } 517 /******/ 518 /************************************************************************/ 519 /******/ /* webpack/runtime/compat get default export */ 520 /******/ (() => { 521 /******/ // getDefaultExport function for compatibility with non-harmony modules 522 /******/ __webpack_require__.n = (module) => { 523 /******/ var getter = module && module.__esModule ? 524 /******/ () => (module['default']) : 525 /******/ () => (module); 526 /******/ __webpack_require__.d(getter, { a: getter }); 527 /******/ return getter; 528 /******/ }; 529 /******/ })(); 530 /******/ 531 /******/ /* webpack/runtime/define property getters */ 532 /******/ (() => { 533 /******/ // define getter functions for harmony exports 534 /******/ __webpack_require__.d = (exports, definition) => { 535 /******/ for(var key in definition) { 536 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 537 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 538 /******/ } 539 /******/ } 540 /******/ }; 541 /******/ })(); 542 /******/ 543 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 544 /******/ (() => { 545 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 546 /******/ })(); 547 /******/ 548 /******/ /* webpack/runtime/make namespace object */ 549 /******/ (() => { 550 /******/ // define __esModule on exports 551 /******/ __webpack_require__.r = (exports) => { 552 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 553 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 554 /******/ } 555 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 556 /******/ }; 557 /******/ })(); 558 /******/ 559 /************************************************************************/ 560 var __webpack_exports__ = {}; 561 // This entry needs to be wrapped in an IIFE because it needs to be in strict mode. 562 (() => { 563 "use strict"; 564 // ESM COMPAT FLAG 565 __webpack_require__.r(__webpack_exports__); 566 567 // EXPORTS 568 __webpack_require__.d(__webpack_exports__, { 569 addQueryArgs: () => (/* reexport */ addQueryArgs), 570 buildQueryString: () => (/* reexport */ buildQueryString), 571 cleanForSlug: () => (/* reexport */ cleanForSlug), 572 filterURLForDisplay: () => (/* reexport */ filterURLForDisplay), 573 getAuthority: () => (/* reexport */ getAuthority), 574 getFilename: () => (/* reexport */ getFilename), 575 getFragment: () => (/* reexport */ getFragment), 576 getPath: () => (/* reexport */ getPath), 577 getPathAndQueryString: () => (/* reexport */ getPathAndQueryString), 578 getProtocol: () => (/* reexport */ getProtocol), 579 getQueryArg: () => (/* reexport */ getQueryArg), 580 getQueryArgs: () => (/* reexport */ getQueryArgs), 581 getQueryString: () => (/* reexport */ getQueryString), 582 hasQueryArg: () => (/* reexport */ hasQueryArg), 583 isEmail: () => (/* reexport */ isEmail), 584 isPhoneNumber: () => (/* reexport */ isPhoneNumber), 585 isURL: () => (/* reexport */ isURL), 586 isValidAuthority: () => (/* reexport */ isValidAuthority), 587 isValidFragment: () => (/* reexport */ isValidFragment), 588 isValidPath: () => (/* reexport */ isValidPath), 589 isValidProtocol: () => (/* reexport */ isValidProtocol), 590 isValidQueryString: () => (/* reexport */ isValidQueryString), 591 normalizePath: () => (/* reexport */ normalizePath), 592 prependHTTP: () => (/* reexport */ prependHTTP), 593 prependHTTPS: () => (/* reexport */ prependHTTPS), 594 removeQueryArgs: () => (/* reexport */ removeQueryArgs), 595 safeDecodeURI: () => (/* reexport */ safeDecodeURI), 596 safeDecodeURIComponent: () => (/* reexport */ safeDecodeURIComponent) 597 }); 598 599 ;// ./node_modules/@wordpress/url/build-module/is-url.js 600 /* wp:polyfill */ 601 /** 602 * Determines whether the given string looks like a URL. 603 * 604 * @param {string} url The string to scrutinise. 605 * 606 * @example 607 * ```js 608 * const isURL = isURL( 'https://wordpress.org' ); // true 609 * ``` 610 * 611 * @see https://url.spec.whatwg.org/ 612 * @see https://url.spec.whatwg.org/#valid-url-string 613 * 614 * @return {boolean} Whether or not it looks like a URL. 615 */ 616 function isURL(url) { 617 // A URL can be considered value if the `URL` constructor is able to parse 618 // it. The constructor throws an error for an invalid URL. 619 try { 620 new URL(url); 621 return true; 622 } catch { 623 return false; 624 } 625 } 626 627 ;// ./node_modules/@wordpress/url/build-module/is-email.js 628 const EMAIL_REGEXP = /^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i; 629 630 /** 631 * Determines whether the given string looks like an email. 632 * 633 * @param {string} email The string to scrutinise. 634 * 635 * @example 636 * ```js 637 * const isEmail = isEmail( 'hello@wordpress.org' ); // true 638 * ``` 639 * 640 * @return {boolean} Whether or not it looks like an email. 641 */ 642 function isEmail(email) { 643 return EMAIL_REGEXP.test(email); 644 } 645 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 668 /** 669 * Returns the protocol part of the URL. 670 * 671 * @param {string} url The full URL. 672 * 673 * @example 674 * ```js 675 * const protocol1 = getProtocol( 'tel:012345678' ); // 'tel:' 676 * const protocol2 = getProtocol( 'https://wordpress.org' ); // 'https:' 677 * ``` 678 * 679 * @return {string|void} The protocol part of the URL. 680 */ 681 function getProtocol(url) { 682 const matches = /^([^\s:]+:)/.exec(url); 683 if (matches) { 684 return matches[1]; 685 } 686 } 687 688 ;// ./node_modules/@wordpress/url/build-module/is-valid-protocol.js 689 /** 690 * Tests if a url protocol is valid. 691 * 692 * @param {string} protocol The url protocol. 693 * 694 * @example 695 * ```js 696 * const isValid = isValidProtocol( 'https:' ); // true 697 * const isNotValid = isValidProtocol( 'https :' ); // false 698 * ``` 699 * 700 * @return {boolean} True if the argument is a valid protocol (e.g. http:, tel:). 701 */ 702 function isValidProtocol(protocol) { 703 if (!protocol) { 704 return false; 705 } 706 return /^[a-z\-.\+]+[0-9]*:$/i.test(protocol); 707 } 708 709 ;// ./node_modules/@wordpress/url/build-module/get-authority.js 710 /** 711 * Returns the authority part of the URL. 712 * 713 * @param {string} url The full URL. 714 * 715 * @example 716 * ```js 717 * const authority1 = getAuthority( 'https://wordpress.org/help/' ); // 'wordpress.org' 718 * const authority2 = getAuthority( 'https://localhost:8080/test/' ); // 'localhost:8080' 719 * ``` 720 * 721 * @return {string|void} The authority part of the URL. 722 */ 723 function getAuthority(url) { 724 const matches = /^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(url); 725 if (matches) { 726 return matches[1]; 727 } 728 } 729 730 ;// ./node_modules/@wordpress/url/build-module/is-valid-authority.js 731 /** 732 * Checks for invalid characters within the provided authority. 733 * 734 * @param {string} authority A string containing the URL authority. 735 * 736 * @example 737 * ```js 738 * const isValid = isValidAuthority( 'wordpress.org' ); // true 739 * const isNotValid = isValidAuthority( 'wordpress#org' ); // false 740 * ``` 741 * 742 * @return {boolean} True if the argument contains a valid authority. 743 */ 744 function isValidAuthority(authority) { 745 if (!authority) { 746 return false; 747 } 748 return /^[^\s#?]+$/.test(authority); 749 } 750 751 ;// ./node_modules/@wordpress/url/build-module/get-path.js 752 /** 753 * Returns the path part of the URL. 754 * 755 * @param {string} url The full URL. 756 * 757 * @example 758 * ```js 759 * const path1 = getPath( 'http://localhost:8080/this/is/a/test?query=true' ); // 'this/is/a/test' 760 * const path2 = getPath( 'https://wordpress.org/help/faq/' ); // 'help/faq' 761 * ``` 762 * 763 * @return {string|void} The path part of the URL. 764 */ 765 function getPath(url) { 766 const matches = /^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(url); 767 if (matches) { 768 return matches[1]; 769 } 770 } 771 772 ;// ./node_modules/@wordpress/url/build-module/is-valid-path.js 773 /** 774 * Checks for invalid characters within the provided path. 775 * 776 * @param {string} path The URL path. 777 * 778 * @example 779 * ```js 780 * const isValid = isValidPath( 'test/path/' ); // true 781 * const isNotValid = isValidPath( '/invalid?test/path/' ); // false 782 * ``` 783 * 784 * @return {boolean} True if the argument contains a valid path 785 */ 786 function isValidPath(path) { 787 if (!path) { 788 return false; 789 } 790 return /^[^\s#?]+$/.test(path); 791 } 792 793 ;// ./node_modules/@wordpress/url/build-module/get-query-string.js 794 /* wp:polyfill */ 795 /** 796 * Returns the query string part of the URL. 797 * 798 * @param {string} url The full URL. 799 * 800 * @example 801 * ```js 802 * const queryString = getQueryString( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // 'query=true' 803 * ``` 804 * 805 * @return {string|void} The query string part of the URL. 806 */ 807 function getQueryString(url) { 808 let query; 809 try { 810 query = new URL(url, 'http://example.com').search.substring(1); 811 } catch (error) {} 812 if (query) { 813 return query; 814 } 815 } 816 817 ;// ./node_modules/@wordpress/url/build-module/build-query-string.js 818 /* wp:polyfill */ 819 /** 820 * Generates URL-encoded query string using input query data. 821 * 822 * It is intended to behave equivalent as PHP's `http_build_query`, configured 823 * with encoding type PHP_QUERY_RFC3986 (spaces as `%20`). 824 * 825 * @example 826 * ```js 827 * const queryString = buildQueryString( { 828 * simple: 'is ok', 829 * arrays: [ 'are', 'fine', 'too' ], 830 * objects: { 831 * evenNested: { 832 * ok: 'yes', 833 * }, 834 * }, 835 * } ); 836 * // "simple=is%20ok&arrays%5B0%5D=are&arrays%5B1%5D=fine&arrays%5B2%5D=too&objects%5BevenNested%5D%5Bok%5D=yes" 837 * ``` 838 * 839 * @param {Record<string,*>} data Data to encode. 840 * 841 * @return {string} Query string. 842 */ 843 function buildQueryString(data) { 844 let string = ''; 845 const stack = Object.entries(data); 846 let pair; 847 while (pair = stack.shift()) { 848 let [key, value] = pair; 849 850 // Support building deeply nested data, from array or object values. 851 const hasNestedData = Array.isArray(value) || value && value.constructor === Object; 852 if (hasNestedData) { 853 // Push array or object values onto the stack as composed of their 854 // original key and nested index or key, retaining order by a 855 // combination of Array#reverse and Array#unshift onto the stack. 856 const valuePairs = Object.entries(value).reverse(); 857 for (const [member, memberValue] of valuePairs) { 858 stack.unshift([`$key}[$member}]`, memberValue]); 859 } 860 } else if (value !== undefined) { 861 // Null is treated as special case, equivalent to empty string. 862 if (value === null) { 863 value = ''; 864 } 865 string += '&' + [key, value].map(encodeURIComponent).join('='); 866 } 867 } 868 869 // Loop will concatenate with leading `&`, but it's only expected for all 870 // but the first query parameter. This strips the leading `&`, while still 871 // accounting for the case that the string may in-fact be empty. 872 return string.substr(1); 873 } 874 875 ;// ./node_modules/@wordpress/url/build-module/is-valid-query-string.js 876 /** 877 * Checks for invalid characters within the provided query string. 878 * 879 * @param {string} queryString The query string. 880 * 881 * @example 882 * ```js 883 * const isValid = isValidQueryString( 'query=true&another=false' ); // true 884 * const isNotValid = isValidQueryString( 'query=true?another=false' ); // false 885 * ``` 886 * 887 * @return {boolean} True if the argument contains a valid query string. 888 */ 889 function isValidQueryString(queryString) { 890 if (!queryString) { 891 return false; 892 } 893 return /^[^\s#?\/]+$/.test(queryString); 894 } 895 896 ;// ./node_modules/@wordpress/url/build-module/get-path-and-query-string.js 897 /** 898 * Internal dependencies 899 */ 900 901 902 /** 903 * Returns the path part and query string part of the URL. 904 * 905 * @param {string} url The full URL. 906 * 907 * @example 908 * ```js 909 * const pathAndQueryString1 = getPathAndQueryString( 'http://localhost:8080/this/is/a/test?query=true' ); // '/this/is/a/test?query=true' 910 * const pathAndQueryString2 = getPathAndQueryString( 'https://wordpress.org/help/faq/' ); // '/help/faq' 911 * ``` 912 * 913 * @return {string} The path part and query string part of the URL. 914 */ 915 function getPathAndQueryString(url) { 916 const path = getPath(url); 917 const queryString = getQueryString(url); 918 let value = '/'; 919 if (path) { 920 value += path; 921 } 922 if (queryString) { 923 value += `?$queryString}`; 924 } 925 return value; 926 } 927 928 ;// ./node_modules/@wordpress/url/build-module/get-fragment.js 929 /** 930 * Returns the fragment part of the URL. 931 * 932 * @param {string} url The full URL 933 * 934 * @example 935 * ```js 936 * const fragment1 = getFragment( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // '#fragment' 937 * const fragment2 = getFragment( 'https://wordpress.org#another-fragment?query=true' ); // '#another-fragment' 938 * ``` 939 * 940 * @return {string|void} The fragment part of the URL. 941 */ 942 function getFragment(url) { 943 const matches = /^\S+?(#[^\s\?]*)/.exec(url); 944 if (matches) { 945 return matches[1]; 946 } 947 } 948 949 ;// ./node_modules/@wordpress/url/build-module/is-valid-fragment.js 950 /** 951 * Checks for invalid characters within the provided fragment. 952 * 953 * @param {string} fragment The url fragment. 954 * 955 * @example 956 * ```js 957 * const isValid = isValidFragment( '#valid-fragment' ); // true 958 * const isNotValid = isValidFragment( '#invalid-#fragment' ); // false 959 * ``` 960 * 961 * @return {boolean} True if the argument contains a valid fragment. 962 */ 963 function isValidFragment(fragment) { 964 if (!fragment) { 965 return false; 966 } 967 return /^#[^\s#?\/]*$/.test(fragment); 968 } 969 970 ;// ./node_modules/@wordpress/url/build-module/safe-decode-uri-component.js 971 /** 972 * Safely decodes a URI component with `decodeURIComponent`. Returns the URI component unmodified if 973 * `decodeURIComponent` throws an error. 974 * 975 * @param {string} uriComponent URI component to decode. 976 * 977 * @return {string} Decoded URI component if possible. 978 */ 979 function safeDecodeURIComponent(uriComponent) { 980 try { 981 return decodeURIComponent(uriComponent); 982 } catch (uriComponentError) { 983 return uriComponent; 984 } 985 } 986 987 ;// ./node_modules/@wordpress/url/build-module/get-query-args.js 988 /* wp:polyfill */ 989 /** 990 * Internal dependencies 991 */ 992 993 994 995 /** @typedef {import('./get-query-arg').QueryArgParsed} QueryArgParsed */ 996 997 /** 998 * @typedef {Record<string,QueryArgParsed>} QueryArgs 999 */ 1000 1001 /** 1002 * Sets a value in object deeply by a given array of path segments. Mutates the 1003 * object reference. 1004 * 1005 * @param {Record<string,*>} object Object in which to assign. 1006 * @param {string[]} path Path segment at which to set value. 1007 * @param {*} value Value to set. 1008 */ 1009 function setPath(object, path, value) { 1010 const length = path.length; 1011 const lastIndex = length - 1; 1012 for (let i = 0; i < length; i++) { 1013 let key = path[i]; 1014 if (!key && Array.isArray(object)) { 1015 // If key is empty string and next value is array, derive key from 1016 // the current length of the array. 1017 key = object.length.toString(); 1018 } 1019 key = ['__proto__', 'constructor', 'prototype'].includes(key) ? key.toUpperCase() : key; 1020 1021 // If the next key in the path is numeric (or empty string), it will be 1022 // created as an array. Otherwise, it will be created as an object. 1023 const isNextKeyArrayIndex = !isNaN(Number(path[i + 1])); 1024 object[key] = i === lastIndex ? 1025 // If at end of path, assign the intended value. 1026 value : 1027 // Otherwise, advance to the next object in the path, creating 1028 // it if it does not yet exist. 1029 object[key] || (isNextKeyArrayIndex ? [] : {}); 1030 if (Array.isArray(object[key]) && !isNextKeyArrayIndex) { 1031 // If we current key is non-numeric, but the next value is an 1032 // array, coerce the value to an object. 1033 object[key] = { 1034 ...object[key] 1035 }; 1036 } 1037 1038 // Update working reference object to the next in the path. 1039 object = object[key]; 1040 } 1041 } 1042 1043 /** 1044 * Returns an object of query arguments of the given URL. If the given URL is 1045 * invalid or has no querystring, an empty object is returned. 1046 * 1047 * @param {string} url URL. 1048 * 1049 * @example 1050 * ```js 1051 * const foo = getQueryArgs( 'https://wordpress.org?foo=bar&bar=baz' ); 1052 * // { "foo": "bar", "bar": "baz" } 1053 * ``` 1054 * 1055 * @return {QueryArgs} Query args object. 1056 */ 1057 function getQueryArgs(url) { 1058 return (getQueryString(url) || '' 1059 // Normalize space encoding, accounting for PHP URL encoding 1060 // corresponding to `application/x-www-form-urlencoded`. 1061 // 1062 // See: https://tools.ietf.org/html/rfc1866#section-8.2.1 1063 ).replace(/\+/g, '%20').split('&').reduce((accumulator, keyValue) => { 1064 const [key, value = ''] = keyValue.split('=') 1065 // Filtering avoids decoding as `undefined` for value, where 1066 // default is restored in destructuring assignment. 1067 .filter(Boolean).map(safeDecodeURIComponent); 1068 if (key) { 1069 const segments = key.replace(/\]/g, '').split('['); 1070 setPath(accumulator, segments, value); 1071 } 1072 return accumulator; 1073 }, Object.create(null)); 1074 } 1075 1076 ;// ./node_modules/@wordpress/url/build-module/add-query-args.js 1077 /** 1078 * Internal dependencies 1079 */ 1080 1081 1082 1083 /** 1084 * Appends arguments as querystring to the provided URL. If the URL already 1085 * includes query arguments, the arguments are merged with (and take precedent 1086 * over) the existing set. 1087 * 1088 * @param {string} [url=''] URL to which arguments should be appended. If omitted, 1089 * only the resulting querystring is returned. 1090 * @param {Object} [args] Query arguments to apply to URL. 1091 * 1092 * @example 1093 * ```js 1094 * const newURL = addQueryArgs( 'https://google.com', { q: 'test' } ); // https://google.com/?q=test 1095 * ``` 1096 * 1097 * @return {string} URL with arguments applied. 1098 */ 1099 function addQueryArgs(url = '', args) { 1100 // If no arguments are to be appended, return original URL. 1101 if (!args || !Object.keys(args).length) { 1102 return url; 1103 } 1104 let baseUrl = url; 1105 1106 // Determine whether URL already had query arguments. 1107 const queryStringIndex = url.indexOf('?'); 1108 if (queryStringIndex !== -1) { 1109 // Merge into existing query arguments. 1110 args = Object.assign(getQueryArgs(url), args); 1111 1112 // Change working base URL to omit previous query arguments. 1113 baseUrl = baseUrl.substr(0, queryStringIndex); 1114 } 1115 return baseUrl + '?' + buildQueryString(args); 1116 } 1117 1118 ;// ./node_modules/@wordpress/url/build-module/get-query-arg.js 1119 /** 1120 * Internal dependencies 1121 */ 1122 1123 1124 /** 1125 * @typedef {{[key: string]: QueryArgParsed}} QueryArgObject 1126 */ 1127 1128 /** 1129 * @typedef {string|string[]|QueryArgObject} QueryArgParsed 1130 */ 1131 1132 /** 1133 * Returns a single query argument of the url 1134 * 1135 * @param {string} url URL. 1136 * @param {string} arg Query arg name. 1137 * 1138 * @example 1139 * ```js 1140 * const foo = getQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'foo' ); // bar 1141 * ``` 1142 * 1143 * @return {QueryArgParsed|void} Query arg value. 1144 */ 1145 function getQueryArg(url, arg) { 1146 return getQueryArgs(url)[arg]; 1147 } 1148 1149 ;// ./node_modules/@wordpress/url/build-module/has-query-arg.js 1150 /** 1151 * Internal dependencies 1152 */ 1153 1154 1155 /** 1156 * Determines whether the URL contains a given query arg. 1157 * 1158 * @param {string} url URL. 1159 * @param {string} arg Query arg name. 1160 * 1161 * @example 1162 * ```js 1163 * const hasBar = hasQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'bar' ); // true 1164 * ``` 1165 * 1166 * @return {boolean} Whether or not the URL contains the query arg. 1167 */ 1168 function hasQueryArg(url, arg) { 1169 return getQueryArg(url, arg) !== undefined; 1170 } 1171 1172 ;// ./node_modules/@wordpress/url/build-module/remove-query-args.js 1173 /* wp:polyfill */ 1174 /** 1175 * Internal dependencies 1176 */ 1177 1178 1179 1180 /** 1181 * Removes arguments from the query string of the url 1182 * 1183 * @param {string} url URL. 1184 * @param {...string} args Query Args. 1185 * 1186 * @example 1187 * ```js 1188 * const newUrl = removeQueryArgs( 'https://wordpress.org?foo=bar&bar=baz&baz=foobar', 'foo', 'bar' ); // https://wordpress.org?baz=foobar 1189 * ``` 1190 * 1191 * @return {string} Updated URL. 1192 */ 1193 function removeQueryArgs(url, ...args) { 1194 const queryStringIndex = url.indexOf('?'); 1195 if (queryStringIndex === -1) { 1196 return url; 1197 } 1198 const query = getQueryArgs(url); 1199 const baseURL = url.substr(0, queryStringIndex); 1200 args.forEach(arg => delete query[arg]); 1201 const queryString = buildQueryString(query); 1202 return queryString ? baseURL + '?' + queryString : baseURL; 1203 } 1204 1205 ;// ./node_modules/@wordpress/url/build-module/prepend-http.js 1206 /** 1207 * Internal dependencies 1208 */ 1209 1210 const USABLE_HREF_REGEXP = /^(?:[a-z]+:|#|\?|\.|\/)/i; 1211 1212 /** 1213 * Prepends "http://" to a url, if it looks like something that is meant to be a TLD. 1214 * 1215 * @param {string} url The URL to test. 1216 * 1217 * @example 1218 * ```js 1219 * const actualURL = prependHTTP( 'wordpress.org' ); // http://wordpress.org 1220 * ``` 1221 * 1222 * @return {string} The updated URL. 1223 */ 1224 function prependHTTP(url) { 1225 if (!url) { 1226 return url; 1227 } 1228 url = url.trim(); 1229 if (!USABLE_HREF_REGEXP.test(url) && !isEmail(url)) { 1230 return 'http://' + url; 1231 } 1232 return url; 1233 } 1234 1235 ;// ./node_modules/@wordpress/url/build-module/safe-decode-uri.js 1236 /** 1237 * Safely decodes a URI with `decodeURI`. Returns the URI unmodified if 1238 * `decodeURI` throws an error. 1239 * 1240 * @param {string} uri URI to decode. 1241 * 1242 * @example 1243 * ```js 1244 * const badUri = safeDecodeURI( '%z' ); // does not throw an Error, simply returns '%z' 1245 * ``` 1246 * 1247 * @return {string} Decoded URI if possible. 1248 */ 1249 function safeDecodeURI(uri) { 1250 try { 1251 return decodeURI(uri); 1252 } catch (uriError) { 1253 return uri; 1254 } 1255 } 1256 1257 ;// ./node_modules/@wordpress/url/build-module/filter-url-for-display.js 1258 /** 1259 * Returns a URL for display. 1260 * 1261 * @param {string} url Original URL. 1262 * @param {number|null} maxLength URL length. 1263 * 1264 * @example 1265 * ```js 1266 * const displayUrl = filterURLForDisplay( 'https://www.wordpress.org/gutenberg/' ); // wordpress.org/gutenberg 1267 * const imageUrl = filterURLForDisplay( 'https://www.wordpress.org/wp-content/uploads/img.png', 20 ); // …ent/uploads/img.png 1268 * ``` 1269 * 1270 * @return {string} Displayed URL. 1271 */ 1272 function filterURLForDisplay(url, maxLength = null) { 1273 if (!url) { 1274 return ''; 1275 } 1276 1277 // Remove protocol and www prefixes. 1278 let filteredURL = url.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i, '').replace(/^www\./i, ''); 1279 1280 // Ends with / and only has that single slash, strip it. 1281 if (filteredURL.match(/^[^\/]+\/$/)) { 1282 filteredURL = filteredURL.replace('/', ''); 1283 } 1284 1285 // capture file name from URL 1286 const fileRegexp = /\/([^\/?]+)\.(?:[\w]+)(?=\?|$)/; 1287 if (!maxLength || filteredURL.length <= maxLength || !filteredURL.match(fileRegexp)) { 1288 return filteredURL; 1289 } 1290 1291 // If the file is not greater than max length, return last portion of URL. 1292 filteredURL = filteredURL.split('?')[0]; 1293 const urlPieces = filteredURL.split('/'); 1294 const file = urlPieces[urlPieces.length - 1]; 1295 if (file.length <= maxLength) { 1296 return '…' + filteredURL.slice(-maxLength); 1297 } 1298 1299 // If the file is greater than max length, truncate the file. 1300 const index = file.lastIndexOf('.'); 1301 const [fileName, extension] = [file.slice(0, index), file.slice(index + 1)]; 1302 const truncatedFile = fileName.slice(-3) + '.' + extension; 1303 return file.slice(0, maxLength - truncatedFile.length - 1) + '…' + truncatedFile; 1304 } 1305 1306 // EXTERNAL MODULE: ./node_modules/remove-accents/index.js 1307 var remove_accents = __webpack_require__(9681); 1308 var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents); 1309 ;// ./node_modules/@wordpress/url/build-module/clean-for-slug.js 1310 /** 1311 * External dependencies 1312 */ 1313 1314 1315 /** 1316 * Performs some basic cleanup of a string for use as a post slug. 1317 * 1318 * This replicates some of what `sanitize_title()` does in WordPress core, but 1319 * is only designed to approximate what the slug will be. 1320 * 1321 * Converts Latin-1 Supplement and Latin Extended-A letters to basic Latin 1322 * letters. Removes combining diacritical marks. Converts whitespace, periods, 1323 * and forward slashes to hyphens. Removes any remaining non-word characters 1324 * except hyphens. Converts remaining string to lowercase. It does not account 1325 * for octets, HTML entities, or other encoded characters. 1326 * 1327 * @param {string} string Title or slug to be processed. 1328 * 1329 * @return {string} Processed string. 1330 */ 1331 function cleanForSlug(string) { 1332 if (!string) { 1333 return ''; 1334 } 1335 return remove_accents_default()(string) 1336 // Convert each group of whitespace, periods, and forward slashes to a hyphen. 1337 .replace(/[\s\./]+/g, '-') 1338 // Remove anything that's not a letter, number, underscore or hyphen. 1339 .replace(/[^\p{L}\p{N}_-]+/gu, '') 1340 // Convert to lowercase 1341 .toLowerCase() 1342 // Replace multiple hyphens with a single one. 1343 .replace(/-+/g, '-') 1344 // Remove any remaining leading or trailing hyphens. 1345 .replace(/(^-+)|(-+$)/g, ''); 1346 } 1347 1348 ;// ./node_modules/@wordpress/url/build-module/get-filename.js 1349 /* wp:polyfill */ 1350 /** 1351 * Returns the filename part of the URL. 1352 * 1353 * @param {string} url The full URL. 1354 * 1355 * @example 1356 * ```js 1357 * const filename1 = getFilename( 'http://localhost:8080/this/is/a/test.jpg' ); // 'test.jpg' 1358 * const filename2 = getFilename( '/this/is/a/test.png' ); // 'test.png' 1359 * ``` 1360 * 1361 * @return {string|void} The filename part of the URL. 1362 */ 1363 function getFilename(url) { 1364 let filename; 1365 if (!url) { 1366 return; 1367 } 1368 try { 1369 filename = new URL(url, 'http://example.com').pathname.split('/').pop(); 1370 } catch (error) {} 1371 if (filename) { 1372 return filename; 1373 } 1374 } 1375 1376 ;// ./node_modules/@wordpress/url/build-module/normalize-path.js 1377 /* wp:polyfill */ 1378 /** 1379 * Given a path, returns a normalized path where equal query parameter values 1380 * will be treated as identical, regardless of order they appear in the original 1381 * text. 1382 * 1383 * @param {string} path Original path. 1384 * 1385 * @return {string} Normalized path. 1386 */ 1387 function normalizePath(path) { 1388 const split = path.split('?'); 1389 const query = split[1]; 1390 const base = split[0]; 1391 if (!query) { 1392 return base; 1393 } 1394 1395 // 'b=1%2C2&c=2&a=5' 1396 return base + '?' + query 1397 // [ 'b=1%2C2', 'c=2', 'a=5' ] 1398 .split('&') 1399 // [ [ 'b, '1%2C2' ], [ 'c', '2' ], [ 'a', '5' ] ] 1400 .map(entry => entry.split('=')) 1401 // [ [ 'b', '1,2' ], [ 'c', '2' ], [ 'a', '5' ] ] 1402 .map(pair => pair.map(decodeURIComponent)) 1403 // [ [ 'a', '5' ], [ 'b, '1,2' ], [ 'c', '2' ] ] 1404 .sort((a, b) => a[0].localeCompare(b[0])) 1405 // [ [ 'a', '5' ], [ 'b, '1%2C2' ], [ 'c', '2' ] ] 1406 .map(pair => pair.map(encodeURIComponent)) 1407 // [ 'a=5', 'b=1%2C2', 'c=2' ] 1408 .map(pair => pair.join('=')) 1409 // 'a=5&b=1%2C2&c=2' 1410 .join('&'); 1411 } 1412 1413 ;// ./node_modules/@wordpress/url/build-module/prepend-https.js 1414 /** 1415 * Internal dependencies 1416 */ 1417 1418 1419 /** 1420 * Prepends "https://" to a url, if it looks like something that is meant to be a TLD. 1421 * 1422 * Note: this will not replace "http://" with "https://". 1423 * 1424 * @param {string} url The URL to test. 1425 * 1426 * @example 1427 * ```js 1428 * const actualURL = prependHTTPS( 'wordpress.org' ); // https://wordpress.org 1429 * ``` 1430 * 1431 * @return {string} The updated URL. 1432 */ 1433 function prependHTTPS(url) { 1434 if (!url) { 1435 return url; 1436 } 1437 1438 // If url starts with http://, return it as is. 1439 if (url.startsWith('http://')) { 1440 return url; 1441 } 1442 url = prependHTTP(url); 1443 return url.replace(/^http:/, 'https:'); 1444 } 1445 1446 ;// ./node_modules/@wordpress/url/build-module/index.js 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 })(); 1477 1478 (window.wp = window.wp || {}).url = __webpack_exports__; 1479 /******/ })() 1480 ;
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated : Sat Feb 22 08:20:01 2025 | Cross-referenced by PHPXref |