[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 this["wp"] = this["wp"] || {}; this["wp"]["blockLibrary"] = 2 /******/ (function(modules) { // webpackBootstrap 3 /******/ // The module cache 4 /******/ var installedModules = {}; 5 /******/ 6 /******/ // The require function 7 /******/ function __webpack_require__(moduleId) { 8 /******/ 9 /******/ // Check if module is in cache 10 /******/ if(installedModules[moduleId]) { 11 /******/ return installedModules[moduleId].exports; 12 /******/ } 13 /******/ // Create a new module (and put it into the cache) 14 /******/ var module = installedModules[moduleId] = { 15 /******/ i: moduleId, 16 /******/ l: false, 17 /******/ exports: {} 18 /******/ }; 19 /******/ 20 /******/ // Execute the module function 21 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 22 /******/ 23 /******/ // Flag the module as loaded 24 /******/ module.l = true; 25 /******/ 26 /******/ // Return the exports of the module 27 /******/ return module.exports; 28 /******/ } 29 /******/ 30 /******/ 31 /******/ // expose the modules object (__webpack_modules__) 32 /******/ __webpack_require__.m = modules; 33 /******/ 34 /******/ // expose the module cache 35 /******/ __webpack_require__.c = installedModules; 36 /******/ 37 /******/ // define getter function for harmony exports 38 /******/ __webpack_require__.d = function(exports, name, getter) { 39 /******/ if(!__webpack_require__.o(exports, name)) { 40 /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 41 /******/ } 42 /******/ }; 43 /******/ 44 /******/ // define __esModule on exports 45 /******/ __webpack_require__.r = function(exports) { 46 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 47 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 48 /******/ } 49 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 50 /******/ }; 51 /******/ 52 /******/ // create a fake namespace object 53 /******/ // mode & 1: value is a module id, require it 54 /******/ // mode & 2: merge all properties of value into the ns 55 /******/ // mode & 4: return value when already ns object 56 /******/ // mode & 8|1: behave like require 57 /******/ __webpack_require__.t = function(value, mode) { 58 /******/ if(mode & 1) value = __webpack_require__(value); 59 /******/ if(mode & 8) return value; 60 /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 61 /******/ var ns = Object.create(null); 62 /******/ __webpack_require__.r(ns); 63 /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 64 /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 65 /******/ return ns; 66 /******/ }; 67 /******/ 68 /******/ // getDefaultExport function for compatibility with non-harmony modules 69 /******/ __webpack_require__.n = function(module) { 70 /******/ var getter = module && module.__esModule ? 71 /******/ function getDefault() { return module['default']; } : 72 /******/ function getModuleExports() { return module; }; 73 /******/ __webpack_require__.d(getter, 'a', getter); 74 /******/ return getter; 75 /******/ }; 76 /******/ 77 /******/ // Object.prototype.hasOwnProperty.call 78 /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 79 /******/ 80 /******/ // __webpack_public_path__ 81 /******/ __webpack_require__.p = ""; 82 /******/ 83 /******/ 84 /******/ // Load entry module and return exports 85 /******/ return __webpack_require__(__webpack_require__.s = 459); 86 /******/ }) 87 /************************************************************************/ 88 /******/ ({ 89 90 /***/ 0: 91 /***/ (function(module, exports) { 92 93 (function() { module.exports = this["wp"]["element"]; }()); 94 95 /***/ }), 96 97 /***/ 1: 98 /***/ (function(module, exports) { 99 100 (function() { module.exports = this["wp"]["i18n"]; }()); 101 102 /***/ }), 103 104 /***/ 10: 105 /***/ (function(module, exports) { 106 107 (function() { module.exports = this["wp"]["compose"]; }()); 108 109 /***/ }), 110 111 /***/ 101: 112 /***/ (function(module, exports) { 113 114 (function() { module.exports = this["wp"]["viewport"]; }()); 115 116 /***/ }), 117 118 /***/ 106: 119 /***/ (function(module, exports) { 120 121 (function() { module.exports = this["wp"]["autop"]; }()); 122 123 /***/ }), 124 125 /***/ 11: 126 /***/ (function(module, exports) { 127 128 (function() { module.exports = this["wp"]["blocks"]; }()); 129 130 /***/ }), 131 132 /***/ 117: 133 /***/ (function(module, exports, __webpack_require__) { 134 135 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 136 Copyright (c) 2017 Jed Watson. 137 Licensed under the MIT License (MIT), see 138 http://jedwatson.github.io/classnames 139 */ 140 /* global define */ 141 142 (function () { 143 'use strict'; 144 145 var classNames = (function () { 146 // don't inherit from Object so we can skip hasOwnProperty check later 147 // http://stackoverflow.com/questions/15518328/creating-js-object-with-object-createnull#answer-21079232 148 function StorageObject() {} 149 StorageObject.prototype = Object.create(null); 150 151 function _parseArray (resultSet, array) { 152 var length = array.length; 153 154 for (var i = 0; i < length; ++i) { 155 _parse(resultSet, array[i]); 156 } 157 } 158 159 var hasOwn = {}.hasOwnProperty; 160 161 function _parseNumber (resultSet, num) { 162 resultSet[num] = true; 163 } 164 165 function _parseObject (resultSet, object) { 166 for (var k in object) { 167 if (hasOwn.call(object, k)) { 168 // set value to false instead of deleting it to avoid changing object structure 169 // https://www.smashingmagazine.com/2012/11/writing-fast-memory-efficient-javascript/#de-referencing-misconceptions 170 resultSet[k] = !!object[k]; 171 } 172 } 173 } 174 175 var SPACE = /\s+/; 176 function _parseString (resultSet, str) { 177 var array = str.split(SPACE); 178 var length = array.length; 179 180 for (var i = 0; i < length; ++i) { 181 resultSet[array[i]] = true; 182 } 183 } 184 185 function _parse (resultSet, arg) { 186 if (!arg) return; 187 var argType = typeof arg; 188 189 // 'foo bar' 190 if (argType === 'string') { 191 _parseString(resultSet, arg); 192 193 // ['foo', 'bar', ...] 194 } else if (Array.isArray(arg)) { 195 _parseArray(resultSet, arg); 196 197 // { 'foo': true, ... } 198 } else if (argType === 'object') { 199 _parseObject(resultSet, arg); 200 201 // '130' 202 } else if (argType === 'number') { 203 _parseNumber(resultSet, arg); 204 } 205 } 206 207 function _classNames () { 208 // don't leak arguments 209 // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments 210 var len = arguments.length; 211 var args = Array(len); 212 for (var i = 0; i < len; i++) { 213 args[i] = arguments[i]; 214 } 215 216 var classSet = new StorageObject(); 217 _parseArray(classSet, args); 218 219 var list = []; 220 221 for (var k in classSet) { 222 if (classSet[k]) { 223 list.push(k) 224 } 225 } 226 227 return list.join(' '); 228 } 229 230 return _classNames; 231 })(); 232 233 if ( true && module.exports) { 234 classNames.default = classNames; 235 module.exports = classNames; 236 } else if (true) { 237 // register as 'classnames', consistent with npm package name 238 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { 239 return classNames; 240 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 241 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 242 } else {} 243 }()); 244 245 246 /***/ }), 247 248 /***/ 12: 249 /***/ (function(module, __webpack_exports__, __webpack_require__) { 250 251 "use strict"; 252 253 // EXPORTS 254 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; }); 255 256 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js 257 var arrayWithHoles = __webpack_require__(38); 258 259 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js 260 function _iterableToArrayLimit(arr, i) { 261 if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; 262 var _arr = []; 263 var _n = true; 264 var _d = false; 265 var _e = undefined; 266 267 try { 268 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { 269 _arr.push(_s.value); 270 271 if (i && _arr.length === i) break; 272 } 273 } catch (err) { 274 _d = true; 275 _e = err; 276 } finally { 277 try { 278 if (!_n && _i["return"] != null) _i["return"](); 279 } finally { 280 if (_d) throw _e; 281 } 282 } 283 284 return _arr; 285 } 286 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js 287 var unsupportedIterableToArray = __webpack_require__(31); 288 289 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js 290 var nonIterableRest = __webpack_require__(39); 291 292 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js 293 294 295 296 297 function _slicedToArray(arr, i) { 298 return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])(); 299 } 300 301 /***/ }), 302 303 /***/ 121: 304 /***/ (function(module, exports) { 305 306 (function() { module.exports = this["wp"]["reusableBlocks"]; }()); 307 308 /***/ }), 309 310 /***/ 13: 311 /***/ (function(module, exports) { 312 313 (function() { module.exports = this["React"]; }()); 314 315 /***/ }), 316 317 /***/ 14: 318 /***/ (function(module, __webpack_exports__, __webpack_require__) { 319 320 "use strict"; 321 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; }); 322 /* harmony import */ var _objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(43); 323 324 function _objectWithoutProperties(source, excluded) { 325 if (source == null) return {}; 326 var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(source, excluded); 327 var key, i; 328 329 if (Object.getOwnPropertySymbols) { 330 var sourceSymbolKeys = Object.getOwnPropertySymbols(source); 331 332 for (i = 0; i < sourceSymbolKeys.length; i++) { 333 key = sourceSymbolKeys[i]; 334 if (excluded.indexOf(key) >= 0) continue; 335 if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; 336 target[key] = source[key]; 337 } 338 } 339 340 return target; 341 } 342 343 /***/ }), 344 345 /***/ 141: 346 /***/ (function(module, __webpack_exports__, __webpack_require__) { 347 348 "use strict"; 349 /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5); 350 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); 351 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0); 352 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); 353 354 355 356 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } 357 358 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 359 360 /** 361 * WordPress dependencies 362 */ 363 364 /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ 365 366 /** 367 * Return an SVG icon. 368 * 369 * @param {IconProps} props icon is the SVG component to render 370 * size is a number specifiying the icon size in pixels 371 * Other props will be passed to wrapped SVG component 372 * 373 * @return {JSX.Element} Icon component 374 */ 375 376 function Icon(_ref) { 377 var icon = _ref.icon, 378 _ref$size = _ref.size, 379 size = _ref$size === void 0 ? 24 : _ref$size, 380 props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["icon", "size"]); 381 382 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["cloneElement"])(icon, _objectSpread({ 383 width: size, 384 height: size 385 }, props)); 386 } 387 388 /* harmony default export */ __webpack_exports__["a"] = (Icon); 389 390 391 /***/ }), 392 393 /***/ 159: 394 /***/ (function(module, __webpack_exports__, __webpack_require__) { 395 396 "use strict"; 397 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 398 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 399 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 400 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 401 402 403 /** 404 * WordPress dependencies 405 */ 406 407 var closeSmall = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 408 xmlns: "http://www.w3.org/2000/svg", 409 viewBox: "0 0 24 24" 410 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 411 d: "M13 11.9l3.3-3.4-1.1-1-3.2 3.3-3.2-3.3-1.1 1 3.3 3.4-3.5 3.6 1 1L12 13l3.5 3.5 1-1z" 412 })); 413 /* harmony default export */ __webpack_exports__["a"] = (closeSmall); 414 415 416 /***/ }), 417 418 /***/ 16: 419 /***/ (function(module, __webpack_exports__, __webpack_require__) { 420 421 "use strict"; 422 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; }); 423 function _assertThisInitialized(self) { 424 if (self === void 0) { 425 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 426 } 427 428 return self; 429 } 430 431 /***/ }), 432 433 /***/ 161: 434 /***/ (function(module, __webpack_exports__, __webpack_require__) { 435 436 "use strict"; 437 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 438 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 439 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 440 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 441 442 443 /** 444 * WordPress dependencies 445 */ 446 447 var check = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 448 xmlns: "http://www.w3.org/2000/svg", 449 viewBox: "0 0 24 24" 450 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 451 d: "M18.3 5.6L9.9 16.9l-4.6-3.4-.9 1.2 5.8 4.3 9.3-12.6z" 452 })); 453 /* harmony default export */ __webpack_exports__["a"] = (check); 454 455 456 /***/ }), 457 458 /***/ 17: 459 /***/ (function(module, __webpack_exports__, __webpack_require__) { 460 461 "use strict"; 462 463 // EXPORTS 464 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; }); 465 466 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js 467 var arrayLikeToArray = __webpack_require__(27); 468 469 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js 470 471 function _arrayWithoutHoles(arr) { 472 if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr); 473 } 474 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js 475 var iterableToArray = __webpack_require__(37); 476 477 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js 478 var unsupportedIterableToArray = __webpack_require__(31); 479 480 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js 481 function _nonIterableSpread() { 482 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 483 } 484 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js 485 486 487 488 489 function _toConsumableArray(arr) { 490 return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread(); 491 } 492 493 /***/ }), 494 495 /***/ 18: 496 /***/ (function(module, exports) { 497 498 (function() { module.exports = this["wp"]["keycodes"]; }()); 499 500 /***/ }), 501 502 /***/ 186: 503 /***/ (function(module, __webpack_exports__, __webpack_require__) { 504 505 "use strict"; 506 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 507 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 508 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 509 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 510 511 512 /** 513 * WordPress dependencies 514 */ 515 516 var link = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 517 xmlns: "http://www.w3.org/2000/svg", 518 viewBox: "0 0 24 24" 519 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 520 d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z" 521 })); 522 /* harmony default export */ __webpack_exports__["a"] = (link); 523 524 525 /***/ }), 526 527 /***/ 19: 528 /***/ (function(module, __webpack_exports__, __webpack_require__) { 529 530 "use strict"; 531 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; }); 532 function _getPrototypeOf(o) { 533 _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { 534 return o.__proto__ || Object.getPrototypeOf(o); 535 }; 536 return _getPrototypeOf(o); 537 } 538 539 /***/ }), 540 541 /***/ 2: 542 /***/ (function(module, exports) { 543 544 (function() { module.exports = this["lodash"]; }()); 545 546 /***/ }), 547 548 /***/ 20: 549 /***/ (function(module, exports) { 550 551 (function() { module.exports = this["regeneratorRuntime"]; }()); 552 553 /***/ }), 554 555 /***/ 21: 556 /***/ (function(module, __webpack_exports__, __webpack_require__) { 557 558 "use strict"; 559 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; }); 560 function _classCallCheck(instance, Constructor) { 561 if (!(instance instanceof Constructor)) { 562 throw new TypeError("Cannot call a class as a function"); 563 } 564 } 565 566 /***/ }), 567 568 /***/ 214: 569 /***/ (function(module, __webpack_exports__, __webpack_require__) { 570 571 "use strict"; 572 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 573 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 574 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 575 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 576 577 578 /** 579 * WordPress dependencies 580 */ 581 582 var chevronRight = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 583 xmlns: "http://www.w3.org/2000/svg", 584 viewBox: "0 0 24 24" 585 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 586 d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" 587 })); 588 /* harmony default export */ __webpack_exports__["a"] = (chevronRight); 589 590 591 /***/ }), 592 593 /***/ 215: 594 /***/ (function(module, __webpack_exports__, __webpack_require__) { 595 596 "use strict"; 597 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 598 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 599 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 600 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 601 602 603 /** 604 * WordPress dependencies 605 */ 606 607 var chevronLeft = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 608 xmlns: "http://www.w3.org/2000/svg", 609 viewBox: "0 0 24 24" 610 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 611 d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" 612 })); 613 /* harmony default export */ __webpack_exports__["a"] = (chevronLeft); 614 615 616 /***/ }), 617 618 /***/ 216: 619 /***/ (function(module, __webpack_exports__, __webpack_require__) { 620 621 "use strict"; 622 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 623 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 624 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 625 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 626 627 628 /** 629 * WordPress dependencies 630 */ 631 632 var keyboardReturn = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 633 xmlns: "http://www.w3.org/2000/svg", 634 viewBox: "-2 -2 24 24" 635 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 636 d: "M16 4h2v9H7v3l-5-4 5-4v3h9V4z" 637 })); 638 /* harmony default export */ __webpack_exports__["a"] = (keyboardReturn); 639 640 641 /***/ }), 642 643 /***/ 217: 644 /***/ (function(module, __webpack_exports__, __webpack_require__) { 645 646 "use strict"; 647 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 648 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 649 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 650 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 651 652 653 /** 654 * WordPress dependencies 655 */ 656 657 var upload = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 658 xmlns: "http://www.w3.org/2000/svg", 659 viewBox: "0 0 24 24" 660 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 661 d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z" 662 })); 663 /* harmony default export */ __webpack_exports__["a"] = (upload); 664 665 666 /***/ }), 667 668 /***/ 218: 669 /***/ (function(module, __webpack_exports__, __webpack_require__) { 670 671 "use strict"; 672 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 673 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 674 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 675 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 676 677 678 /** 679 * WordPress dependencies 680 */ 681 682 var linkOff = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 683 xmlns: "http://www.w3.org/2000/svg", 684 viewBox: "0 0 24 24" 685 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 686 d: "M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z" 687 })); 688 /* harmony default export */ __webpack_exports__["a"] = (linkOff); 689 690 691 /***/ }), 692 693 /***/ 22: 694 /***/ (function(module, __webpack_exports__, __webpack_require__) { 695 696 "use strict"; 697 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; }); 698 function _defineProperties(target, props) { 699 for (var i = 0; i < props.length; i++) { 700 var descriptor = props[i]; 701 descriptor.enumerable = descriptor.enumerable || false; 702 descriptor.configurable = true; 703 if ("value" in descriptor) descriptor.writable = true; 704 Object.defineProperty(target, descriptor.key, descriptor); 705 } 706 } 707 708 function _createClass(Constructor, protoProps, staticProps) { 709 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 710 if (staticProps) _defineProperties(Constructor, staticProps); 711 return Constructor; 712 } 713 714 /***/ }), 715 716 /***/ 23: 717 /***/ (function(module, __webpack_exports__, __webpack_require__) { 718 719 "use strict"; 720 721 // EXPORTS 722 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _inherits; }); 723 724 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js 725 function _setPrototypeOf(o, p) { 726 _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { 727 o.__proto__ = p; 728 return o; 729 }; 730 731 return _setPrototypeOf(o, p); 732 } 733 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js 734 735 function _inherits(subClass, superClass) { 736 if (typeof superClass !== "function" && superClass !== null) { 737 throw new TypeError("Super expression must either be null or a function"); 738 } 739 740 subClass.prototype = Object.create(superClass && superClass.prototype, { 741 constructor: { 742 value: subClass, 743 writable: true, 744 configurable: true 745 } 746 }); 747 if (superClass) _setPrototypeOf(subClass, superClass); 748 } 749 750 /***/ }), 751 752 /***/ 24: 753 /***/ (function(module, __webpack_exports__, __webpack_require__) { 754 755 "use strict"; 756 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; }); 757 /* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40); 758 /* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); 759 760 761 function _possibleConstructorReturn(self, call) { 762 if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) { 763 return call; 764 } 765 766 return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self); 767 } 768 769 /***/ }), 770 771 /***/ 25: 772 /***/ (function(module, exports) { 773 774 (function() { module.exports = this["wp"]["richText"]; }()); 775 776 /***/ }), 777 778 /***/ 27: 779 /***/ (function(module, __webpack_exports__, __webpack_require__) { 780 781 "use strict"; 782 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; }); 783 function _arrayLikeToArray(arr, len) { 784 if (len == null || len > arr.length) len = arr.length; 785 786 for (var i = 0, arr2 = new Array(len); i < len; i++) { 787 arr2[i] = arr[i]; 788 } 789 790 return arr2; 791 } 792 793 /***/ }), 794 795 /***/ 274: 796 /***/ (function(module, __webpack_exports__, __webpack_require__) { 797 798 "use strict"; 799 800 // EXTERNAL MODULE: external {"this":["wp","element"]} 801 var external_this_wp_element_ = __webpack_require__(0); 802 803 // EXTERNAL MODULE: external {"this":["wp","primitives"]} 804 var external_this_wp_primitives_ = __webpack_require__(7); 805 806 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js 807 808 809 /** 810 * WordPress dependencies 811 */ 812 813 var pencil = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], { 814 xmlns: "http://www.w3.org/2000/svg", 815 viewBox: "0 0 24 24" 816 }, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], { 817 d: "M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z" 818 })); 819 /* harmony default export */ var library_pencil = (pencil); 820 821 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js 822 /** 823 * Internal dependencies 824 */ 825 826 /* harmony default export */ var edit = __webpack_exports__["a"] = (library_pencil); 827 828 829 /***/ }), 830 831 /***/ 282: 832 /***/ (function(module, exports, __webpack_require__) { 833 834 module.exports = __webpack_require__(321); 835 836 837 /***/ }), 838 839 /***/ 283: 840 /***/ (function(module, exports, __webpack_require__) { 841 842 /*! Fast Average Color | © 2019 Denis Seleznev | MIT License | https://github.com/hcodes/fast-average-color/ */ 843 (function (global, factory) { 844 true ? module.exports = factory() : 845 undefined; 846 }(this, (function () { 'use strict'; 847 848 function _classCallCheck(instance, Constructor) { 849 if (!(instance instanceof Constructor)) { 850 throw new TypeError("Cannot call a class as a function"); 851 } 852 } 853 854 function _defineProperties(target, props) { 855 for (var i = 0; i < props.length; i++) { 856 var descriptor = props[i]; 857 descriptor.enumerable = descriptor.enumerable || false; 858 descriptor.configurable = true; 859 if ("value" in descriptor) descriptor.writable = true; 860 Object.defineProperty(target, descriptor.key, descriptor); 861 } 862 } 863 864 function _createClass(Constructor, protoProps, staticProps) { 865 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 866 if (staticProps) _defineProperties(Constructor, staticProps); 867 return Constructor; 868 } 869 870 function _slicedToArray(arr, i) { 871 return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); 872 } 873 874 function _arrayWithHoles(arr) { 875 if (Array.isArray(arr)) return arr; 876 } 877 878 function _iterableToArrayLimit(arr, i) { 879 var _arr = []; 880 var _n = true; 881 var _d = false; 882 var _e = undefined; 883 884 try { 885 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { 886 _arr.push(_s.value); 887 888 if (i && _arr.length === i) break; 889 } 890 } catch (err) { 891 _d = true; 892 _e = err; 893 } finally { 894 try { 895 if (!_n && _i["return"] != null) _i["return"](); 896 } finally { 897 if (_d) throw _e; 898 } 899 } 900 901 return _arr; 902 } 903 904 function _nonIterableRest() { 905 throw new TypeError("Invalid attempt to destructure non-iterable instance"); 906 } 907 908 var FastAverageColor = 909 /*#__PURE__*/ 910 function () { 911 function FastAverageColor() { 912 _classCallCheck(this, FastAverageColor); 913 } 914 915 _createClass(FastAverageColor, [{ 916 key: "getColorAsync", 917 918 /** 919 * Get asynchronously the average color from not loaded image. 920 * 921 * @param {HTMLImageElement} resource 922 * @param {Function} callback 923 * @param {Object|null} [options] 924 * @param {Array} [options.defaultColor=[255, 255, 255, 255]] 925 * @param {*} [options.data] 926 * @param {string} [options.mode="speed"] "precision" or "speed" 927 * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant" 928 * @param {number} [options.step=1] 929 * @param {number} [options.left=0] 930 * @param {number} [options.top=0] 931 * @param {number} [options.width=width of resource] 932 * @param {number} [options.height=height of resource] 933 */ 934 value: function getColorAsync(resource, callback, options) { 935 if (resource.complete) { 936 callback.call(resource, this.getColor(resource, options), options && options.data); 937 } else { 938 this._bindImageEvents(resource, callback, options); 939 } 940 } 941 /** 942 * Get the average color from images, videos and canvas. 943 * 944 * @param {HTMLImageElement|HTMLVideoElement|HTMLCanvasElement} resource 945 * @param {Object|null} [options] 946 * @param {Array} [options.defaultColor=[255, 255, 255, 255]] 947 * @param {*} [options.data] 948 * @param {string} [options.mode="speed"] "precision" or "speed" 949 * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant" 950 * @param {number} [options.step=1] 951 * @param {number} [options.left=0] 952 * @param {number} [options.top=0] 953 * @param {number} [options.width=width of resource] 954 * @param {number} [options.height=height of resource] 955 * 956 * @returns {Object} 957 */ 958 959 }, { 960 key: "getColor", 961 value: function getColor(resource, options) { 962 options = options || {}; 963 964 var defaultColor = this._getDefaultColor(options), 965 originalSize = this._getOriginalSize(resource), 966 size = this._prepareSizeAndPosition(originalSize, options); 967 968 var error = null, 969 value = defaultColor; 970 971 if (!size.srcWidth || !size.srcHeight || !size.destWidth || !size.destHeight) { 972 return this._prepareResult(defaultColor, new Error('FastAverageColor: Incorrect sizes.')); 973 } 974 975 if (!this._ctx) { 976 this._canvas = this._makeCanvas(); 977 this._ctx = this._canvas.getContext && this._canvas.getContext('2d'); 978 979 if (!this._ctx) { 980 return this._prepareResult(defaultColor, new Error('FastAverageColor: Canvas Context 2D is not supported in this browser.')); 981 } 982 } 983 984 this._canvas.width = size.destWidth; 985 this._canvas.height = size.destHeight; 986 987 try { 988 this._ctx.clearRect(0, 0, size.destWidth, size.destHeight); 989 990 this._ctx.drawImage(resource, size.srcLeft, size.srcTop, size.srcWidth, size.srcHeight, 0, 0, size.destWidth, size.destHeight); 991 992 var bitmapData = this._ctx.getImageData(0, 0, size.destWidth, size.destHeight).data; 993 994 value = this.getColorFromArray4(bitmapData, options); 995 } catch (e) { 996 // Security error, CORS 997 // https://developer.mozilla.org/en/docs/Web/HTML/CORS_enabled_image 998 error = e; 999 } 1000 1001 return this._prepareResult(value, error); 1002 } 1003 /** 1004 * Get the average color from a array when 1 pixel is 4 bytes. 1005 * 1006 * @param {Array|Uint8Array} arr 1007 * @param {Object} [options] 1008 * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant" 1009 * @param {Array} [options.defaultColor=[255, 255, 255, 255]] 1010 * @param {number} [options.step=1] 1011 * 1012 * @returns {Array} [red (0-255), green (0-255), blue (0-255), alpha (0-255)] 1013 */ 1014 1015 }, { 1016 key: "getColorFromArray4", 1017 value: function getColorFromArray4(arr, options) { 1018 options = options || {}; 1019 var bytesPerPixel = 4, 1020 arrLength = arr.length; 1021 1022 if (arrLength < bytesPerPixel) { 1023 return this._getDefaultColor(options); 1024 } 1025 1026 var len = arrLength - arrLength % bytesPerPixel, 1027 preparedStep = (options.step || 1) * bytesPerPixel, 1028 algorithm = '_' + (options.algorithm || 'sqrt') + 'Algorithm'; 1029 1030 if (typeof this[algorithm] !== 'function') { 1031 throw new Error("FastAverageColor: ".concat(options.algorithm, " is unknown algorithm.")); 1032 } 1033 1034 return this[algorithm](arr, len, preparedStep); 1035 } 1036 /** 1037 * Destroy the instance. 1038 */ 1039 1040 }, { 1041 key: "destroy", 1042 value: function destroy() { 1043 delete this._canvas; 1044 delete this._ctx; 1045 } 1046 }, { 1047 key: "_getDefaultColor", 1048 value: function _getDefaultColor(options) { 1049 return this._getOption(options, 'defaultColor', [255, 255, 255, 255]); 1050 } 1051 }, { 1052 key: "_getOption", 1053 value: function _getOption(options, name, defaultValue) { 1054 return typeof options[name] === 'undefined' ? defaultValue : options[name]; 1055 } 1056 }, { 1057 key: "_prepareSizeAndPosition", 1058 value: function _prepareSizeAndPosition(originalSize, options) { 1059 var srcLeft = this._getOption(options, 'left', 0), 1060 srcTop = this._getOption(options, 'top', 0), 1061 srcWidth = this._getOption(options, 'width', originalSize.width), 1062 srcHeight = this._getOption(options, 'height', originalSize.height), 1063 destWidth = srcWidth, 1064 destHeight = srcHeight; 1065 1066 if (options.mode === 'precision') { 1067 return { 1068 srcLeft: srcLeft, 1069 srcTop: srcTop, 1070 srcWidth: srcWidth, 1071 srcHeight: srcHeight, 1072 destWidth: destWidth, 1073 destHeight: destHeight 1074 }; 1075 } 1076 1077 var maxSize = 100, 1078 minSize = 10; 1079 var factor; 1080 1081 if (srcWidth > srcHeight) { 1082 factor = srcWidth / srcHeight; 1083 destWidth = maxSize; 1084 destHeight = Math.round(destWidth / factor); 1085 } else { 1086 factor = srcHeight / srcWidth; 1087 destHeight = maxSize; 1088 destWidth = Math.round(destHeight / factor); 1089 } 1090 1091 if (destWidth > srcWidth || destHeight > srcHeight || destWidth < minSize || destHeight < minSize) { 1092 destWidth = srcWidth; 1093 destHeight = srcHeight; 1094 } 1095 1096 return { 1097 srcLeft: srcLeft, 1098 srcTop: srcTop, 1099 srcWidth: srcWidth, 1100 srcHeight: srcHeight, 1101 destWidth: destWidth, 1102 destHeight: destHeight 1103 }; 1104 } 1105 }, { 1106 key: "_simpleAlgorithm", 1107 value: function _simpleAlgorithm(arr, len, preparedStep) { 1108 var redTotal = 0, 1109 greenTotal = 0, 1110 blueTotal = 0, 1111 alphaTotal = 0, 1112 count = 0; 1113 1114 for (var i = 0; i < len; i += preparedStep) { 1115 var alpha = arr[i + 3], 1116 red = arr[i] * alpha, 1117 green = arr[i + 1] * alpha, 1118 blue = arr[i + 2] * alpha; 1119 redTotal += red; 1120 greenTotal += green; 1121 blueTotal += blue; 1122 alphaTotal += alpha; 1123 count++; 1124 } 1125 1126 return alphaTotal ? [Math.round(redTotal / alphaTotal), Math.round(greenTotal / alphaTotal), Math.round(blueTotal / alphaTotal), Math.round(alphaTotal / count)] : [0, 0, 0, 0]; 1127 } 1128 }, { 1129 key: "_sqrtAlgorithm", 1130 value: function _sqrtAlgorithm(arr, len, preparedStep) { 1131 var redTotal = 0, 1132 greenTotal = 0, 1133 blueTotal = 0, 1134 alphaTotal = 0, 1135 count = 0; 1136 1137 for (var i = 0; i < len; i += preparedStep) { 1138 var red = arr[i], 1139 green = arr[i + 1], 1140 blue = arr[i + 2], 1141 alpha = arr[i + 3]; 1142 redTotal += red * red * alpha; 1143 greenTotal += green * green * alpha; 1144 blueTotal += blue * blue * alpha; 1145 alphaTotal += alpha; 1146 count++; 1147 } 1148 1149 return alphaTotal ? [Math.round(Math.sqrt(redTotal / alphaTotal)), Math.round(Math.sqrt(greenTotal / alphaTotal)), Math.round(Math.sqrt(blueTotal / alphaTotal)), Math.round(alphaTotal / count)] : [0, 0, 0, 0]; 1150 } 1151 }, { 1152 key: "_dominantAlgorithm", 1153 value: function _dominantAlgorithm(arr, len, preparedStep) { 1154 var colorHash = {}, 1155 divider = 24; 1156 1157 for (var i = 0; i < len; i += preparedStep) { 1158 var red = arr[i], 1159 green = arr[i + 1], 1160 blue = arr[i + 2], 1161 alpha = arr[i + 3], 1162 key = Math.round(red / divider) + ',' + Math.round(green / divider) + ',' + Math.round(blue / divider); 1163 1164 if (colorHash[key]) { 1165 colorHash[key] = [colorHash[key][0] + red * alpha, colorHash[key][1] + green * alpha, colorHash[key][2] + blue * alpha, colorHash[key][3] + alpha, colorHash[key][4] + 1]; 1166 } else { 1167 colorHash[key] = [red * alpha, green * alpha, blue * alpha, alpha, 1]; 1168 } 1169 } 1170 1171 var buffer = Object.keys(colorHash).map(function (key) { 1172 return colorHash[key]; 1173 }).sort(function (a, b) { 1174 var countA = a[4], 1175 countB = b[4]; 1176 return countA > countB ? -1 : countA === countB ? 0 : 1; 1177 }); 1178 1179 var _buffer$ = _slicedToArray(buffer[0], 5), 1180 redTotal = _buffer$[0], 1181 greenTotal = _buffer$[1], 1182 blueTotal = _buffer$[2], 1183 alphaTotal = _buffer$[3], 1184 count = _buffer$[4]; 1185 1186 return alphaTotal ? [Math.round(redTotal / alphaTotal), Math.round(greenTotal / alphaTotal), Math.round(blueTotal / alphaTotal), Math.round(alphaTotal / count)] : [0, 0, 0, 0]; 1187 } 1188 }, { 1189 key: "_bindImageEvents", 1190 value: function _bindImageEvents(resource, callback, options) { 1191 var _this = this; 1192 1193 options = options || {}; 1194 1195 var data = options && options.data, 1196 defaultColor = this._getDefaultColor(options), 1197 onload = function onload() { 1198 unbindEvents(); 1199 callback.call(resource, _this.getColor(resource, options), data); 1200 }, 1201 onerror = function onerror() { 1202 unbindEvents(); 1203 callback.call(resource, _this._prepareResult(defaultColor, new Error('Image error')), data); 1204 }, 1205 onabort = function onabort() { 1206 unbindEvents(); 1207 callback.call(resource, _this._prepareResult(defaultColor, new Error('Image abort')), data); 1208 }, 1209 unbindEvents = function unbindEvents() { 1210 resource.removeEventListener('load', onload); 1211 resource.removeEventListener('error', onerror); 1212 resource.removeEventListener('abort', onabort); 1213 }; 1214 1215 resource.addEventListener('load', onload); 1216 resource.addEventListener('error', onerror); 1217 resource.addEventListener('abort', onabort); 1218 } 1219 }, { 1220 key: "_prepareResult", 1221 value: function _prepareResult(value, error) { 1222 var rgb = value.slice(0, 3), 1223 rgba = [].concat(rgb, value[3] / 255), 1224 isDark = this._isDark(value); 1225 1226 return { 1227 error: error, 1228 value: value, 1229 rgb: 'rgb(' + rgb.join(',') + ')', 1230 rgba: 'rgba(' + rgba.join(',') + ')', 1231 hex: this._arrayToHex(rgb), 1232 hexa: this._arrayToHex(value), 1233 isDark: isDark, 1234 isLight: !isDark 1235 }; 1236 } 1237 }, { 1238 key: "_getOriginalSize", 1239 value: function _getOriginalSize(resource) { 1240 if (resource instanceof HTMLImageElement) { 1241 return { 1242 width: resource.naturalWidth, 1243 height: resource.naturalHeight 1244 }; 1245 } 1246 1247 if (resource instanceof HTMLVideoElement) { 1248 return { 1249 width: resource.videoWidth, 1250 height: resource.videoHeight 1251 }; 1252 } 1253 1254 return { 1255 width: resource.width, 1256 height: resource.height 1257 }; 1258 } 1259 }, { 1260 key: "_toHex", 1261 value: function _toHex(num) { 1262 var str = num.toString(16); 1263 return str.length === 1 ? '0' + str : str; 1264 } 1265 }, { 1266 key: "_arrayToHex", 1267 value: function _arrayToHex(arr) { 1268 return '#' + arr.map(this._toHex).join(''); 1269 } 1270 }, { 1271 key: "_isDark", 1272 value: function _isDark(color) { 1273 // http://www.w3.org/TR/AERT#color-contrast 1274 var result = (color[0] * 299 + color[1] * 587 + color[2] * 114) / 1000; 1275 return result < 128; 1276 } 1277 }, { 1278 key: "_makeCanvas", 1279 value: function _makeCanvas() { 1280 return typeof window === 'undefined' ? new OffscreenCanvas(1, 1) : document.createElement('canvas'); 1281 } 1282 }]); 1283 1284 return FastAverageColor; 1285 }(); 1286 1287 return FastAverageColor; 1288 1289 }))); 1290 1291 1292 /***/ }), 1293 1294 /***/ 3: 1295 /***/ (function(module, exports) { 1296 1297 (function() { module.exports = this["wp"]["components"]; }()); 1298 1299 /***/ }), 1300 1301 /***/ 30: 1302 /***/ (function(module, exports) { 1303 1304 (function() { module.exports = this["wp"]["url"]; }()); 1305 1306 /***/ }), 1307 1308 /***/ 304: 1309 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1310 1311 "use strict"; 1312 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 1313 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 1314 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 1315 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 1316 1317 1318 /** 1319 * WordPress dependencies 1320 */ 1321 1322 var alignLeft = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 1323 xmlns: "http://www.w3.org/2000/svg", 1324 viewBox: "0 0 24 24" 1325 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 1326 d: "M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z" 1327 })); 1328 /* harmony default export */ __webpack_exports__["a"] = (alignLeft); 1329 1330 1331 /***/ }), 1332 1333 /***/ 305: 1334 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1335 1336 "use strict"; 1337 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 1338 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 1339 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 1340 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 1341 1342 1343 /** 1344 * WordPress dependencies 1345 */ 1346 1347 var alignCenter = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 1348 xmlns: "http://www.w3.org/2000/svg", 1349 viewBox: "0 0 24 24" 1350 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 1351 d: "M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z" 1352 })); 1353 /* harmony default export */ __webpack_exports__["a"] = (alignCenter); 1354 1355 1356 /***/ }), 1357 1358 /***/ 306: 1359 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1360 1361 "use strict"; 1362 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 1363 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 1364 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 1365 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 1366 1367 1368 /** 1369 * WordPress dependencies 1370 */ 1371 1372 var alignRight = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 1373 xmlns: "http://www.w3.org/2000/svg", 1374 viewBox: "0 0 24 24" 1375 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 1376 d: "M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z" 1377 })); 1378 /* harmony default export */ __webpack_exports__["a"] = (alignRight); 1379 1380 1381 /***/ }), 1382 1383 /***/ 307: 1384 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1385 1386 "use strict"; 1387 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 1388 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 1389 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 1390 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 1391 1392 1393 /** 1394 * WordPress dependencies 1395 */ 1396 1397 var search = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 1398 xmlns: "http://www.w3.org/2000/svg", 1399 viewBox: "0 0 24 24" 1400 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 1401 d: "M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z" 1402 })); 1403 /* harmony default export */ __webpack_exports__["a"] = (search); 1404 1405 1406 /***/ }), 1407 1408 /***/ 31: 1409 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1410 1411 "use strict"; 1412 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; }); 1413 /* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27); 1414 1415 function _unsupportedIterableToArray(o, minLen) { 1416 if (!o) return; 1417 if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen); 1418 var n = Object.prototype.toString.call(o).slice(8, -1); 1419 if (n === "Object" && o.constructor) n = o.constructor.name; 1420 if (n === "Map" || n === "Set") return Array.from(o); 1421 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen); 1422 } 1423 1424 /***/ }), 1425 1426 /***/ 320: 1427 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1428 1429 "use strict"; 1430 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 1431 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 1432 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 1433 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 1434 1435 1436 /** 1437 * WordPress dependencies 1438 */ 1439 1440 var media = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 1441 xmlns: "http://www.w3.org/2000/svg", 1442 viewBox: "0 0 24 24" 1443 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 1444 d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z" 1445 })); 1446 /* harmony default export */ __webpack_exports__["a"] = (media); 1447 1448 1449 /***/ }), 1450 1451 /***/ 321: 1452 /***/ (function(module, exports, __webpack_require__) { 1453 1454 "use strict"; 1455 /** 1456 * Copyright (c) 2015, Facebook, Inc. 1457 * All rights reserved. 1458 * 1459 * This source code is licensed under the BSD-style license found in the 1460 * LICENSE file in the root directory of this source tree. An additional grant 1461 * of patent rights can be found in the PATENTS file in the same directory. 1462 * 1463 * @providesModule normalizeWheel 1464 * @typechecks 1465 */ 1466 1467 1468 1469 var UserAgent_DEPRECATED = __webpack_require__(322); 1470 1471 var isEventSupported = __webpack_require__(323); 1472 1473 1474 // Reasonable defaults 1475 var PIXEL_STEP = 10; 1476 var LINE_HEIGHT = 40; 1477 var PAGE_HEIGHT = 800; 1478 1479 /** 1480 * Mouse wheel (and 2-finger trackpad) support on the web sucks. It is 1481 * complicated, thus this doc is long and (hopefully) detailed enough to answer 1482 * your questions. 1483 * 1484 * If you need to react to the mouse wheel in a predictable way, this code is 1485 * like your bestest friend. * hugs * 1486 * 1487 * As of today, there are 4 DOM event types you can listen to: 1488 * 1489 * 'wheel' -- Chrome(31+), FF(17+), IE(9+) 1490 * 'mousewheel' -- Chrome, IE(6+), Opera, Safari 1491 * 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother! 1492 * 'DOMMouseScroll' -- FF(0.9.7+) since 2003 1493 * 1494 * So what to do? The is the best: 1495 * 1496 * normalizeWheel.getEventType(); 1497 * 1498 * In your event callback, use this code to get sane interpretation of the 1499 * deltas. This code will return an object with properties: 1500 * 1501 * spinX -- normalized spin speed (use for zoom) - x plane 1502 * spinY -- " - y plane 1503 * pixelX -- normalized distance (to pixels) - x plane 1504 * pixelY -- " - y plane 1505 * 1506 * Wheel values are provided by the browser assuming you are using the wheel to 1507 * scroll a web page by a number of lines or pixels (or pages). Values can vary 1508 * significantly on different platforms and browsers, forgetting that you can 1509 * scroll at different speeds. Some devices (like trackpads) emit more events 1510 * at smaller increments with fine granularity, and some emit massive jumps with 1511 * linear speed or acceleration. 1512 * 1513 * This code does its best to normalize the deltas for you: 1514 * 1515 * - spin is trying to normalize how far the wheel was spun (or trackpad 1516 * dragged). This is super useful for zoom support where you want to 1517 * throw away the chunky scroll steps on the PC and make those equal to 1518 * the slow and smooth tiny steps on the Mac. Key data: This code tries to 1519 * resolve a single slow step on a wheel to 1. 1520 * 1521 * - pixel is normalizing the desired scroll delta in pixel units. You'll 1522 * get the crazy differences between browsers, but at least it'll be in 1523 * pixels! 1524 * 1525 * - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This 1526 * should translate to positive value zooming IN, negative zooming OUT. 1527 * This matches the newer 'wheel' event. 1528 * 1529 * Why are there spinX, spinY (or pixels)? 1530 * 1531 * - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn 1532 * with a mouse. It results in side-scrolling in the browser by default. 1533 * 1534 * - spinY is what you expect -- it's the classic axis of a mouse wheel. 1535 * 1536 * - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and 1537 * probably is by browsers in conjunction with fancy 3D controllers .. but 1538 * you know. 1539 * 1540 * Implementation info: 1541 * 1542 * Examples of 'wheel' event if you scroll slowly (down) by one step with an 1543 * average mouse: 1544 * 1545 * OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120) 1546 * OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12) 1547 * OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A) 1548 * Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120) 1549 * Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120) 1550 * 1551 * On the trackpad: 1552 * 1553 * OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6) 1554 * OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A) 1555 * 1556 * On other/older browsers.. it's more complicated as there can be multiple and 1557 * also missing delta values. 1558 * 1559 * The 'wheel' event is more standard: 1560 * 1561 * http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents 1562 * 1563 * The basics is that it includes a unit, deltaMode (pixels, lines, pages), and 1564 * deltaX, deltaY and deltaZ. Some browsers provide other values to maintain 1565 * backward compatibility with older events. Those other values help us 1566 * better normalize spin speed. Example of what the browsers provide: 1567 * 1568 * | event.wheelDelta | event.detail 1569 * ------------------+------------------+-------------- 1570 * Safari v5/OS X | -120 | 0 1571 * Safari v5/Win7 | -120 | 0 1572 * Chrome v17/OS X | -120 | 0 1573 * Chrome v17/Win7 | -120 | 0 1574 * IE9/Win7 | -120 | undefined 1575 * Firefox v4/OS X | undefined | 1 1576 * Firefox v4/Win7 | undefined | 3 1577 * 1578 */ 1579 function normalizeWheel(/*object*/ event) /*object*/ { 1580 var sX = 0, sY = 0, // spinX, spinY 1581 pX = 0, pY = 0; // pixelX, pixelY 1582 1583 // Legacy 1584 if ('detail' in event) { sY = event.detail; } 1585 if ('wheelDelta' in event) { sY = -event.wheelDelta / 120; } 1586 if ('wheelDeltaY' in event) { sY = -event.wheelDeltaY / 120; } 1587 if ('wheelDeltaX' in event) { sX = -event.wheelDeltaX / 120; } 1588 1589 // side scrolling on FF with DOMMouseScroll 1590 if ( 'axis' in event && event.axis === event.HORIZONTAL_AXIS ) { 1591 sX = sY; 1592 sY = 0; 1593 } 1594 1595 pX = sX * PIXEL_STEP; 1596 pY = sY * PIXEL_STEP; 1597 1598 if ('deltaY' in event) { pY = event.deltaY; } 1599 if ('deltaX' in event) { pX = event.deltaX; } 1600 1601 if ((pX || pY) && event.deltaMode) { 1602 if (event.deltaMode == 1) { // delta in LINE units 1603 pX *= LINE_HEIGHT; 1604 pY *= LINE_HEIGHT; 1605 } else { // delta in PAGE units 1606 pX *= PAGE_HEIGHT; 1607 pY *= PAGE_HEIGHT; 1608 } 1609 } 1610 1611 // Fall-back if spin cannot be determined 1612 if (pX && !sX) { sX = (pX < 1) ? -1 : 1; } 1613 if (pY && !sY) { sY = (pY < 1) ? -1 : 1; } 1614 1615 return { spinX : sX, 1616 spinY : sY, 1617 pixelX : pX, 1618 pixelY : pY }; 1619 } 1620 1621 1622 /** 1623 * The best combination if you prefer spinX + spinY normalization. It favors 1624 * the older DOMMouseScroll for Firefox, as FF does not include wheelDelta with 1625 * 'wheel' event, making spin speed determination impossible. 1626 */ 1627 normalizeWheel.getEventType = function() /*string*/ { 1628 return (UserAgent_DEPRECATED.firefox()) 1629 ? 'DOMMouseScroll' 1630 : (isEventSupported('wheel')) 1631 ? 'wheel' 1632 : 'mousewheel'; 1633 }; 1634 1635 module.exports = normalizeWheel; 1636 1637 1638 /***/ }), 1639 1640 /***/ 322: 1641 /***/ (function(module, exports) { 1642 1643 /** 1644 * Copyright 2004-present Facebook. All Rights Reserved. 1645 * 1646 * @providesModule UserAgent_DEPRECATED 1647 */ 1648 1649 /** 1650 * Provides entirely client-side User Agent and OS detection. You should prefer 1651 * the non-deprecated UserAgent module when possible, which exposes our 1652 * authoritative server-side PHP-based detection to the client. 1653 * 1654 * Usage is straightforward: 1655 * 1656 * if (UserAgent_DEPRECATED.ie()) { 1657 * // IE 1658 * } 1659 * 1660 * You can also do version checks: 1661 * 1662 * if (UserAgent_DEPRECATED.ie() >= 7) { 1663 * // IE7 or better 1664 * } 1665 * 1666 * The browser functions will return NaN if the browser does not match, so 1667 * you can also do version compares the other way: 1668 * 1669 * if (UserAgent_DEPRECATED.ie() < 7) { 1670 * // IE6 or worse 1671 * } 1672 * 1673 * Note that the version is a float and may include a minor version number, 1674 * so you should always use range operators to perform comparisons, not 1675 * strict equality. 1676 * 1677 * **Note:** You should **strongly** prefer capability detection to browser 1678 * version detection where it's reasonable: 1679 * 1680 * http://www.quirksmode.org/js/support.html 1681 * 1682 * Further, we have a large number of mature wrapper functions and classes 1683 * which abstract away many browser irregularities. Check the documentation, 1684 * grep for things, or ask on javascript@lists.facebook.com before writing yet 1685 * another copy of "event || window.event". 1686 * 1687 */ 1688 1689 var _populated = false; 1690 1691 // Browsers 1692 var _ie, _firefox, _opera, _webkit, _chrome; 1693 1694 // Actual IE browser for compatibility mode 1695 var _ie_real_version; 1696 1697 // Platforms 1698 var _osx, _windows, _linux, _android; 1699 1700 // Architectures 1701 var _win64; 1702 1703 // Devices 1704 var _iphone, _ipad, _native; 1705 1706 var _mobile; 1707 1708 function _populate() { 1709 if (_populated) { 1710 return; 1711 } 1712 1713 _populated = true; 1714 1715 // To work around buggy JS libraries that can't handle multi-digit 1716 // version numbers, Opera 10's user agent string claims it's Opera 1717 // 9, then later includes a Version/X.Y field: 1718 // 1719 // Opera/9.80 (foo) Presto/2.2.15 Version/10.10 1720 var uas = navigator.userAgent; 1721 var agent = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(uas); 1722 var os = /(Mac OS X)|(Windows)|(Linux)/.exec(uas); 1723 1724 _iphone = /\b(iPhone|iP[ao]d)/.exec(uas); 1725 _ipad = /\b(iP[ao]d)/.exec(uas); 1726 _android = /Android/i.exec(uas); 1727 _native = /FBAN\/\w+;/i.exec(uas); 1728 _mobile = /Mobile/i.exec(uas); 1729 1730 // Note that the IE team blog would have you believe you should be checking 1731 // for 'Win64; x64'. But MSDN then reveals that you can actually be coming 1732 // from either x64 or ia64; so ultimately, you should just check for Win64 1733 // as in indicator of whether you're in 64-bit IE. 32-bit IE on 64-bit 1734 // Windows will send 'WOW64' instead. 1735 _win64 = !!(/Win64/.exec(uas)); 1736 1737 if (agent) { 1738 _ie = agent[1] ? parseFloat(agent[1]) : ( 1739 agent[5] ? parseFloat(agent[5]) : NaN); 1740 // IE compatibility mode 1741 if (_ie && document && document.documentMode) { 1742 _ie = document.documentMode; 1743 } 1744 // grab the "true" ie version from the trident token if available 1745 var trident = /(?:Trident\/(\d+.\d+))/.exec(uas); 1746 _ie_real_version = trident ? parseFloat(trident[1]) + 4 : _ie; 1747 1748 _firefox = agent[2] ? parseFloat(agent[2]) : NaN; 1749 _opera = agent[3] ? parseFloat(agent[3]) : NaN; 1750 _webkit = agent[4] ? parseFloat(agent[4]) : NaN; 1751 if (_webkit) { 1752 // We do not add the regexp to the above test, because it will always 1753 // match 'safari' only since 'AppleWebKit' appears before 'Chrome' in 1754 // the userAgent string. 1755 agent = /(?:Chrome\/(\d+\.\d+))/.exec(uas); 1756 _chrome = agent && agent[1] ? parseFloat(agent[1]) : NaN; 1757 } else { 1758 _chrome = NaN; 1759 } 1760 } else { 1761 _ie = _firefox = _opera = _chrome = _webkit = NaN; 1762 } 1763 1764 if (os) { 1765 if (os[1]) { 1766 // Detect OS X version. If no version number matches, set _osx to true. 1767 // Version examples: 10, 10_6_1, 10.7 1768 // Parses version number as a float, taking only first two sets of 1769 // digits. If only one set of digits is found, returns just the major 1770 // version number. 1771 var ver = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(uas); 1772 1773 _osx = ver ? parseFloat(ver[1].replace('_', '.')) : true; 1774 } else { 1775 _osx = false; 1776 } 1777 _windows = !!os[2]; 1778 _linux = !!os[3]; 1779 } else { 1780 _osx = _windows = _linux = false; 1781 } 1782 } 1783 1784 var UserAgent_DEPRECATED = { 1785 1786 /** 1787 * Check if the UA is Internet Explorer. 1788 * 1789 * 1790 * @return float|NaN Version number (if match) or NaN. 1791 */ 1792 ie: function() { 1793 return _populate() || _ie; 1794 }, 1795 1796 /** 1797 * Check if we're in Internet Explorer compatibility mode. 1798 * 1799 * @return bool true if in compatibility mode, false if 1800 * not compatibility mode or not ie 1801 */ 1802 ieCompatibilityMode: function() { 1803 return _populate() || (_ie_real_version > _ie); 1804 }, 1805 1806 1807 /** 1808 * Whether the browser is 64-bit IE. Really, this is kind of weak sauce; we 1809 * only need this because Skype can't handle 64-bit IE yet. We need to remove 1810 * this when we don't need it -- tracked by #601957. 1811 */ 1812 ie64: function() { 1813 return UserAgent_DEPRECATED.ie() && _win64; 1814 }, 1815 1816 /** 1817 * Check if the UA is Firefox. 1818 * 1819 * 1820 * @return float|NaN Version number (if match) or NaN. 1821 */ 1822 firefox: function() { 1823 return _populate() || _firefox; 1824 }, 1825 1826 1827 /** 1828 * Check if the UA is Opera. 1829 * 1830 * 1831 * @return float|NaN Version number (if match) or NaN. 1832 */ 1833 opera: function() { 1834 return _populate() || _opera; 1835 }, 1836 1837 1838 /** 1839 * Check if the UA is WebKit. 1840 * 1841 * 1842 * @return float|NaN Version number (if match) or NaN. 1843 */ 1844 webkit: function() { 1845 return _populate() || _webkit; 1846 }, 1847 1848 /** 1849 * For Push 1850 * WILL BE REMOVED VERY SOON. Use UserAgent_DEPRECATED.webkit 1851 */ 1852 safari: function() { 1853 return UserAgent_DEPRECATED.webkit(); 1854 }, 1855 1856 /** 1857 * Check if the UA is a Chrome browser. 1858 * 1859 * 1860 * @return float|NaN Version number (if match) or NaN. 1861 */ 1862 chrome : function() { 1863 return _populate() || _chrome; 1864 }, 1865 1866 1867 /** 1868 * Check if the user is running Windows. 1869 * 1870 * @return bool `true' if the user's OS is Windows. 1871 */ 1872 windows: function() { 1873 return _populate() || _windows; 1874 }, 1875 1876 1877 /** 1878 * Check if the user is running Mac OS X. 1879 * 1880 * @return float|bool Returns a float if a version number is detected, 1881 * otherwise true/false. 1882 */ 1883 osx: function() { 1884 return _populate() || _osx; 1885 }, 1886 1887 /** 1888 * Check if the user is running Linux. 1889 * 1890 * @return bool `true' if the user's OS is some flavor of Linux. 1891 */ 1892 linux: function() { 1893 return _populate() || _linux; 1894 }, 1895 1896 /** 1897 * Check if the user is running on an iPhone or iPod platform. 1898 * 1899 * @return bool `true' if the user is running some flavor of the 1900 * iPhone OS. 1901 */ 1902 iphone: function() { 1903 return _populate() || _iphone; 1904 }, 1905 1906 mobile: function() { 1907 return _populate() || (_iphone || _ipad || _android || _mobile); 1908 }, 1909 1910 nativeApp: function() { 1911 // webviews inside of the native apps 1912 return _populate() || _native; 1913 }, 1914 1915 android: function() { 1916 return _populate() || _android; 1917 }, 1918 1919 ipad: function() { 1920 return _populate() || _ipad; 1921 } 1922 }; 1923 1924 module.exports = UserAgent_DEPRECATED; 1925 1926 1927 /***/ }), 1928 1929 /***/ 323: 1930 /***/ (function(module, exports, __webpack_require__) { 1931 1932 "use strict"; 1933 /** 1934 * Copyright 2013-2015, Facebook, Inc. 1935 * All rights reserved. 1936 * 1937 * This source code is licensed under the BSD-style license found in the 1938 * LICENSE file in the root directory of this source tree. An additional grant 1939 * of patent rights can be found in the PATENTS file in the same directory. 1940 * 1941 * @providesModule isEventSupported 1942 */ 1943 1944 1945 1946 var ExecutionEnvironment = __webpack_require__(324); 1947 1948 var useHasFeature; 1949 if (ExecutionEnvironment.canUseDOM) { 1950 useHasFeature = 1951 document.implementation && 1952 document.implementation.hasFeature && 1953 // always returns true in newer browsers as per the standard. 1954 // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature 1955 document.implementation.hasFeature('', '') !== true; 1956 } 1957 1958 /** 1959 * Checks if an event is supported in the current execution environment. 1960 * 1961 * NOTE: This will not work correctly for non-generic events such as `change`, 1962 * `reset`, `load`, `error`, and `select`. 1963 * 1964 * Borrows from Modernizr. 1965 * 1966 * @param {string} eventNameSuffix Event name, e.g. "click". 1967 * @param {?boolean} capture Check if the capture phase is supported. 1968 * @return {boolean} True if the event is supported. 1969 * @internal 1970 * @license Modernizr 3.0.0pre (Custom Build) | MIT 1971 */ 1972 function isEventSupported(eventNameSuffix, capture) { 1973 if (!ExecutionEnvironment.canUseDOM || 1974 capture && !('addEventListener' in document)) { 1975 return false; 1976 } 1977 1978 var eventName = 'on' + eventNameSuffix; 1979 var isSupported = eventName in document; 1980 1981 if (!isSupported) { 1982 var element = document.createElement('div'); 1983 element.setAttribute(eventName, 'return;'); 1984 isSupported = typeof element[eventName] === 'function'; 1985 } 1986 1987 if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') { 1988 // This is the only way to test support for the `wheel` event in IE9+. 1989 isSupported = document.implementation.hasFeature('Events.wheel', '3.0'); 1990 } 1991 1992 return isSupported; 1993 } 1994 1995 module.exports = isEventSupported; 1996 1997 1998 /***/ }), 1999 2000 /***/ 324: 2001 /***/ (function(module, exports, __webpack_require__) { 2002 2003 "use strict"; 2004 /** 2005 * Copyright (c) 2015, Facebook, Inc. 2006 * All rights reserved. 2007 * 2008 * This source code is licensed under the BSD-style license found in the 2009 * LICENSE file in the root directory of this source tree. An additional grant 2010 * of patent rights can be found in the PATENTS file in the same directory. 2011 * 2012 * @providesModule ExecutionEnvironment 2013 */ 2014 2015 /*jslint evil: true */ 2016 2017 2018 2019 var canUseDOM = !!( 2020 typeof window !== 'undefined' && 2021 window.document && 2022 window.document.createElement 2023 ); 2024 2025 /** 2026 * Simple, lightweight module assisting with the detection and context of 2027 * Worker. Helps avoid circular dependencies and allows code to reason about 2028 * whether or not they are in a Worker, even if they never include the main 2029 * `ReactWorker` dependency. 2030 */ 2031 var ExecutionEnvironment = { 2032 2033 canUseDOM: canUseDOM, 2034 2035 canUseWorkers: typeof Worker !== 'undefined', 2036 2037 canUseEventListeners: 2038 canUseDOM && !!(window.addEventListener || window.attachEvent), 2039 2040 canUseViewport: canUseDOM && !!window.screen, 2041 2042 isInWorker: !canUseDOM // For now, this is true - might change in the future. 2043 2044 }; 2045 2046 module.exports = ExecutionEnvironment; 2047 2048 2049 /***/ }), 2050 2051 /***/ 325: 2052 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2053 2054 "use strict"; 2055 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 2056 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 2057 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); 2058 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 2059 2060 2061 /** 2062 * WordPress dependencies 2063 */ 2064 2065 var code = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 2066 viewBox: "0 0 24 24", 2067 xmlns: "http://www.w3.org/2000/svg" 2068 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 2069 d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z" 2070 })); 2071 /* harmony default export */ __webpack_exports__["a"] = (code); 2072 2073 2074 /***/ }), 2075 2076 /***/ 36: 2077 /***/ (function(module, exports) { 2078 2079 (function() { module.exports = this["wp"]["deprecated"]; }()); 2080 2081 /***/ }), 2082 2083 /***/ 37: 2084 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2085 2086 "use strict"; 2087 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; }); 2088 function _iterableToArray(iter) { 2089 if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); 2090 } 2091 2092 /***/ }), 2093 2094 /***/ 38: 2095 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2096 2097 "use strict"; 2098 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; }); 2099 function _arrayWithHoles(arr) { 2100 if (Array.isArray(arr)) return arr; 2101 } 2102 2103 /***/ }), 2104 2105 /***/ 39: 2106 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2107 2108 "use strict"; 2109 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; }); 2110 function _nonIterableRest() { 2111 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 2112 } 2113 2114 /***/ }), 2115 2116 /***/ 4: 2117 /***/ (function(module, exports) { 2118 2119 (function() { module.exports = this["wp"]["data"]; }()); 2120 2121 /***/ }), 2122 2123 /***/ 40: 2124 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2125 2126 "use strict"; 2127 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; }); 2128 function _typeof(obj) { 2129 "@babel/helpers - typeof"; 2130 2131 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { 2132 _typeof = function _typeof(obj) { 2133 return typeof obj; 2134 }; 2135 } else { 2136 _typeof = function _typeof(obj) { 2137 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 2138 }; 2139 } 2140 2141 return _typeof(obj); 2142 } 2143 2144 /***/ }), 2145 2146 /***/ 41: 2147 /***/ (function(module, exports) { 2148 2149 (function() { module.exports = this["wp"]["blob"]; }()); 2150 2151 /***/ }), 2152 2153 /***/ 43: 2154 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2155 2156 "use strict"; 2157 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; }); 2158 function _objectWithoutPropertiesLoose(source, excluded) { 2159 if (source == null) return {}; 2160 var target = {}; 2161 var sourceKeys = Object.keys(source); 2162 var key, i; 2163 2164 for (i = 0; i < sourceKeys.length; i++) { 2165 key = sourceKeys[i]; 2166 if (excluded.indexOf(key) >= 0) continue; 2167 target[key] = source[key]; 2168 } 2169 2170 return target; 2171 } 2172 2173 /***/ }), 2174 2175 /***/ 44: 2176 /***/ (function(module, exports) { 2177 2178 (function() { module.exports = this["moment"]; }()); 2179 2180 /***/ }), 2181 2182 /***/ 45: 2183 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2184 2185 "use strict"; 2186 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _asyncToGenerator; }); 2187 function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { 2188 try { 2189 var info = gen[key](arg); 2190 var value = info.value; 2191 } catch (error) { 2192 reject(error); 2193 return; 2194 } 2195 2196 if (info.done) { 2197 resolve(value); 2198 } else { 2199 Promise.resolve(value).then(_next, _throw); 2200 } 2201 } 2202 2203 function _asyncToGenerator(fn) { 2204 return function () { 2205 var self = this, 2206 args = arguments; 2207 return new Promise(function (resolve, reject) { 2208 var gen = fn.apply(self, args); 2209 2210 function _next(value) { 2211 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); 2212 } 2213 2214 function _throw(err) { 2215 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); 2216 } 2217 2218 _next(undefined); 2219 }); 2220 }; 2221 } 2222 2223 /***/ }), 2224 2225 /***/ 459: 2226 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2227 2228 "use strict"; 2229 // ESM COMPAT FLAG 2230 __webpack_require__.r(__webpack_exports__); 2231 2232 // EXPORTS 2233 __webpack_require__.d(__webpack_exports__, "__experimentalGetCoreBlocks", function() { return /* binding */ build_module_experimentalGetCoreBlocks; }); 2234 __webpack_require__.d(__webpack_exports__, "registerCoreBlocks", function() { return /* binding */ build_module_registerCoreBlocks; }); 2235 __webpack_require__.d(__webpack_exports__, "__experimentalRegisterExperimentalCoreBlocks", function() { return /* binding */ __experimentalRegisterExperimentalCoreBlocks; }); 2236 2237 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js 2238 var build_module_paragraph_namespaceObject = {}; 2239 __webpack_require__.r(build_module_paragraph_namespaceObject); 2240 __webpack_require__.d(build_module_paragraph_namespaceObject, "metadata", function() { return paragraph_metadata; }); 2241 __webpack_require__.d(build_module_paragraph_namespaceObject, "name", function() { return paragraph_name; }); 2242 __webpack_require__.d(build_module_paragraph_namespaceObject, "settings", function() { return paragraph_settings; }); 2243 2244 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/image/index.js 2245 var build_module_image_namespaceObject = {}; 2246 __webpack_require__.r(build_module_image_namespaceObject); 2247 __webpack_require__.d(build_module_image_namespaceObject, "metadata", function() { return image_metadata; }); 2248 __webpack_require__.d(build_module_image_namespaceObject, "name", function() { return image_name; }); 2249 __webpack_require__.d(build_module_image_namespaceObject, "settings", function() { return image_settings; }); 2250 2251 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/heading/index.js 2252 var build_module_heading_namespaceObject = {}; 2253 __webpack_require__.r(build_module_heading_namespaceObject); 2254 __webpack_require__.d(build_module_heading_namespaceObject, "metadata", function() { return heading_metadata; }); 2255 __webpack_require__.d(build_module_heading_namespaceObject, "name", function() { return heading_name; }); 2256 __webpack_require__.d(build_module_heading_namespaceObject, "settings", function() { return heading_settings; }); 2257 2258 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/quote/index.js 2259 var build_module_quote_namespaceObject = {}; 2260 __webpack_require__.r(build_module_quote_namespaceObject); 2261 __webpack_require__.d(build_module_quote_namespaceObject, "metadata", function() { return quote_metadata; }); 2262 __webpack_require__.d(build_module_quote_namespaceObject, "name", function() { return quote_name; }); 2263 __webpack_require__.d(build_module_quote_namespaceObject, "settings", function() { return quote_settings; }); 2264 2265 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/gallery/index.js 2266 var build_module_gallery_namespaceObject = {}; 2267 __webpack_require__.r(build_module_gallery_namespaceObject); 2268 __webpack_require__.d(build_module_gallery_namespaceObject, "metadata", function() { return gallery_metadata; }); 2269 __webpack_require__.d(build_module_gallery_namespaceObject, "name", function() { return gallery_name; }); 2270 __webpack_require__.d(build_module_gallery_namespaceObject, "settings", function() { return gallery_settings; }); 2271 2272 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/archives/index.js 2273 var archives_namespaceObject = {}; 2274 __webpack_require__.r(archives_namespaceObject); 2275 __webpack_require__.d(archives_namespaceObject, "metadata", function() { return archives_metadata; }); 2276 __webpack_require__.d(archives_namespaceObject, "name", function() { return archives_name; }); 2277 __webpack_require__.d(archives_namespaceObject, "settings", function() { return archives_settings; }); 2278 2279 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/audio/index.js 2280 var build_module_audio_namespaceObject = {}; 2281 __webpack_require__.r(build_module_audio_namespaceObject); 2282 __webpack_require__.d(build_module_audio_namespaceObject, "metadata", function() { return audio_metadata; }); 2283 __webpack_require__.d(build_module_audio_namespaceObject, "name", function() { return audio_name; }); 2284 __webpack_require__.d(build_module_audio_namespaceObject, "settings", function() { return audio_settings; }); 2285 2286 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/button/index.js 2287 var build_module_button_namespaceObject = {}; 2288 __webpack_require__.r(build_module_button_namespaceObject); 2289 __webpack_require__.d(build_module_button_namespaceObject, "metadata", function() { return button_metadata; }); 2290 __webpack_require__.d(build_module_button_namespaceObject, "name", function() { return button_name; }); 2291 __webpack_require__.d(build_module_button_namespaceObject, "settings", function() { return button_settings; }); 2292 2293 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/buttons/index.js 2294 var buttons_namespaceObject = {}; 2295 __webpack_require__.r(buttons_namespaceObject); 2296 __webpack_require__.d(buttons_namespaceObject, "metadata", function() { return buttons_metadata; }); 2297 __webpack_require__.d(buttons_namespaceObject, "name", function() { return buttons_name; }); 2298 __webpack_require__.d(buttons_namespaceObject, "settings", function() { return buttons_settings; }); 2299 2300 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/calendar/index.js 2301 var build_module_calendar_namespaceObject = {}; 2302 __webpack_require__.r(build_module_calendar_namespaceObject); 2303 __webpack_require__.d(build_module_calendar_namespaceObject, "metadata", function() { return calendar_metadata; }); 2304 __webpack_require__.d(build_module_calendar_namespaceObject, "name", function() { return calendar_name; }); 2305 __webpack_require__.d(build_module_calendar_namespaceObject, "settings", function() { return calendar_settings; }); 2306 2307 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/categories/index.js 2308 var categories_namespaceObject = {}; 2309 __webpack_require__.r(categories_namespaceObject); 2310 __webpack_require__.d(categories_namespaceObject, "metadata", function() { return categories_metadata; }); 2311 __webpack_require__.d(categories_namespaceObject, "name", function() { return categories_name; }); 2312 __webpack_require__.d(categories_namespaceObject, "settings", function() { return categories_settings; }); 2313 2314 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/code/index.js 2315 var code_namespaceObject = {}; 2316 __webpack_require__.r(code_namespaceObject); 2317 __webpack_require__.d(code_namespaceObject, "metadata", function() { return code_metadata; }); 2318 __webpack_require__.d(code_namespaceObject, "name", function() { return code_name; }); 2319 __webpack_require__.d(code_namespaceObject, "settings", function() { return code_settings; }); 2320 2321 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/columns/index.js 2322 var build_module_columns_namespaceObject = {}; 2323 __webpack_require__.r(build_module_columns_namespaceObject); 2324 __webpack_require__.d(build_module_columns_namespaceObject, "metadata", function() { return columns_metadata; }); 2325 __webpack_require__.d(build_module_columns_namespaceObject, "name", function() { return columns_name; }); 2326 __webpack_require__.d(build_module_columns_namespaceObject, "settings", function() { return columns_settings; }); 2327 2328 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/column/index.js 2329 var build_module_column_namespaceObject = {}; 2330 __webpack_require__.r(build_module_column_namespaceObject); 2331 __webpack_require__.d(build_module_column_namespaceObject, "metadata", function() { return column_metadata; }); 2332 __webpack_require__.d(build_module_column_namespaceObject, "name", function() { return column_name; }); 2333 __webpack_require__.d(build_module_column_namespaceObject, "settings", function() { return column_settings; }); 2334 2335 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/cover/index.js 2336 var build_module_cover_namespaceObject = {}; 2337 __webpack_require__.r(build_module_cover_namespaceObject); 2338 __webpack_require__.d(build_module_cover_namespaceObject, "metadata", function() { return cover_metadata; }); 2339 __webpack_require__.d(build_module_cover_namespaceObject, "name", function() { return cover_name; }); 2340 __webpack_require__.d(build_module_cover_namespaceObject, "settings", function() { return cover_settings; }); 2341 2342 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/embed/index.js 2343 var embed_namespaceObject = {}; 2344 __webpack_require__.r(embed_namespaceObject); 2345 __webpack_require__.d(embed_namespaceObject, "metadata", function() { return embed_metadata; }); 2346 __webpack_require__.d(embed_namespaceObject, "name", function() { return embed_name; }); 2347 __webpack_require__.d(embed_namespaceObject, "settings", function() { return embed_settings; }); 2348 2349 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/file/index.js 2350 var build_module_file_namespaceObject = {}; 2351 __webpack_require__.r(build_module_file_namespaceObject); 2352 __webpack_require__.d(build_module_file_namespaceObject, "metadata", function() { return file_metadata; }); 2353 __webpack_require__.d(build_module_file_namespaceObject, "name", function() { return file_name; }); 2354 __webpack_require__.d(build_module_file_namespaceObject, "settings", function() { return file_settings; }); 2355 2356 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/html/index.js 2357 var build_module_html_namespaceObject = {}; 2358 __webpack_require__.r(build_module_html_namespaceObject); 2359 __webpack_require__.d(build_module_html_namespaceObject, "metadata", function() { return html_metadata; }); 2360 __webpack_require__.d(build_module_html_namespaceObject, "name", function() { return html_name; }); 2361 __webpack_require__.d(build_module_html_namespaceObject, "settings", function() { return html_settings; }); 2362 2363 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/media-text/index.js 2364 var media_text_namespaceObject = {}; 2365 __webpack_require__.r(media_text_namespaceObject); 2366 __webpack_require__.d(media_text_namespaceObject, "metadata", function() { return media_text_metadata; }); 2367 __webpack_require__.d(media_text_namespaceObject, "name", function() { return media_text_name; }); 2368 __webpack_require__.d(media_text_namespaceObject, "settings", function() { return media_text_settings; }); 2369 2370 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js 2371 var latest_comments_namespaceObject = {}; 2372 __webpack_require__.r(latest_comments_namespaceObject); 2373 __webpack_require__.d(latest_comments_namespaceObject, "metadata", function() { return latest_comments_metadata; }); 2374 __webpack_require__.d(latest_comments_namespaceObject, "name", function() { return latest_comments_name; }); 2375 __webpack_require__.d(latest_comments_namespaceObject, "settings", function() { return latest_comments_settings; }); 2376 2377 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js 2378 var latest_posts_namespaceObject = {}; 2379 __webpack_require__.r(latest_posts_namespaceObject); 2380 __webpack_require__.d(latest_posts_namespaceObject, "metadata", function() { return latest_posts_metadata; }); 2381 __webpack_require__.d(latest_posts_namespaceObject, "name", function() { return latest_posts_name; }); 2382 __webpack_require__.d(latest_posts_namespaceObject, "settings", function() { return latest_posts_settings; }); 2383 2384 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/list/index.js 2385 var build_module_list_namespaceObject = {}; 2386 __webpack_require__.r(build_module_list_namespaceObject); 2387 __webpack_require__.d(build_module_list_namespaceObject, "metadata", function() { return list_metadata; }); 2388 __webpack_require__.d(build_module_list_namespaceObject, "name", function() { return list_name; }); 2389 __webpack_require__.d(build_module_list_namespaceObject, "settings", function() { return list_settings; }); 2390 2391 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/missing/index.js 2392 var missing_namespaceObject = {}; 2393 __webpack_require__.r(missing_namespaceObject); 2394 __webpack_require__.d(missing_namespaceObject, "metadata", function() { return missing_metadata; }); 2395 __webpack_require__.d(missing_namespaceObject, "name", function() { return missing_name; }); 2396 __webpack_require__.d(missing_namespaceObject, "settings", function() { return missing_settings; }); 2397 2398 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/more/index.js 2399 var build_module_more_namespaceObject = {}; 2400 __webpack_require__.r(build_module_more_namespaceObject); 2401 __webpack_require__.d(build_module_more_namespaceObject, "metadata", function() { return more_metadata; }); 2402 __webpack_require__.d(build_module_more_namespaceObject, "name", function() { return more_name; }); 2403 __webpack_require__.d(build_module_more_namespaceObject, "settings", function() { return more_settings; }); 2404 2405 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/nextpage/index.js 2406 var nextpage_namespaceObject = {}; 2407 __webpack_require__.r(nextpage_namespaceObject); 2408 __webpack_require__.d(nextpage_namespaceObject, "metadata", function() { return nextpage_metadata; }); 2409 __webpack_require__.d(nextpage_namespaceObject, "name", function() { return nextpage_name; }); 2410 __webpack_require__.d(nextpage_namespaceObject, "settings", function() { return nextpage_settings; }); 2411 2412 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/preformatted/index.js 2413 var build_module_preformatted_namespaceObject = {}; 2414 __webpack_require__.r(build_module_preformatted_namespaceObject); 2415 __webpack_require__.d(build_module_preformatted_namespaceObject, "metadata", function() { return preformatted_metadata; }); 2416 __webpack_require__.d(build_module_preformatted_namespaceObject, "name", function() { return preformatted_name; }); 2417 __webpack_require__.d(build_module_preformatted_namespaceObject, "settings", function() { return preformatted_settings; }); 2418 2419 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pullquote/index.js 2420 var build_module_pullquote_namespaceObject = {}; 2421 __webpack_require__.r(build_module_pullquote_namespaceObject); 2422 __webpack_require__.d(build_module_pullquote_namespaceObject, "metadata", function() { return pullquote_metadata; }); 2423 __webpack_require__.d(build_module_pullquote_namespaceObject, "name", function() { return pullquote_name; }); 2424 __webpack_require__.d(build_module_pullquote_namespaceObject, "settings", function() { return pullquote_settings; }); 2425 2426 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/block/index.js 2427 var block_namespaceObject = {}; 2428 __webpack_require__.r(block_namespaceObject); 2429 __webpack_require__.d(block_namespaceObject, "metadata", function() { return block_metadata; }); 2430 __webpack_require__.d(block_namespaceObject, "name", function() { return block_name; }); 2431 __webpack_require__.d(block_namespaceObject, "settings", function() { return block_settings; }); 2432 2433 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/rss/index.js 2434 var build_module_rss_namespaceObject = {}; 2435 __webpack_require__.r(build_module_rss_namespaceObject); 2436 __webpack_require__.d(build_module_rss_namespaceObject, "metadata", function() { return rss_metadata; }); 2437 __webpack_require__.d(build_module_rss_namespaceObject, "name", function() { return rss_name; }); 2438 __webpack_require__.d(build_module_rss_namespaceObject, "settings", function() { return rss_settings; }); 2439 2440 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/search/index.js 2441 var search_namespaceObject = {}; 2442 __webpack_require__.r(search_namespaceObject); 2443 __webpack_require__.d(search_namespaceObject, "metadata", function() { return search_metadata; }); 2444 __webpack_require__.d(search_namespaceObject, "name", function() { return search_name; }); 2445 __webpack_require__.d(search_namespaceObject, "settings", function() { return search_settings; }); 2446 2447 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/group/index.js 2448 var build_module_group_namespaceObject = {}; 2449 __webpack_require__.r(build_module_group_namespaceObject); 2450 __webpack_require__.d(build_module_group_namespaceObject, "metadata", function() { return group_metadata; }); 2451 __webpack_require__.d(build_module_group_namespaceObject, "name", function() { return group_name; }); 2452 __webpack_require__.d(build_module_group_namespaceObject, "settings", function() { return group_settings; }); 2453 2454 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/separator/index.js 2455 var build_module_separator_namespaceObject = {}; 2456 __webpack_require__.r(build_module_separator_namespaceObject); 2457 __webpack_require__.d(build_module_separator_namespaceObject, "metadata", function() { return separator_metadata; }); 2458 __webpack_require__.d(build_module_separator_namespaceObject, "name", function() { return separator_name; }); 2459 __webpack_require__.d(build_module_separator_namespaceObject, "settings", function() { return build_module_separator_settings; }); 2460 2461 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/shortcode/index.js 2462 var build_module_shortcode_namespaceObject = {}; 2463 __webpack_require__.r(build_module_shortcode_namespaceObject); 2464 __webpack_require__.d(build_module_shortcode_namespaceObject, "metadata", function() { return shortcode_metadata; }); 2465 __webpack_require__.d(build_module_shortcode_namespaceObject, "name", function() { return shortcode_name; }); 2466 __webpack_require__.d(build_module_shortcode_namespaceObject, "settings", function() { return shortcode_settings; }); 2467 2468 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/spacer/index.js 2469 var spacer_namespaceObject = {}; 2470 __webpack_require__.r(spacer_namespaceObject); 2471 __webpack_require__.d(spacer_namespaceObject, "metadata", function() { return spacer_metadata; }); 2472 __webpack_require__.d(spacer_namespaceObject, "name", function() { return spacer_name; }); 2473 __webpack_require__.d(spacer_namespaceObject, "settings", function() { return spacer_settings; }); 2474 2475 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/subhead/index.js 2476 var subhead_namespaceObject = {}; 2477 __webpack_require__.r(subhead_namespaceObject); 2478 __webpack_require__.d(subhead_namespaceObject, "metadata", function() { return subhead_metadata; }); 2479 __webpack_require__.d(subhead_namespaceObject, "name", function() { return subhead_name; }); 2480 __webpack_require__.d(subhead_namespaceObject, "settings", function() { return subhead_settings; }); 2481 2482 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/table/index.js 2483 var build_module_table_namespaceObject = {}; 2484 __webpack_require__.r(build_module_table_namespaceObject); 2485 __webpack_require__.d(build_module_table_namespaceObject, "metadata", function() { return table_metadata; }); 2486 __webpack_require__.d(build_module_table_namespaceObject, "name", function() { return table_name; }); 2487 __webpack_require__.d(build_module_table_namespaceObject, "settings", function() { return table_settings; }); 2488 2489 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js 2490 var text_columns_namespaceObject = {}; 2491 __webpack_require__.r(text_columns_namespaceObject); 2492 __webpack_require__.d(text_columns_namespaceObject, "metadata", function() { return text_columns_metadata; }); 2493 __webpack_require__.d(text_columns_namespaceObject, "name", function() { return text_columns_name; }); 2494 __webpack_require__.d(text_columns_namespaceObject, "settings", function() { return text_columns_settings; }); 2495 2496 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/verse/index.js 2497 var build_module_verse_namespaceObject = {}; 2498 __webpack_require__.r(build_module_verse_namespaceObject); 2499 __webpack_require__.d(build_module_verse_namespaceObject, "metadata", function() { return verse_metadata; }); 2500 __webpack_require__.d(build_module_verse_namespaceObject, "name", function() { return verse_name; }); 2501 __webpack_require__.d(build_module_verse_namespaceObject, "settings", function() { return verse_settings; }); 2502 2503 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/video/index.js 2504 var build_module_video_namespaceObject = {}; 2505 __webpack_require__.r(build_module_video_namespaceObject); 2506 __webpack_require__.d(build_module_video_namespaceObject, "metadata", function() { return video_metadata; }); 2507 __webpack_require__.d(build_module_video_namespaceObject, "name", function() { return video_name; }); 2508 __webpack_require__.d(build_module_video_namespaceObject, "settings", function() { return video_settings; }); 2509 2510 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js 2511 var tag_cloud_namespaceObject = {}; 2512 __webpack_require__.r(tag_cloud_namespaceObject); 2513 __webpack_require__.d(tag_cloud_namespaceObject, "metadata", function() { return tag_cloud_metadata; }); 2514 __webpack_require__.d(tag_cloud_namespaceObject, "name", function() { return tag_cloud_name; }); 2515 __webpack_require__.d(tag_cloud_namespaceObject, "settings", function() { return tag_cloud_settings; }); 2516 2517 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/classic/index.js 2518 var build_module_classic_namespaceObject = {}; 2519 __webpack_require__.r(build_module_classic_namespaceObject); 2520 __webpack_require__.d(build_module_classic_namespaceObject, "metadata", function() { return classic_metadata; }); 2521 __webpack_require__.d(build_module_classic_namespaceObject, "name", function() { return classic_name; }); 2522 __webpack_require__.d(build_module_classic_namespaceObject, "settings", function() { return classic_settings; }); 2523 2524 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-links/index.js 2525 var social_links_namespaceObject = {}; 2526 __webpack_require__.r(social_links_namespaceObject); 2527 __webpack_require__.d(social_links_namespaceObject, "metadata", function() { return social_links_metadata; }); 2528 __webpack_require__.d(social_links_namespaceObject, "name", function() { return social_links_name; }); 2529 __webpack_require__.d(social_links_namespaceObject, "settings", function() { return social_links_settings; }); 2530 2531 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-link/index.js 2532 var social_link_namespaceObject = {}; 2533 __webpack_require__.r(social_link_namespaceObject); 2534 __webpack_require__.d(social_link_namespaceObject, "metadata", function() { return social_link_metadata; }); 2535 __webpack_require__.d(social_link_namespaceObject, "name", function() { return social_link_name; }); 2536 __webpack_require__.d(social_link_namespaceObject, "settings", function() { return social_link_settings; }); 2537 2538 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules 2539 var toConsumableArray = __webpack_require__(17); 2540 2541 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js 2542 var defineProperty = __webpack_require__(5); 2543 2544 // EXTERNAL MODULE: external {"this":["wp","coreData"]} 2545 var external_this_wp_coreData_ = __webpack_require__(83); 2546 2547 // EXTERNAL MODULE: external {"this":["wp","notices"]} 2548 var external_this_wp_notices_ = __webpack_require__(92); 2549 2550 // EXTERNAL MODULE: external {"this":["wp","blockEditor"]} 2551 var external_this_wp_blockEditor_ = __webpack_require__(6); 2552 2553 // EXTERNAL MODULE: external {"this":["wp","reusableBlocks"]} 2554 var external_this_wp_reusableBlocks_ = __webpack_require__(121); 2555 2556 // EXTERNAL MODULE: external {"this":["wp","blocks"]} 2557 var external_this_wp_blocks_ = __webpack_require__(11); 2558 2559 // EXTERNAL MODULE: external {"this":"lodash"} 2560 var external_this_lodash_ = __webpack_require__(2); 2561 2562 // EXTERNAL MODULE: external {"this":["wp","i18n"]} 2563 var external_this_wp_i18n_ = __webpack_require__(1); 2564 2565 // EXTERNAL MODULE: external {"this":["wp","element"]} 2566 var external_this_wp_element_ = __webpack_require__(0); 2567 2568 // EXTERNAL MODULE: external {"this":["wp","primitives"]} 2569 var external_this_wp_primitives_ = __webpack_require__(7); 2570 2571 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/paragraph.js 2572 2573 2574 /** 2575 * WordPress dependencies 2576 */ 2577 2578 var paragraph = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], { 2579 xmlns: "http://www.w3.org/2000/svg", 2580 viewBox: "0 0 24 24" 2581 }, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], { 2582 d: "M18.3 4H9.9v-.1l-.9.2c-2.3.4-4 2.4-4 4.8s1.7 4.4 4 4.8l.7.1V20h1.5V5.5h2.9V20h1.5V5.5h2.7V4z" 2583 })); 2584 /* harmony default export */ var library_paragraph = (paragraph); 2585 2586 // EXTERNAL MODULE: ./node_modules/classnames/index.js 2587 var classnames = __webpack_require__(9); 2588 var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); 2589 2590 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/deprecated.js 2591 2592 2593 2594 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } 2595 2596 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 2597 2598 /** 2599 * External dependencies 2600 */ 2601 2602 2603 /** 2604 * WordPress dependencies 2605 */ 2606 2607 2608 2609 var supports = { 2610 className: false 2611 }; 2612 var deprecated_blockAttributes = { 2613 align: { 2614 type: 'string' 2615 }, 2616 content: { 2617 type: 'string', 2618 source: 'html', 2619 selector: 'p', 2620 default: '' 2621 }, 2622 dropCap: { 2623 type: 'boolean', 2624 default: false 2625 }, 2626 placeholder: { 2627 type: 'string' 2628 }, 2629 textColor: { 2630 type: 'string' 2631 }, 2632 backgroundColor: { 2633 type: 'string' 2634 }, 2635 fontSize: { 2636 type: 'string' 2637 }, 2638 direction: { 2639 type: 'string', 2640 enum: ['ltr', 'rtl'] 2641 }, 2642 style: { 2643 type: 'object' 2644 } 2645 }; 2646 2647 var deprecated_migrateCustomColorsAndFontSizes = function migrateCustomColorsAndFontSizes(attributes) { 2648 if (!attributes.customTextColor && !attributes.customBackgroundColor && !attributes.customFontSize) { 2649 return attributes; 2650 } 2651 2652 var style = {}; 2653 2654 if (attributes.customTextColor || attributes.customBackgroundColor) { 2655 style.color = {}; 2656 } 2657 2658 if (attributes.customTextColor) { 2659 style.color.text = attributes.customTextColor; 2660 } 2661 2662 if (attributes.customBackgroundColor) { 2663 style.color.background = attributes.customBackgroundColor; 2664 } 2665 2666 if (attributes.customFontSize) { 2667 style.typography = { 2668 fontSize: attributes.customFontSize 2669 }; 2670 } 2671 2672 return _objectSpread(_objectSpread({}, Object(external_this_lodash_["omit"])(attributes, ['customTextColor', 'customBackgroundColor', 'customFontSize'])), {}, { 2673 style: style 2674 }); 2675 }; 2676 2677 var deprecated = [{ 2678 supports: supports, 2679 attributes: _objectSpread(_objectSpread({}, Object(external_this_lodash_["omit"])(deprecated_blockAttributes, ['style'])), {}, { 2680 customTextColor: { 2681 type: 'string' 2682 }, 2683 customBackgroundColor: { 2684 type: 'string' 2685 }, 2686 customFontSize: { 2687 type: 'number' 2688 } 2689 }), 2690 migrate: deprecated_migrateCustomColorsAndFontSizes, 2691 save: function save(_ref) { 2692 var _classnames; 2693 2694 var attributes = _ref.attributes; 2695 var align = attributes.align, 2696 content = attributes.content, 2697 dropCap = attributes.dropCap, 2698 backgroundColor = attributes.backgroundColor, 2699 textColor = attributes.textColor, 2700 customBackgroundColor = attributes.customBackgroundColor, 2701 customTextColor = attributes.customTextColor, 2702 fontSize = attributes.fontSize, 2703 customFontSize = attributes.customFontSize, 2704 direction = attributes.direction; 2705 var textClass = Object(external_this_wp_blockEditor_["getColorClassName"])('color', textColor); 2706 var backgroundClass = Object(external_this_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor); 2707 var fontSizeClass = Object(external_this_wp_blockEditor_["getFontSizeClass"])(fontSize); 2708 var className = classnames_default()((_classnames = { 2709 'has-text-color': textColor || customTextColor, 2710 'has-background': backgroundColor || customBackgroundColor, 2711 'has-drop-cap': dropCap 2712 }, Object(defineProperty["a" /* default */])(_classnames, "has-text-align-".concat(align), align), Object(defineProperty["a" /* default */])(_classnames, fontSizeClass, fontSizeClass), Object(defineProperty["a" /* default */])(_classnames, textClass, textClass), Object(defineProperty["a" /* default */])(_classnames, backgroundClass, backgroundClass), _classnames)); 2713 var styles = { 2714 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 2715 color: textClass ? undefined : customTextColor, 2716 fontSize: fontSizeClass ? undefined : customFontSize 2717 }; 2718 return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 2719 tagName: "p", 2720 style: styles, 2721 className: className ? className : undefined, 2722 value: content, 2723 dir: direction 2724 }); 2725 } 2726 }, { 2727 supports: supports, 2728 attributes: _objectSpread(_objectSpread({}, Object(external_this_lodash_["omit"])(deprecated_blockAttributes, ['style'])), {}, { 2729 customTextColor: { 2730 type: 'string' 2731 }, 2732 customBackgroundColor: { 2733 type: 'string' 2734 }, 2735 customFontSize: { 2736 type: 'number' 2737 } 2738 }), 2739 migrate: deprecated_migrateCustomColorsAndFontSizes, 2740 save: function save(_ref2) { 2741 var _classnames2; 2742 2743 var attributes = _ref2.attributes; 2744 var align = attributes.align, 2745 content = attributes.content, 2746 dropCap = attributes.dropCap, 2747 backgroundColor = attributes.backgroundColor, 2748 textColor = attributes.textColor, 2749 customBackgroundColor = attributes.customBackgroundColor, 2750 customTextColor = attributes.customTextColor, 2751 fontSize = attributes.fontSize, 2752 customFontSize = attributes.customFontSize, 2753 direction = attributes.direction; 2754 var textClass = Object(external_this_wp_blockEditor_["getColorClassName"])('color', textColor); 2755 var backgroundClass = Object(external_this_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor); 2756 var fontSizeClass = Object(external_this_wp_blockEditor_["getFontSizeClass"])(fontSize); 2757 var className = classnames_default()((_classnames2 = { 2758 'has-text-color': textColor || customTextColor, 2759 'has-background': backgroundColor || customBackgroundColor, 2760 'has-drop-cap': dropCap 2761 }, Object(defineProperty["a" /* default */])(_classnames2, fontSizeClass, fontSizeClass), Object(defineProperty["a" /* default */])(_classnames2, textClass, textClass), Object(defineProperty["a" /* default */])(_classnames2, backgroundClass, backgroundClass), _classnames2)); 2762 var styles = { 2763 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 2764 color: textClass ? undefined : customTextColor, 2765 fontSize: fontSizeClass ? undefined : customFontSize, 2766 textAlign: align 2767 }; 2768 return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 2769 tagName: "p", 2770 style: styles, 2771 className: className ? className : undefined, 2772 value: content, 2773 dir: direction 2774 }); 2775 } 2776 }, { 2777 supports: supports, 2778 attributes: _objectSpread(_objectSpread({}, Object(external_this_lodash_["omit"])(deprecated_blockAttributes, ['style'])), {}, { 2779 customTextColor: { 2780 type: 'string' 2781 }, 2782 customBackgroundColor: { 2783 type: 'string' 2784 }, 2785 customFontSize: { 2786 type: 'number' 2787 }, 2788 width: { 2789 type: 'string' 2790 } 2791 }), 2792 migrate: deprecated_migrateCustomColorsAndFontSizes, 2793 save: function save(_ref3) { 2794 var _classnames3; 2795 2796 var attributes = _ref3.attributes; 2797 var width = attributes.width, 2798 align = attributes.align, 2799 content = attributes.content, 2800 dropCap = attributes.dropCap, 2801 backgroundColor = attributes.backgroundColor, 2802 textColor = attributes.textColor, 2803 customBackgroundColor = attributes.customBackgroundColor, 2804 customTextColor = attributes.customTextColor, 2805 fontSize = attributes.fontSize, 2806 customFontSize = attributes.customFontSize; 2807 var textClass = Object(external_this_wp_blockEditor_["getColorClassName"])('color', textColor); 2808 var backgroundClass = Object(external_this_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor); 2809 var fontSizeClass = fontSize && "is-".concat(fontSize, "-text"); 2810 var className = classnames_default()((_classnames3 = {}, Object(defineProperty["a" /* default */])(_classnames3, "align".concat(width), width), Object(defineProperty["a" /* default */])(_classnames3, 'has-background', backgroundColor || customBackgroundColor), Object(defineProperty["a" /* default */])(_classnames3, 'has-drop-cap', dropCap), Object(defineProperty["a" /* default */])(_classnames3, fontSizeClass, fontSizeClass), Object(defineProperty["a" /* default */])(_classnames3, textClass, textClass), Object(defineProperty["a" /* default */])(_classnames3, backgroundClass, backgroundClass), _classnames3)); 2811 var styles = { 2812 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 2813 color: textClass ? undefined : customTextColor, 2814 fontSize: fontSizeClass ? undefined : customFontSize, 2815 textAlign: align 2816 }; 2817 return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 2818 tagName: "p", 2819 style: styles, 2820 className: className ? className : undefined, 2821 value: content 2822 }); 2823 } 2824 }, { 2825 supports: supports, 2826 attributes: Object(external_this_lodash_["omit"])(_objectSpread(_objectSpread({}, deprecated_blockAttributes), {}, { 2827 fontSize: { 2828 type: 'number' 2829 } 2830 }), ['style']), 2831 save: function save(_ref4) { 2832 var _classnames4; 2833 2834 var attributes = _ref4.attributes; 2835 var width = attributes.width, 2836 align = attributes.align, 2837 content = attributes.content, 2838 dropCap = attributes.dropCap, 2839 backgroundColor = attributes.backgroundColor, 2840 textColor = attributes.textColor, 2841 fontSize = attributes.fontSize; 2842 var className = classnames_default()((_classnames4 = {}, Object(defineProperty["a" /* default */])(_classnames4, "align".concat(width), width), Object(defineProperty["a" /* default */])(_classnames4, 'has-background', backgroundColor), Object(defineProperty["a" /* default */])(_classnames4, 'has-drop-cap', dropCap), _classnames4)); 2843 var styles = { 2844 backgroundColor: backgroundColor, 2845 color: textColor, 2846 fontSize: fontSize, 2847 textAlign: align 2848 }; 2849 return Object(external_this_wp_element_["createElement"])("p", { 2850 style: styles, 2851 className: className ? className : undefined 2852 }, content); 2853 }, 2854 migrate: function migrate(attributes) { 2855 return deprecated_migrateCustomColorsAndFontSizes(Object(external_this_lodash_["omit"])(_objectSpread(_objectSpread({}, attributes), {}, { 2856 customFontSize: Object(external_this_lodash_["isFinite"])(attributes.fontSize) ? attributes.fontSize : undefined, 2857 customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined, 2858 customBackgroundColor: attributes.backgroundColor && '#' === attributes.backgroundColor[0] ? attributes.backgroundColor : undefined 2859 })), ['fontSize', 'textColor', 'backgroundColor', 'style']); 2860 } 2861 }, { 2862 supports: supports, 2863 attributes: _objectSpread(_objectSpread({}, deprecated_blockAttributes), {}, { 2864 content: { 2865 type: 'string', 2866 source: 'html', 2867 default: '' 2868 } 2869 }), 2870 save: function save(_ref5) { 2871 var attributes = _ref5.attributes; 2872 return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["RawHTML"], null, attributes.content); 2873 }, 2874 migrate: function migrate(attributes) { 2875 return attributes; 2876 } 2877 }]; 2878 /* harmony default export */ var paragraph_deprecated = (deprecated); 2879 2880 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js 2881 var esm_extends = __webpack_require__(8); 2882 2883 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules 2884 var slicedToArray = __webpack_require__(12); 2885 2886 // EXTERNAL MODULE: external {"this":["wp","components"]} 2887 var external_this_wp_components_ = __webpack_require__(3); 2888 2889 // EXTERNAL MODULE: external {"this":["wp","data"]} 2890 var external_this_wp_data_ = __webpack_require__(4); 2891 2892 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-ltr.js 2893 2894 2895 /** 2896 * WordPress dependencies 2897 */ 2898 2899 var formatLtr = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], { 2900 xmlns: "http://www.w3.org/2000/svg", 2901 viewBox: "-2 -2 24 24" 2902 }, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], { 2903 d: "M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z" 2904 })); 2905 /* harmony default export */ var format_ltr = (formatLtr); 2906 2907 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/edit.js 2908 2909 2910 2911 2912 2913 2914 function edit_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } 2915 2916 function edit_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { edit_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { edit_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 2917 2918 /** 2919 * External dependencies 2920 */ 2921 2922 /** 2923 * WordPress dependencies 2924 */ 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 function getComputedStyle(node, pseudo) { 2935 return node.ownerDocument.defaultView.getComputedStyle(node, pseudo); 2936 } 2937 2938 var edit_name = 'core/paragraph'; 2939 2940 function ParagraphRTLToolbar(_ref) { 2941 var direction = _ref.direction, 2942 setDirection = _ref.setDirection; 2943 var isRTL = Object(external_this_wp_data_["useSelect"])(function (select) { 2944 return !!select('core/block-editor').getSettings().isRTL; 2945 }, []); 2946 return isRTL && Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToolbarGroup"], { 2947 controls: [{ 2948 icon: format_ltr, 2949 title: Object(external_this_wp_i18n_["_x"])('Left to right', 'editor button'), 2950 isActive: direction === 'ltr', 2951 onClick: function onClick() { 2952 setDirection(direction === 'ltr' ? undefined : 'ltr'); 2953 } 2954 }] 2955 }); 2956 } 2957 2958 function useDropCapMinHeight(ref, isDisabled, dependencies) { 2959 var _useState = Object(external_this_wp_element_["useState"])(), 2960 _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), 2961 minHeight = _useState2[0], 2962 setMinHeight = _useState2[1]; 2963 2964 Object(external_this_wp_element_["useEffect"])(function () { 2965 if (isDisabled) { 2966 setMinHeight(); 2967 return; 2968 } 2969 2970 setMinHeight(getComputedStyle(ref.current, 'first-letter').lineHeight); 2971 }, [isDisabled].concat(Object(toConsumableArray["a" /* default */])(dependencies))); 2972 return minHeight; 2973 } 2974 2975 function ParagraphBlock(_ref2) { 2976 var attributes = _ref2.attributes, 2977 mergeBlocks = _ref2.mergeBlocks, 2978 onReplace = _ref2.onReplace, 2979 onRemove = _ref2.onRemove, 2980 setAttributes = _ref2.setAttributes; 2981 var align = attributes.align, 2982 content = attributes.content, 2983 direction = attributes.direction, 2984 dropCap = attributes.dropCap, 2985 placeholder = attributes.placeholder, 2986 fontSize = attributes.fontSize, 2987 style = attributes.style; 2988 var isDropCapFeatureEnabled = Object(external_this_wp_blockEditor_["__experimentalUseEditorFeature"])('typography.dropCap'); 2989 var ref = Object(external_this_wp_element_["useRef"])(); 2990 var inlineFontSize = style === null || style === void 0 ? void 0 : style.fontSize; 2991 var size = Object(external_this_wp_data_["useSelect"])(function (select) { 2992 var _select$getSettings = select('core/block-editor').getSettings(), 2993 fontSizes = _select$getSettings.fontSizes; 2994 2995 return Object(external_this_wp_blockEditor_["getFontSize"])(fontSizes, fontSize, inlineFontSize).size; 2996 }, [fontSize, inlineFontSize]); 2997 var hasDropCap = isDropCapFeatureEnabled && dropCap; 2998 var minHeight = useDropCapMinHeight(ref, !hasDropCap, [size]); 2999 var blockProps = Object(external_this_wp_blockEditor_["useBlockProps"])({ 3000 ref: ref, 3001 className: classnames_default()(Object(defineProperty["a" /* default */])({ 3002 'has-drop-cap': dropCap 3003 }, "has-text-align-".concat(align), align)), 3004 style: { 3005 direction: direction, 3006 minHeight: minHeight 3007 } 3008 }); 3009 return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["BlockControls"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["AlignmentToolbar"], { 3010 value: align, 3011 onChange: function onChange(newAlign) { 3012 return setAttributes({ 3013 align: newAlign 3014 }); 3015 } 3016 }), Object(external_this_wp_element_["createElement"])(ParagraphRTLToolbar, { 3017 direction: direction, 3018 setDirection: function setDirection(newDirection) { 3019 return setAttributes({ 3020 direction: newDirection 3021 }); 3022 } 3023 })), isDropCapFeatureEnabled && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["InspectorControls"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["PanelBody"], { 3024 title: Object(external_this_wp_i18n_["__"])('Text settings') 3025 }, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToggleControl"], { 3026 label: Object(external_this_wp_i18n_["__"])('Drop cap'), 3027 checked: !!dropCap, 3028 onChange: function onChange() { 3029 return setAttributes({ 3030 dropCap: !dropCap 3031 }); 3032 }, 3033 help: dropCap ? Object(external_this_wp_i18n_["__"])('Showing large initial letter.') : Object(external_this_wp_i18n_["__"])('Toggle to show a large initial letter.') 3034 }))), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"], Object(esm_extends["a" /* default */])({ 3035 identifier: "content", 3036 tagName: "p" 3037 }, blockProps, { 3038 value: content, 3039 onChange: function onChange(newContent) { 3040 return setAttributes({ 3041 content: newContent 3042 }); 3043 }, 3044 onSplit: function onSplit(value) { 3045 if (!value) { 3046 return Object(external_this_wp_blocks_["createBlock"])(edit_name); 3047 } 3048 3049 return Object(external_this_wp_blocks_["createBlock"])(edit_name, edit_objectSpread(edit_objectSpread({}, attributes), {}, { 3050 content: value 3051 })); 3052 }, 3053 onMerge: mergeBlocks, 3054 onReplace: onReplace, 3055 onRemove: onRemove, 3056 "aria-label": content ? Object(external_this_wp_i18n_["__"])('Paragraph block') : Object(external_this_wp_i18n_["__"])('Empty block; start writing or type forward slash to choose a block'), 3057 placeholder: placeholder || Object(external_this_wp_i18n_["__"])('Start writing or type / to choose a block'), 3058 __unstableEmbedURLOnPaste: true, 3059 __unstableAllowPrefixTransformations: true 3060 }))); 3061 } 3062 3063 /* harmony default export */ var edit = (ParagraphBlock); 3064 3065 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/save.js 3066 3067 3068 3069 /** 3070 * External dependencies 3071 */ 3072 3073 /** 3074 * WordPress dependencies 3075 */ 3076 3077 3078 function save_save(_ref) { 3079 var attributes = _ref.attributes; 3080 var align = attributes.align, 3081 content = attributes.content, 3082 dropCap = attributes.dropCap, 3083 direction = attributes.direction; 3084 var className = classnames_default()(Object(defineProperty["a" /* default */])({ 3085 'has-drop-cap': dropCap 3086 }, "has-text-align-".concat(align), align)); 3087 return Object(external_this_wp_element_["createElement"])("p", external_this_wp_blockEditor_["useBlockProps"].save({ 3088 className: className, 3089 dir: direction 3090 }), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 3091 value: content 3092 })); 3093 } 3094 3095 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/transforms.js 3096 /** 3097 * WordPress dependencies 3098 */ 3099 3100 /** 3101 * Internal dependencies 3102 */ 3103 3104 var _apiVersion$name$cate = { 3105 apiVersion: 2, 3106 name: "core/paragraph", 3107 category: "text", 3108 attributes: { 3109 align: { 3110 type: "string" 3111 }, 3112 content: { 3113 type: "string", 3114 source: "html", 3115 selector: "p", 3116 "default": "" 3117 }, 3118 dropCap: { 3119 type: "boolean", 3120 "default": false 3121 }, 3122 placeholder: { 3123 type: "string" 3124 }, 3125 direction: { 3126 type: "string", 3127 "enum": ["ltr", "rtl"] 3128 } 3129 }, 3130 supports: { 3131 anchor: true, 3132 className: false, 3133 color: { 3134 link: true 3135 }, 3136 fontSize: true, 3137 lineHeight: true, 3138 __experimentalSelector: "p", 3139 __unstablePasteTextInline: true 3140 } 3141 }, 3142 transforms_name = _apiVersion$name$cate.name; 3143 var transforms = { 3144 from: [{ 3145 type: 'raw', 3146 // Paragraph is a fallback and should be matched last. 3147 priority: 20, 3148 selector: 'p', 3149 schema: function schema(_ref) { 3150 var phrasingContentSchema = _ref.phrasingContentSchema, 3151 isPaste = _ref.isPaste; 3152 return { 3153 p: { 3154 children: phrasingContentSchema, 3155 attributes: isPaste ? [] : ['style', 'id'] 3156 } 3157 }; 3158 }, 3159 transform: function transform(node) { 3160 var attributes = Object(external_this_wp_blocks_["getBlockAttributes"])(transforms_name, node.outerHTML); 3161 3162 var _ref2 = node.style || {}, 3163 textAlign = _ref2.textAlign; 3164 3165 if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') { 3166 attributes.align = textAlign; 3167 } 3168 3169 return Object(external_this_wp_blocks_["createBlock"])(transforms_name, attributes); 3170 } 3171 }] 3172 }; 3173 /* harmony default export */ var paragraph_transforms = (transforms); 3174 3175 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js 3176 /** 3177 * External dependencies 3178 */ 3179 3180 /** 3181 * WordPress dependencies 3182 */ 3183 3184 3185 3186 /** 3187 * Internal dependencies 3188 */ 3189 3190 3191 3192 var paragraph_metadata = { 3193 apiVersion: 2, 3194 name: "core/paragraph", 3195 category: "text", 3196 attributes: { 3197 align: { 3198 type: "string" 3199 }, 3200 content: { 3201 type: "string", 3202 source: "html", 3203 selector: "p", 3204 "default": "" 3205 }, 3206 dropCap: { 3207 type: "boolean", 3208 "default": false 3209 }, 3210 placeholder: { 3211 type: "string" 3212 }, 3213 direction: { 3214 type: "string", 3215 "enum": ["ltr", "rtl"] 3216 } 3217 }, 3218 supports: { 3219 anchor: true, 3220 className: false, 3221 color: { 3222 link: true 3223 }, 3224 fontSize: true, 3225 lineHeight: true, 3226 __experimentalSelector: "p", 3227 __unstablePasteTextInline: true 3228 } 3229 }; 3230 3231 3232 var paragraph_name = paragraph_metadata.name; 3233 3234 var paragraph_settings = { 3235 title: Object(external_this_wp_i18n_["__"])('Paragraph'), 3236 description: Object(external_this_wp_i18n_["__"])('Start with the building block of all narrative.'), 3237 icon: library_paragraph, 3238 keywords: [Object(external_this_wp_i18n_["__"])('text')], 3239 example: { 3240 attributes: { 3241 content: Object(external_this_wp_i18n_["__"])('In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'), 3242 style: { 3243 typography: { 3244 fontSize: 28 3245 } 3246 }, 3247 dropCap: true 3248 } 3249 }, 3250 __experimentalLabel: function __experimentalLabel(attributes, _ref) { 3251 var context = _ref.context; 3252 3253 if (context === 'accessibility') { 3254 var content = attributes.content; 3255 return Object(external_this_lodash_["isEmpty"])(content) ? Object(external_this_wp_i18n_["__"])('Empty') : content; 3256 } 3257 }, 3258 transforms: paragraph_transforms, 3259 deprecated: paragraph_deprecated, 3260 merge: function merge(attributes, attributesToMerge) { 3261 return { 3262 content: (attributes.content || '') + (attributesToMerge.content || '') 3263 }; 3264 }, 3265 edit: edit, 3266 save: save_save 3267 }; 3268 3269 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/image.js 3270 3271 3272 /** 3273 * WordPress dependencies 3274 */ 3275 3276 var image_image = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], { 3277 viewBox: "0 0 24 24", 3278 xmlns: "http://www.w3.org/2000/svg" 3279 }, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], { 3280 d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" 3281 })); 3282 /* harmony default export */ var library_image = (image_image); 3283 3284 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/deprecated.js 3285 3286 3287 3288 3289 /** 3290 * External dependencies 3291 */ 3292 3293 /** 3294 * WordPress dependencies 3295 */ 3296 3297 3298 var image_deprecated_blockAttributes = { 3299 align: { 3300 type: 'string' 3301 }, 3302 url: { 3303 type: 'string', 3304 source: 'attribute', 3305 selector: 'img', 3306 attribute: 'src' 3307 }, 3308 alt: { 3309 type: 'string', 3310 source: 'attribute', 3311 selector: 'img', 3312 attribute: 'alt', 3313 default: '' 3314 }, 3315 caption: { 3316 type: 'string', 3317 source: 'html', 3318 selector: 'figcaption' 3319 }, 3320 href: { 3321 type: 'string', 3322 source: 'attribute', 3323 selector: 'figure > a', 3324 attribute: 'href' 3325 }, 3326 rel: { 3327 type: 'string', 3328 source: 'attribute', 3329 selector: 'figure > a', 3330 attribute: 'rel' 3331 }, 3332 linkClass: { 3333 type: 'string', 3334 source: 'attribute', 3335 selector: 'figure > a', 3336 attribute: 'class' 3337 }, 3338 id: { 3339 type: 'number' 3340 }, 3341 width: { 3342 type: 'number' 3343 }, 3344 height: { 3345 type: 'number' 3346 }, 3347 linkDestination: { 3348 type: 'string' 3349 }, 3350 linkTarget: { 3351 type: 'string', 3352 source: 'attribute', 3353 selector: 'figure > a', 3354 attribute: 'target' 3355 } 3356 }; 3357 var deprecated_deprecated = [{ 3358 attributes: image_deprecated_blockAttributes, 3359 save: function save(_ref) { 3360 var _classnames; 3361 3362 var attributes = _ref.attributes; 3363 var url = attributes.url, 3364 alt = attributes.alt, 3365 caption = attributes.caption, 3366 align = attributes.align, 3367 href = attributes.href, 3368 width = attributes.width, 3369 height = attributes.height, 3370 id = attributes.id; 3371 var classes = classnames_default()((_classnames = {}, Object(defineProperty["a" /* default */])(_classnames, "align".concat(align), align), Object(defineProperty["a" /* default */])(_classnames, 'is-resized', width || height), _classnames)); 3372 var image = Object(external_this_wp_element_["createElement"])("img", { 3373 src: url, 3374 alt: alt, 3375 className: id ? "wp-image-".concat(id) : null, 3376 width: width, 3377 height: height 3378 }); 3379 return Object(external_this_wp_element_["createElement"])("figure", { 3380 className: classes 3381 }, href ? Object(external_this_wp_element_["createElement"])("a", { 3382 href: href 3383 }, image) : image, !external_this_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 3384 tagName: "figcaption", 3385 value: caption 3386 })); 3387 } 3388 }, { 3389 attributes: image_deprecated_blockAttributes, 3390 save: function save(_ref2) { 3391 var attributes = _ref2.attributes; 3392 var url = attributes.url, 3393 alt = attributes.alt, 3394 caption = attributes.caption, 3395 align = attributes.align, 3396 href = attributes.href, 3397 width = attributes.width, 3398 height = attributes.height, 3399 id = attributes.id; 3400 var image = Object(external_this_wp_element_["createElement"])("img", { 3401 src: url, 3402 alt: alt, 3403 className: id ? "wp-image-".concat(id) : null, 3404 width: width, 3405 height: height 3406 }); 3407 return Object(external_this_wp_element_["createElement"])("figure", { 3408 className: align ? "align".concat(align) : null 3409 }, href ? Object(external_this_wp_element_["createElement"])("a", { 3410 href: href 3411 }, image) : image, !external_this_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 3412 tagName: "figcaption", 3413 value: caption 3414 })); 3415 } 3416 }, { 3417 attributes: image_deprecated_blockAttributes, 3418 save: function save(_ref3) { 3419 var attributes = _ref3.attributes; 3420 var url = attributes.url, 3421 alt = attributes.alt, 3422 caption = attributes.caption, 3423 align = attributes.align, 3424 href = attributes.href, 3425 width = attributes.width, 3426 height = attributes.height; 3427 var extraImageProps = width || height ? { 3428 width: width, 3429 height: height 3430 } : {}; 3431 var image = Object(external_this_wp_element_["createElement"])("img", Object(esm_extends["a" /* default */])({ 3432 src: url, 3433 alt: alt 3434 }, extraImageProps)); 3435 var figureStyle = {}; 3436 3437 if (width) { 3438 figureStyle = { 3439 width: width 3440 }; 3441 } else if (align === 'left' || align === 'right') { 3442 figureStyle = { 3443 maxWidth: '50%' 3444 }; 3445 } 3446 3447 return Object(external_this_wp_element_["createElement"])("figure", { 3448 className: align ? "align".concat(align) : null, 3449 style: figureStyle 3450 }, href ? Object(external_this_wp_element_["createElement"])("a", { 3451 href: href 3452 }, image) : image, !external_this_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 3453 tagName: "figcaption", 3454 value: caption 3455 })); 3456 } 3457 }]; 3458 /* harmony default export */ var image_deprecated = (deprecated_deprecated); 3459 3460 // EXTERNAL MODULE: external {"this":["wp","blob"]} 3461 var external_this_wp_blob_ = __webpack_require__(41); 3462 3463 // EXTERNAL MODULE: external {"this":["wp","compose"]} 3464 var external_this_wp_compose_ = __webpack_require__(10); 3465 3466 // EXTERNAL MODULE: external {"this":["wp","url"]} 3467 var external_this_wp_url_ = __webpack_require__(30); 3468 3469 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/crop.js 3470 3471 3472 /** 3473 * WordPress dependencies 3474 */ 3475 3476 var crop_crop = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], { 3477 xmlns: "http://www.w3.org/2000/svg", 3478 viewBox: "0 0 24 24" 3479 }, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], { 3480 d: "M17.5 7v8H19V7c0-1.1-.9-2-2-2H9v1.5h8c.3 0 .5.2.5.5zM7 17.5c-.3 0-.5-.2-.5-.5V1H5v4H1v1.5h4V17c0 1.1.9 2 2 2h10.5v4H19v-4h4v-1.5H7z" 3481 })); 3482 /* harmony default export */ var library_crop = (crop_crop); 3483 3484 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/upload.js 3485 var upload = __webpack_require__(217); 3486 3487 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/constants.js 3488 var ASPECT_RATIOS = [// Common video resolutions. 3489 { 3490 ratio: '2.33', 3491 className: 'wp-embed-aspect-21-9' 3492 }, { 3493 ratio: '2.00', 3494 className: 'wp-embed-aspect-18-9' 3495 }, { 3496 ratio: '1.78', 3497 className: 'wp-embed-aspect-16-9' 3498 }, { 3499 ratio: '1.33', 3500 className: 'wp-embed-aspect-4-3' 3501 }, // Vertical video and instagram square video support. 3502 { 3503 ratio: '1.00', 3504 className: 'wp-embed-aspect-1-1' 3505 }, { 3506 ratio: '0.56', 3507 className: 'wp-embed-aspect-9-16' 3508 }, { 3509 ratio: '0.50', 3510 className: 'wp-embed-aspect-1-2' 3511 }]; 3512 var WP_EMBED_TYPE = 'wp-embed'; 3513 3514 // EXTERNAL MODULE: ./node_modules/classnames/dedupe.js 3515 var dedupe = __webpack_require__(117); 3516 var dedupe_default = /*#__PURE__*/__webpack_require__.n(dedupe); 3517 3518 // EXTERNAL MODULE: ./node_modules/memize/index.js 3519 var memize = __webpack_require__(60); 3520 var memize_default = /*#__PURE__*/__webpack_require__.n(memize); 3521 3522 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/util.js 3523 3524 3525 3526 function util_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } 3527 3528 function util_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { util_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { util_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 3529 3530 /** 3531 * Internal dependencies 3532 */ 3533 3534 /** 3535 * External dependencies 3536 */ 3537 3538 3539 3540 3541 /** 3542 * WordPress dependencies 3543 */ 3544 3545 3546 3547 /** 3548 * Internal dependencies 3549 */ 3550 3551 var util_metadata = { 3552 apiVersion: 2, 3553 name: "core/embed", 3554 category: "embed", 3555 attributes: { 3556 url: { 3557 type: "string" 3558 }, 3559 caption: { 3560 type: "string", 3561 source: "html", 3562 selector: "figcaption" 3563 }, 3564 type: { 3565 type: "string" 3566 }, 3567 providerNameSlug: { 3568 type: "string" 3569 }, 3570 allowResponsive: { 3571 type: "boolean", 3572 "default": true 3573 }, 3574 responsive: { 3575 type: "boolean", 3576 "default": false 3577 }, 3578 previewable: { 3579 type: "boolean", 3580 "default": true 3581 } 3582 }, 3583 supports: { 3584 align: true, 3585 reusable: false, 3586 html: false 3587 } 3588 }; 3589 var DEFAULT_EMBED_BLOCK = util_metadata.name; 3590 /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ 3591 3592 /** 3593 * Returns the embed block's information by matching the provided service provider 3594 * 3595 * @param {string} provider The embed block's provider 3596 * @return {WPBlockVariation} The embed block's information 3597 */ 3598 3599 var util_getEmbedInfoByProvider = function getEmbedInfoByProvider(provider) { 3600 var _getBlockVariations; 3601 3602 return (_getBlockVariations = Object(external_this_wp_blocks_["getBlockVariations"])(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations === void 0 ? void 0 : _getBlockVariations.find(function (_ref) { 3603 var name = _ref.name; 3604 return name === provider; 3605 }); 3606 }; 3607 /** 3608 * Returns true if any of the regular expressions match the URL. 3609 * 3610 * @param {string} url The URL to test. 3611 * @param {Array} patterns The list of regular expressions to test agains. 3612 * @return {boolean} True if any of the regular expressions match the URL. 3613 */ 3614 3615 var matchesPatterns = function matchesPatterns(url) { 3616 var patterns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; 3617 return patterns.some(function (pattern) { 3618 return url.match(pattern); 3619 }); 3620 }; 3621 /** 3622 * Finds the block variation that should be used for the URL, 3623 * based on the provided URL and the variation's patterns. 3624 * 3625 * @param {string} url The URL to test. 3626 * @return {WPBlockVariation} The block variation that should be used for this URL 3627 */ 3628 3629 var util_findMoreSuitableBlock = function findMoreSuitableBlock(url) { 3630 var _getBlockVariations2; 3631 3632 return (_getBlockVariations2 = Object(external_this_wp_blocks_["getBlockVariations"])(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations2 === void 0 ? void 0 : _getBlockVariations2.find(function (_ref2) { 3633 var patterns = _ref2.patterns; 3634 return matchesPatterns(url, patterns); 3635 }); 3636 }; 3637 var isFromWordPress = function isFromWordPress(html) { 3638 return html && html.includes('class="wp-embedded-content"'); 3639 }; 3640 var util_getPhotoHtml = function getPhotoHtml(photo) { 3641 // 100% width for the preview so it fits nicely into the document, some "thumbnails" are 3642 // actually the full size photo. If thumbnails not found, use full image. 3643 var imageUrl = photo.thumbnail_url || photo.url; 3644 var photoPreview = Object(external_this_wp_element_["createElement"])("p", null, Object(external_this_wp_element_["createElement"])("img", { 3645 src: imageUrl, 3646 alt: photo.title, 3647 width: "100%" 3648 })); 3649 return Object(external_this_wp_element_["renderToString"])(photoPreview); 3650 }; 3651 /** 3652 * Creates a more suitable embed block based on the passed in props 3653 * and attributes generated from an embed block's preview. 3654 * 3655 * We require `attributesFromPreview` to be generated from the latest attributes 3656 * and preview, and because of the way the react lifecycle operates, we can't 3657 * guarantee that the attributes contained in the block's props are the latest 3658 * versions, so we require that these are generated separately. 3659 * See `getAttributesFromPreview` in the generated embed edit component. 3660 * 3661 * @param {Object} props The block's props. 3662 * @param {Object} [attributesFromPreview] Attributes generated from the block's most up to date preview. 3663 * @return {Object|undefined} A more suitable embed block if one exists. 3664 */ 3665 3666 var util_createUpgradedEmbedBlock = function createUpgradedEmbedBlock(props) { 3667 var _getBlockVariations3; 3668 3669 var attributesFromPreview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 3670 var preview = props.preview, 3671 _props$attributes = props.attributes; 3672 _props$attributes = _props$attributes === void 0 ? {} : _props$attributes; 3673 var url = _props$attributes.url, 3674 providerNameSlug = _props$attributes.providerNameSlug, 3675 type = _props$attributes.type; 3676 if (!url || !Object(external_this_wp_blocks_["getBlockType"])(DEFAULT_EMBED_BLOCK)) return; 3677 var matchedBlock = util_findMoreSuitableBlock(url); // WordPress blocks can work on multiple sites, and so don't have patterns, 3678 // so if we're in a WordPress block, assume the user has chosen it for a WordPress URL. 3679 3680 var isCurrentBlockWP = providerNameSlug === 'wordpress' || type === WP_EMBED_TYPE; // if current block is not WordPress and a more suitable block found 3681 // that is different from the current one, create the new matched block 3682 3683 var shouldCreateNewBlock = !isCurrentBlockWP && matchedBlock && (matchedBlock.attributes.providerNameSlug !== providerNameSlug || !providerNameSlug); 3684 3685 if (shouldCreateNewBlock) { 3686 return Object(external_this_wp_blocks_["createBlock"])(DEFAULT_EMBED_BLOCK, util_objectSpread({ 3687 url: url 3688 }, matchedBlock.attributes)); 3689 } 3690 3691 var wpVariation = (_getBlockVariations3 = Object(external_this_wp_blocks_["getBlockVariations"])(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations3 === void 0 ? void 0 : _getBlockVariations3.find(function (_ref3) { 3692 var name = _ref3.name; 3693 return name === 'wordpress'; 3694 }); // We can't match the URL for WordPress embeds, we have to check the HTML instead. 3695 3696 if (!wpVariation || !preview || !isFromWordPress(preview.html) || isCurrentBlockWP) { 3697 return; 3698 } // This is not the WordPress embed block so transform it into one. 3699 3700 3701 return Object(external_this_wp_blocks_["createBlock"])(DEFAULT_EMBED_BLOCK, util_objectSpread(util_objectSpread({ 3702 url: url 3703 }, wpVariation.attributes), attributesFromPreview)); 3704 }; 3705 /** 3706 * Removes all previously set aspect ratio related classes and return the rest 3707 * existing class names. 3708 * 3709 * @param {string} existingClassNames Any existing class names. 3710 * @return {string} The class names without any aspect ratio related class. 3711 */ 3712 3713 var util_removeAspectRatioClasses = function removeAspectRatioClasses(existingClassNames) { 3714 var aspectRatioClassNames = ASPECT_RATIOS.reduce(function (accumulator, _ref4) { 3715 var className = _ref4.className; 3716 accumulator[className] = false; 3717 return accumulator; 3718 }, { 3719 'wp-has-aspect-ratio': false 3720 }); 3721 return dedupe_default()(existingClassNames, aspectRatioClassNames); 3722 }; 3723 /** 3724 * Returns class names with any relevant responsive aspect ratio names. 3725 * 3726 * @param {string} html The preview HTML that possibly contains an iframe with width and height set. 3727 * @param {string} existingClassNames Any existing class names. 3728 * @param {boolean} allowResponsive If the responsive class names should be added, or removed. 3729 * @return {string} Deduped class names. 3730 */ 3731 3732 function getClassNames(html) { 3733 var existingClassNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; 3734 var allowResponsive = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; 3735 3736 if (!allowResponsive) { 3737 return util_removeAspectRatioClasses(existingClassNames); 3738 } 3739 3740 var previewDocument = document.implementation.createHTMLDocument(''); 3741 previewDocument.body.innerHTML = html; 3742 var iframe = previewDocument.body.querySelector('iframe'); // If we have a fixed aspect iframe, and it's a responsive embed block. 3743 3744 if (iframe && iframe.height && iframe.width) { 3745 var aspectRatio = (iframe.width / iframe.height).toFixed(2); // Given the actual aspect ratio, find the widest ratio to support it. 3746 3747 for (var ratioIndex = 0; ratioIndex < ASPECT_RATIOS.length; ratioIndex++) { 3748 var potentialRatio = ASPECT_RATIOS[ratioIndex]; 3749 3750 if (aspectRatio >= potentialRatio.ratio) { 3751 return dedupe_default()(util_removeAspectRatioClasses(existingClassNames), potentialRatio.className, 'wp-has-aspect-ratio'); 3752 } 3753 } 3754 } 3755 3756 return existingClassNames; 3757 } 3758 /** 3759 * Fallback behaviour for unembeddable URLs. 3760 * Creates a paragraph block containing a link to the URL, and calls `onReplace`. 3761 * 3762 * @param {string} url The URL that could not be embedded. 3763 * @param {Function} onReplace Function to call with the created fallback block. 3764 */ 3765 3766 function util_fallback(url, onReplace) { 3767 var link = Object(external_this_wp_element_["createElement"])("a", { 3768 href: url 3769 }, url); 3770 onReplace(Object(external_this_wp_blocks_["createBlock"])('core/paragraph', { 3771 content: Object(external_this_wp_element_["renderToString"])(link) 3772 })); 3773 } 3774 /*** 3775 * Gets block attributes based on the preview and responsive state. 3776 * 3777 * @param {Object} preview The preview data. 3778 * @param {string} title The block's title, e.g. Twitter. 3779 * @param {Object} currentClassNames The block's current class names. 3780 * @param {boolean} isResponsive Boolean indicating if the block supports responsive content. 3781 * @param {boolean} allowResponsive Apply responsive classes to fixed size content. 3782 * @return {Object} Attributes and values. 3783 */ 3784 3785 var getAttributesFromPreview = memize_default()(function (preview, title, currentClassNames, isResponsive) { 3786 var allowResponsive = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true; 3787 3788 if (!preview) { 3789 return {}; 3790 } 3791 3792 var attributes = {}; // Some plugins only return HTML with no type info, so default this to 'rich'. 3793 3794 var _preview$type = preview.type, 3795 type = _preview$type === void 0 ? 'rich' : _preview$type; // If we got a provider name from the API, use it for the slug, otherwise we use the title, 3796 // because not all embed code gives us a provider name. 3797 3798 var html = preview.html, 3799 providerName = preview.provider_name; 3800 var providerNameSlug = Object(external_this_lodash_["kebabCase"])((providerName || title).toLowerCase()); 3801 3802 if (isFromWordPress(html)) { 3803 type = WP_EMBED_TYPE; 3804 } 3805 3806 if (html || 'photo' === type) { 3807 attributes.type = type; 3808 attributes.providerNameSlug = providerNameSlug; 3809 } 3810 3811 attributes.className = getClassNames(html, currentClassNames, isResponsive && allowResponsive); 3812 return attributes; 3813 }); 3814 3815 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/use-client-width.js 3816 3817 3818 /** 3819 * WordPress dependencies 3820 */ 3821 3822 function useClientWidth(ref, dependencies) { 3823 var _useState = Object(external_this_wp_element_["useState"])(), 3824 _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), 3825 clientWidth = _useState2[0], 3826 setClientWidth = _useState2[1]; 3827 3828 function calculateClientWidth() { 3829 setClientWidth(ref.current.clientWidth); 3830 } 3831 3832 Object(external_this_wp_element_["useEffect"])(calculateClientWidth, dependencies); 3833 Object(external_this_wp_element_["useEffect"])(function () { 3834 var defaultView = ref.current.ownerDocument.defaultView; 3835 defaultView.addEventListener('resize', calculateClientWidth); 3836 return function () { 3837 defaultView.removeEventListener('resize', calculateClientWidth); 3838 }; 3839 }, []); 3840 return clientWidth; 3841 } 3842 3843 // CONCATENATED MODULE: ./node_modules/react-easy-crop/node_modules/tslib/tslib.es6.js 3844 /*! ***************************************************************************** 3845 Copyright (c) Microsoft Corporation. 3846 3847 Permission to use, copy, modify, and/or distribute this software for any 3848 purpose with or without fee is hereby granted. 3849 3850 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 3851 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 3852 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 3853 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 3854 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 3855 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 3856 PERFORMANCE OF THIS SOFTWARE. 3857 ***************************************************************************** */ 3858 /* global Reflect, Promise */ 3859 3860 var extendStatics = function(d, b) { 3861 extendStatics = Object.setPrototypeOf || 3862 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 3863 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; 3864 return extendStatics(d, b); 3865 }; 3866 3867 function __extends(d, b) { 3868 extendStatics(d, b); 3869 function __() { this.constructor = d; } 3870 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 3871 } 3872 3873 var __assign = function() { 3874 __assign = Object.assign || function __assign(t) { 3875 for (var s, i = 1, n = arguments.length; i < n; i++) { 3876 s = arguments[i]; 3877 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 3878 } 3879 return t; 3880 } 3881 return __assign.apply(this, arguments); 3882 } 3883 3884 function __rest(s, e) { 3885 var t = {}; 3886 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 3887 t[p] = s[p]; 3888 if (s != null && typeof Object.getOwnPropertySymbols === "function") 3889 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 3890 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 3891 t[p[i]] = s[p[i]]; 3892 } 3893 return t; 3894 } 3895 3896 function __decorate(decorators, target, key, desc) { 3897 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 3898 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 3899 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 3900 return c > 3 && r && Object.defineProperty(target, key, r), r; 3901 } 3902 3903 function __param(paramIndex, decorator) { 3904 return function (target, key) { decorator(target, key, paramIndex); } 3905 } 3906 3907 function __metadata(metadataKey, metadataValue) { 3908 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); 3909 } 3910 3911 function __awaiter(thisArg, _arguments, P, generator) { 3912 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 3913 return new (P || (P = Promise))(function (resolve, reject) { 3914 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 3915 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 3916 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 3917 step((generator = generator.apply(thisArg, _arguments || [])).next()); 3918 }); 3919 } 3920 3921 function __generator(thisArg, body) { 3922 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 3923 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 3924 function verb(n) { return function (v) { return step([n, v]); }; } 3925 function step(op) { 3926 if (f) throw new TypeError("Generator is already executing."); 3927 while (_) try { 3928 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 3929 if (y = 0, t) op = [op[0] & 2, t.value]; 3930 switch (op[0]) { 3931 case 0: case 1: t = op; break; 3932 case 4: _.label++; return { value: op[1], done: false }; 3933 case 5: _.label++; y = op[1]; op = [0]; continue; 3934 case 7: op = _.ops.pop(); _.trys.pop(); continue; 3935 default: 3936 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 3937 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 3938 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 3939 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 3940 if (t[2]) _.ops.pop(); 3941 _.trys.pop(); continue; 3942 } 3943 op = body.call(thisArg, _); 3944 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 3945 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 3946 } 3947 } 3948 3949 var __createBinding = Object.create ? (function(o, m, k, k2) { 3950 if (k2 === undefined) k2 = k; 3951 Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); 3952 }) : (function(o, m, k, k2) { 3953 if (k2 === undefined) k2 = k; 3954 o[k2] = m[k]; 3955 }); 3956 3957 function __exportStar(m, o) { 3958 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); 3959 } 3960 3961 function __values(o) { 3962 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; 3963 if (m) return m.call(o); 3964 if (o && typeof o.length === "number") return { 3965 next: function () { 3966 if (o && i >= o.length) o = void 0; 3967 return { value: o && o[i++], done: !o }; 3968 } 3969 }; 3970 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); 3971 } 3972 3973 function __read(o, n) { 3974 var m = typeof Symbol === "function" && o[Symbol.iterator]; 3975 if (!m) return o; 3976 var i = m.call(o), r, ar = [], e; 3977 try { 3978 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 3979 } 3980 catch (error) { e = { error: error }; } 3981 finally { 3982 try { 3983 if (r && !r.done && (m = i["return"])) m.call(i); 3984 } 3985 finally { if (e) throw e.error; } 3986 } 3987 return ar; 3988 } 3989 3990 function __spread() { 3991 for (var ar = [], i = 0; i < arguments.length; i++) 3992 ar = ar.concat(__read(arguments[i])); 3993 return ar; 3994 } 3995 3996 function __spreadArrays() { 3997 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 3998 for (var r = Array(s), k = 0, i = 0; i < il; i++) 3999 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 4000 r[k] = a[j]; 4001 return r; 4002 }; 4003 4004 function __await(v) { 4005 return this instanceof __await ? (this.v = v, this) : new __await(v); 4006 } 4007 4008 function __asyncGenerator(thisArg, _arguments, generator) { 4009 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 4010 var g = generator.apply(thisArg, _arguments || []), i, q = []; 4011 return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; 4012 function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } 4013 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } 4014 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } 4015 function fulfill(value) { resume("next", value); } 4016 function reject(value) { resume("throw", value); } 4017 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } 4018 } 4019 4020 function __asyncDelegator(o) { 4021 var i, p; 4022 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 4023 function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } 4024 } 4025 4026 function __asyncValues(o) { 4027 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 4028 var m = o[Symbol.asyncIterator], i; 4029 return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); 4030 function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } 4031 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } 4032 } 4033 4034 function __makeTemplateObject(cooked, raw) { 4035 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 4036 return cooked; 4037 }; 4038 4039 var __setModuleDefault = Object.create ? (function(o, v) { 4040 Object.defineProperty(o, "default", { enumerable: true, value: v }); 4041 }) : function(o, v) { 4042 o["default"] = v; 4043 }; 4044 4045 function __importStar(mod) { 4046 if (mod && mod.__esModule) return mod; 4047 var result = {}; 4048 if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); 4049 __setModuleDefault(result, mod); 4050 return result; 4051 } 4052 4053 function __importDefault(mod) { 4054 return (mod && mod.__esModule) ? mod : { default: mod }; 4055 } 4056 4057 function __classPrivateFieldGet(receiver, privateMap) { 4058 if (!privateMap.has(receiver)) { 4059 throw new TypeError("attempted to get private field on non-instance"); 4060 } 4061 return privateMap.get(receiver); 4062 } 4063 4064 function __classPrivateFieldSet(receiver, privateMap, value) { 4065 if (!privateMap.has(receiver)) { 4066 throw new TypeError("attempted to set private field on non-instance"); 4067 } 4068 privateMap.set(receiver, value); 4069 return value; 4070 } 4071 4072 // EXTERNAL MODULE: external {"this":"React"} 4073 var external_this_React_ = __webpack_require__(13); 4074 var external_this_React_default = /*#__PURE__*/__webpack_require__.n(external_this_React_); 4075 4076 // EXTERNAL MODULE: ./node_modules/normalize-wheel/index.js 4077 var normalize_wheel = __webpack_require__(282); 4078 var normalize_wheel_default = /*#__PURE__*/__webpack_require__.n(normalize_wheel); 4079 4080 // CONCATENATED MODULE: ./node_modules/react-easy-crop/index.module.js 4081 4082 4083 4084 4085 /** 4086 * Compute the dimension of the crop area based on media size, 4087 * aspect ratio and optionally rotation 4088 */ 4089 4090 function getCropSize(mediaWidth, mediaHeight, containerWidth, containerHeight, aspect, rotation) { 4091 if (rotation === void 0) { 4092 rotation = 0; 4093 } 4094 4095 var _a = translateSize(mediaWidth, mediaHeight, rotation), 4096 width = _a.width, 4097 height = _a.height; 4098 4099 var fittingWidth = Math.min(width, containerWidth); 4100 var fittingHeight = Math.min(height, containerHeight); 4101 4102 if (fittingWidth > fittingHeight * aspect) { 4103 return { 4104 width: fittingHeight * aspect, 4105 height: fittingHeight 4106 }; 4107 } 4108 4109 return { 4110 width: fittingWidth, 4111 height: fittingWidth / aspect 4112 }; 4113 } 4114 /** 4115 * Ensure a new media position stays in the crop area. 4116 */ 4117 4118 function index_module_restrictPosition(position, mediaSize, cropSize, zoom, rotation) { 4119 if (rotation === void 0) { 4120 rotation = 0; 4121 } 4122 4123 var _a = translateSize(mediaSize.width, mediaSize.height, rotation), 4124 width = _a.width, 4125 height = _a.height; 4126 4127 return { 4128 x: restrictPositionCoord(position.x, width, cropSize.width, zoom), 4129 y: restrictPositionCoord(position.y, height, cropSize.height, zoom) 4130 }; 4131 } 4132 4133 function restrictPositionCoord(position, mediaSize, cropSize, zoom) { 4134 var maxPosition = mediaSize * zoom / 2 - cropSize / 2; 4135 return Math.min(maxPosition, Math.max(position, -maxPosition)); 4136 } 4137 4138 function getDistanceBetweenPoints(pointA, pointB) { 4139 return Math.sqrt(Math.pow(pointA.y - pointB.y, 2) + Math.pow(pointA.x - pointB.x, 2)); 4140 } 4141 function getRotationBetweenPoints(pointA, pointB) { 4142 return Math.atan2(pointB.y - pointA.y, pointB.x - pointA.x) * 180 / Math.PI; 4143 } 4144 /** 4145 * Compute the output cropped area of the media in percentages and pixels. 4146 * x/y are the top-left coordinates on the src media 4147 */ 4148 4149 function computeCroppedArea(crop, mediaSize, cropSize, aspect, zoom, rotation, restrictPosition) { 4150 if (rotation === void 0) { 4151 rotation = 0; 4152 } 4153 4154 if (restrictPosition === void 0) { 4155 restrictPosition = true; 4156 } // if the media is rotated by the user, we cannot limit the position anymore 4157 // as it might need to be negative. 4158 4159 4160 var limitAreaFn = restrictPosition && rotation === 0 ? limitArea : noOp; 4161 var croppedAreaPercentages = { 4162 x: limitAreaFn(100, ((mediaSize.width - cropSize.width / zoom) / 2 - crop.x / zoom) / mediaSize.width * 100), 4163 y: limitAreaFn(100, ((mediaSize.height - cropSize.height / zoom) / 2 - crop.y / zoom) / mediaSize.height * 100), 4164 width: limitAreaFn(100, cropSize.width / mediaSize.width * 100 / zoom), 4165 height: limitAreaFn(100, cropSize.height / mediaSize.height * 100 / zoom) 4166 }; // we compute the pixels size naively 4167 4168 var widthInPixels = Math.round(limitAreaFn(mediaSize.naturalWidth, croppedAreaPercentages.width * mediaSize.naturalWidth / 100)); 4169 var heightInPixels = Math.round(limitAreaFn(mediaSize.naturalHeight, croppedAreaPercentages.height * mediaSize.naturalHeight / 100)); 4170 var isImgWiderThanHigh = mediaSize.naturalWidth >= mediaSize.naturalHeight * aspect; // then we ensure the width and height exactly match the aspect (to avoid rounding approximations) 4171 // if the media is wider than high, when zoom is 0, the crop height will be equals to iamge height 4172 // thus we want to compute the width from the height and aspect for accuracy. 4173 // Otherwise, we compute the height from width and aspect. 4174 4175 var sizePixels = isImgWiderThanHigh ? { 4176 width: Math.round(heightInPixels * aspect), 4177 height: heightInPixels 4178 } : { 4179 width: widthInPixels, 4180 height: Math.round(widthInPixels / aspect) 4181 }; 4182 4183 var croppedAreaPixels = __assign(__assign({}, sizePixels), { 4184 x: Math.round(limitAreaFn(mediaSize.naturalWidth - sizePixels.width, croppedAreaPercentages.x * mediaSize.naturalWidth / 100)), 4185 y: Math.round(limitAreaFn(mediaSize.naturalHeight - sizePixels.height, croppedAreaPercentages.y * mediaSize.naturalHeight / 100)) 4186 }); 4187 4188 return { 4189 croppedAreaPercentages: croppedAreaPercentages, 4190 croppedAreaPixels: croppedAreaPixels 4191 }; 4192 } 4193 /** 4194 * Ensure the returned value is between 0 and max 4195 */ 4196 4197 function limitArea(max, value) { 4198 return Math.min(max, Math.max(0, value)); 4199 } 4200 4201 function noOp(_max, value) { 4202 return value; 4203 } 4204 /** 4205 * Compute the crop and zoom from the croppedAreaPixels 4206 */ 4207 4208 4209 function getZoomFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize) { 4210 var mediaZoom = mediaSize.width / mediaSize.naturalWidth; 4211 4212 if (cropSize) { 4213 var isHeightMaxSize_1 = cropSize.height > cropSize.width; 4214 return isHeightMaxSize_1 ? cropSize.height / mediaZoom / croppedAreaPixels.height : cropSize.width / mediaZoom / croppedAreaPixels.width; 4215 } 4216 4217 var aspect = croppedAreaPixels.width / croppedAreaPixels.height; 4218 var isHeightMaxSize = mediaSize.naturalWidth >= mediaSize.naturalHeight * aspect; 4219 return isHeightMaxSize ? mediaSize.naturalHeight / croppedAreaPixels.height : mediaSize.naturalWidth / croppedAreaPixels.width; 4220 } 4221 /** 4222 * Compute the crop and zoom from the croppedAreaPixels 4223 */ 4224 4225 4226 function getInitialCropFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize) { 4227 var mediaZoom = mediaSize.width / mediaSize.naturalWidth; 4228 var zoom = getZoomFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize); 4229 var cropZoom = mediaZoom * zoom; 4230 var crop = { 4231 x: ((mediaSize.naturalWidth - croppedAreaPixels.width) / 2 - croppedAreaPixels.x) * cropZoom, 4232 y: ((mediaSize.naturalHeight - croppedAreaPixels.height) / 2 - croppedAreaPixels.y) * cropZoom 4233 }; 4234 return { 4235 crop: crop, 4236 zoom: zoom 4237 }; 4238 } 4239 /** 4240 * Return the point that is the center of point a and b 4241 */ 4242 4243 function getCenter(a, b) { 4244 return { 4245 x: (b.x + a.x) / 2, 4246 y: (b.y + a.y) / 2 4247 }; 4248 } 4249 /** 4250 * 4251 * Returns an x,y point once rotated around xMid,yMid 4252 */ 4253 4254 function rotateAroundMidPoint(x, y, xMid, yMid, degrees) { 4255 var cos = Math.cos; 4256 var sin = Math.sin; 4257 var radian = degrees * Math.PI / 180; // Convert to radians 4258 // Subtract midpoints, so that midpoint is translated to origin 4259 // and add it in the end again 4260 4261 var xr = (x - xMid) * cos(radian) - (y - yMid) * sin(radian) + xMid; 4262 var yr = (x - xMid) * sin(radian) + (y - yMid) * cos(radian) + yMid; 4263 return [xr, yr]; 4264 } 4265 /** 4266 * Returns the new bounding area of a rotated rectangle. 4267 */ 4268 4269 function translateSize(width, height, rotation) { 4270 var centerX = width / 2; 4271 var centerY = height / 2; 4272 var outerBounds = [rotateAroundMidPoint(0, 0, centerX, centerY, rotation), rotateAroundMidPoint(width, 0, centerX, centerY, rotation), rotateAroundMidPoint(width, height, centerX, centerY, rotation), rotateAroundMidPoint(0, height, centerX, centerY, rotation)]; 4273 var minX = Math.min.apply(Math, outerBounds.map(function (p) { 4274 return p[0]; 4275 })); 4276 var maxX = Math.max.apply(Math, outerBounds.map(function (p) { 4277 return p[0]; 4278 })); 4279 var minY = Math.min.apply(Math, outerBounds.map(function (p) { 4280 return p[1]; 4281 })); 4282 var maxY = Math.max.apply(Math, outerBounds.map(function (p) { 4283 return p[1]; 4284 })); 4285 return { 4286 width: maxX - minX, 4287 height: maxY - minY 4288 }; 4289 } 4290 /** 4291 * Combine multiple class names into a single string. 4292 */ 4293 4294 function index_module_classNames() { 4295 var args = []; 4296 4297 for (var _i = 0; _i < arguments.length; _i++) { 4298 args[_i] = arguments[_i]; 4299 } 4300 4301 return args.filter(function (value) { 4302 if (typeof value === 'string' && value.length > 0) { 4303 return true; 4304 } 4305 4306 return false; 4307 }).join(' ').trim(); 4308 } 4309 4310 var css_248z = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n"; 4311 4312 var MIN_ZOOM = 1; 4313 var MAX_ZOOM = 3; 4314 4315 var index_module_Cropper = 4316 /** @class */ 4317 function (_super) { 4318 __extends(Cropper, _super); 4319 4320 function Cropper() { 4321 var _this = _super !== null && _super.apply(this, arguments) || this; 4322 4323 _this.imageRef = null; 4324 _this.videoRef = null; 4325 _this.containerRef = null; 4326 _this.styleRef = null; 4327 _this.containerRect = null; 4328 _this.mediaSize = { 4329 width: 0, 4330 height: 0, 4331 naturalWidth: 0, 4332 naturalHeight: 0 4333 }; 4334 _this.dragStartPosition = { 4335 x: 0, 4336 y: 0 4337 }; 4338 _this.dragStartCrop = { 4339 x: 0, 4340 y: 0 4341 }; 4342 _this.lastPinchDistance = 0; 4343 _this.lastPinchRotation = 0; 4344 _this.rafDragTimeout = null; 4345 _this.rafPinchTimeout = null; 4346 _this.wheelTimer = null; 4347 _this.state = { 4348 cropSize: null, 4349 hasWheelJustStarted: false 4350 }; // this is to prevent Safari on iOS >= 10 to zoom the page 4351 4352 _this.preventZoomSafari = function (e) { 4353 return e.preventDefault(); 4354 }; 4355 4356 _this.cleanEvents = function () { 4357 document.removeEventListener('mousemove', _this.onMouseMove); 4358 document.removeEventListener('mouseup', _this.onDragStopped); 4359 document.removeEventListener('touchmove', _this.onTouchMove); 4360 document.removeEventListener('touchend', _this.onDragStopped); 4361 }; 4362 4363 _this.clearScrollEvent = function () { 4364 if (_this.containerRef) _this.containerRef.removeEventListener('wheel', _this.onWheel); 4365 4366 if (_this.wheelTimer) { 4367 clearTimeout(_this.wheelTimer); 4368 } 4369 }; 4370 4371 _this.onMediaLoad = function () { 4372 _this.computeSizes(); 4373 4374 _this.emitCropData(); 4375 4376 _this.setInitialCrop(); 4377 4378 if (_this.props.onMediaLoaded) { 4379 _this.props.onMediaLoaded(_this.mediaSize); 4380 } 4381 }; 4382 4383 _this.setInitialCrop = function () { 4384 var _a = _this.props, 4385 initialCroppedAreaPixels = _a.initialCroppedAreaPixels, 4386 cropSize = _a.cropSize; 4387 4388 if (!initialCroppedAreaPixels) { 4389 return; 4390 } 4391 4392 var _b = getInitialCropFromCroppedAreaPixels(initialCroppedAreaPixels, _this.mediaSize, cropSize), 4393 crop = _b.crop, 4394 zoom = _b.zoom; 4395 4396 _this.props.onCropChange(crop); 4397 4398 _this.props.onZoomChange && _this.props.onZoomChange(zoom); 4399 }; 4400 4401 _this.computeSizes = function () { 4402 var _a, _b, _c, _d, _e, _f; 4403 4404 var mediaRef = _this.imageRef || _this.videoRef; 4405 4406 if (mediaRef && _this.containerRef) { 4407 _this.containerRect = _this.containerRef.getBoundingClientRect(); 4408 _this.mediaSize = { 4409 width: mediaRef.offsetWidth, 4410 height: mediaRef.offsetHeight, 4411 naturalWidth: ((_a = _this.imageRef) === null || _a === void 0 ? void 0 : _a.naturalWidth) || ((_b = _this.videoRef) === null || _b === void 0 ? void 0 : _b.videoWidth) || 0, 4412 naturalHeight: ((_c = _this.imageRef) === null || _c === void 0 ? void 0 : _c.naturalHeight) || ((_d = _this.videoRef) === null || _d === void 0 ? void 0 : _d.videoHeight) || 0 4413 }; 4414 var cropSize = _this.props.cropSize ? _this.props.cropSize : getCropSize(mediaRef.offsetWidth, mediaRef.offsetHeight, _this.containerRect.width, _this.containerRect.height, _this.props.aspect, _this.props.rotation); 4415 4416 if (((_e = _this.state.cropSize) === null || _e === void 0 ? void 0 : _e.height) !== cropSize.height || ((_f = _this.state.cropSize) === null || _f === void 0 ? void 0 : _f.width) !== cropSize.width) { 4417 _this.props.onCropSizeChange && _this.props.onCropSizeChange(cropSize); 4418 } 4419 4420 _this.setState({ 4421 cropSize: cropSize 4422 }, _this.recomputeCropPosition); 4423 } 4424 }; 4425 4426 _this.onMouseDown = function (e) { 4427 e.preventDefault(); 4428 document.addEventListener('mousemove', _this.onMouseMove); 4429 document.addEventListener('mouseup', _this.onDragStopped); 4430 4431 _this.onDragStart(Cropper.getMousePoint(e)); 4432 }; 4433 4434 _this.onMouseMove = function (e) { 4435 return _this.onDrag(Cropper.getMousePoint(e)); 4436 }; 4437 4438 _this.onTouchStart = function (e) { 4439 e.preventDefault(); 4440 document.addEventListener('touchmove', _this.onTouchMove, { 4441 passive: false 4442 }); // iOS 11 now defaults to passive: true 4443 4444 document.addEventListener('touchend', _this.onDragStopped); 4445 4446 if (e.touches.length === 2) { 4447 _this.onPinchStart(e); 4448 } else if (e.touches.length === 1) { 4449 _this.onDragStart(Cropper.getTouchPoint(e.touches[0])); 4450 } 4451 }; 4452 4453 _this.onTouchMove = function (e) { 4454 // Prevent whole page from scrolling on iOS. 4455 e.preventDefault(); 4456 4457 if (e.touches.length === 2) { 4458 _this.onPinchMove(e); 4459 } else if (e.touches.length === 1) { 4460 _this.onDrag(Cropper.getTouchPoint(e.touches[0])); 4461 } 4462 }; 4463 4464 _this.onDragStart = function (_a) { 4465 var _b, _c; 4466 4467 var x = _a.x, 4468 y = _a.y; 4469 _this.dragStartPosition = { 4470 x: x, 4471 y: y 4472 }; 4473 _this.dragStartCrop = __assign({}, _this.props.crop); 4474 (_c = (_b = _this.props).onInteractionStart) === null || _c === void 0 ? void 0 : _c.call(_b); 4475 }; 4476 4477 _this.onDrag = function (_a) { 4478 var x = _a.x, 4479 y = _a.y; 4480 if (_this.rafDragTimeout) window.cancelAnimationFrame(_this.rafDragTimeout); 4481 _this.rafDragTimeout = window.requestAnimationFrame(function () { 4482 if (!_this.state.cropSize) return; 4483 if (x === undefined || y === undefined) return; 4484 var offsetX = x - _this.dragStartPosition.x; 4485 var offsetY = y - _this.dragStartPosition.y; 4486 var requestedPosition = { 4487 x: _this.dragStartCrop.x + offsetX, 4488 y: _this.dragStartCrop.y + offsetY 4489 }; 4490 var newPosition = _this.props.restrictPosition ? index_module_restrictPosition(requestedPosition, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : requestedPosition; 4491 4492 _this.props.onCropChange(newPosition); 4493 }); 4494 }; 4495 4496 _this.onDragStopped = function () { 4497 var _a, _b; 4498 4499 _this.cleanEvents(); 4500 4501 _this.emitCropData(); 4502 4503 (_b = (_a = _this.props).onInteractionEnd) === null || _b === void 0 ? void 0 : _b.call(_a); 4504 }; 4505 4506 _this.onWheel = function (e) { 4507 e.preventDefault(); 4508 var point = Cropper.getMousePoint(e); 4509 var pixelY = normalize_wheel_default()(e).pixelY; 4510 var newZoom = _this.props.zoom - pixelY * _this.props.zoomSpeed / 200; 4511 4512 _this.setNewZoom(newZoom, point); 4513 4514 if (!_this.state.hasWheelJustStarted) { 4515 _this.setState({ 4516 hasWheelJustStarted: true 4517 }, function () { 4518 var _a, _b; 4519 4520 return (_b = (_a = _this.props).onInteractionStart) === null || _b === void 0 ? void 0 : _b.call(_a); 4521 }); 4522 } 4523 4524 if (_this.wheelTimer) { 4525 clearTimeout(_this.wheelTimer); 4526 } 4527 4528 _this.wheelTimer = window.setTimeout(function () { 4529 return _this.setState({ 4530 hasWheelJustStarted: false 4531 }, function () { 4532 var _a, _b; 4533 4534 return (_b = (_a = _this.props).onInteractionEnd) === null || _b === void 0 ? void 0 : _b.call(_a); 4535 }); 4536 }, 250); 4537 }; 4538 4539 _this.getPointOnContainer = function (_a) { 4540 var x = _a.x, 4541 y = _a.y; 4542 4543 if (!_this.containerRect) { 4544 throw new Error('The Cropper is not mounted'); 4545 } 4546 4547 return { 4548 x: _this.containerRect.width / 2 - (x - _this.containerRect.left), 4549 y: _this.containerRect.height / 2 - (y - _this.containerRect.top) 4550 }; 4551 }; 4552 4553 _this.getPointOnMedia = function (_a) { 4554 var x = _a.x, 4555 y = _a.y; 4556 var _b = _this.props, 4557 crop = _b.crop, 4558 zoom = _b.zoom; 4559 return { 4560 x: (x + crop.x) / zoom, 4561 y: (y + crop.y) / zoom 4562 }; 4563 }; 4564 4565 _this.setNewZoom = function (zoom, point) { 4566 if (!_this.state.cropSize || !_this.props.onZoomChange) return; 4567 4568 var zoomPoint = _this.getPointOnContainer(point); 4569 4570 var zoomTarget = _this.getPointOnMedia(zoomPoint); 4571 4572 var newZoom = Math.min(_this.props.maxZoom, Math.max(zoom, _this.props.minZoom)); 4573 var requestedPosition = { 4574 x: zoomTarget.x * newZoom - zoomPoint.x, 4575 y: zoomTarget.y * newZoom - zoomPoint.y 4576 }; 4577 var newPosition = _this.props.restrictPosition ? index_module_restrictPosition(requestedPosition, _this.mediaSize, _this.state.cropSize, newZoom, _this.props.rotation) : requestedPosition; 4578 4579 _this.props.onCropChange(newPosition); 4580 4581 _this.props.onZoomChange(newZoom); 4582 }; 4583 4584 _this.getCropData = function () { 4585 if (!_this.state.cropSize) { 4586 return null; 4587 } // this is to ensure the crop is correctly restricted after a zoom back (https://github.com/ricardo-ch/react-easy-crop/issues/6) 4588 4589 4590 var restrictedPosition = _this.props.restrictPosition ? index_module_restrictPosition(_this.props.crop, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : _this.props.crop; 4591 return computeCroppedArea(restrictedPosition, _this.mediaSize, _this.state.cropSize, _this.getAspect(), _this.props.zoom, _this.props.rotation, _this.props.restrictPosition); 4592 }; 4593 4594 _this.emitCropData = function () { 4595 var cropData = _this.getCropData(); 4596 4597 if (!cropData) return; 4598 var croppedAreaPercentages = cropData.croppedAreaPercentages, 4599 croppedAreaPixels = cropData.croppedAreaPixels; 4600 4601 if (_this.props.onCropComplete) { 4602 _this.props.onCropComplete(croppedAreaPercentages, croppedAreaPixels); 4603 } 4604 4605 if (_this.props.onCropAreaChange) { 4606 _this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels); 4607 } 4608 }; 4609 4610 _this.emitCropAreaChange = function () { 4611 var cropData = _this.getCropData(); 4612 4613 if (!cropData) return; 4614 var croppedAreaPercentages = cropData.croppedAreaPercentages, 4615 croppedAreaPixels = cropData.croppedAreaPixels; 4616 4617 if (_this.props.onCropAreaChange) { 4618 _this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels); 4619 } 4620 }; 4621 4622 _this.recomputeCropPosition = function () { 4623 if (!_this.state.cropSize) return; 4624 var newPosition = _this.props.restrictPosition ? index_module_restrictPosition(_this.props.crop, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : _this.props.crop; 4625 4626 _this.props.onCropChange(newPosition); 4627 4628 _this.emitCropData(); 4629 }; 4630 4631 return _this; 4632 } 4633 4634 Cropper.prototype.componentDidMount = function () { 4635 window.addEventListener('resize', this.computeSizes); 4636 4637 if (this.containerRef) { 4638 this.props.zoomWithScroll && this.containerRef.addEventListener('wheel', this.onWheel, { 4639 passive: false 4640 }); 4641 this.containerRef.addEventListener('gesturestart', this.preventZoomSafari); 4642 this.containerRef.addEventListener('gesturechange', this.preventZoomSafari); 4643 } 4644 4645 if (!this.props.disableAutomaticStylesInjection) { 4646 this.styleRef = document.createElement('style'); 4647 this.styleRef.setAttribute('type', 'text/css'); 4648 this.styleRef.innerHTML = css_248z; 4649 document.head.appendChild(this.styleRef); 4650 } // when rendered via SSR, the image can already be loaded and its onLoad callback will never be called 4651 4652 4653 if (this.imageRef && this.imageRef.complete) { 4654 this.onMediaLoad(); 4655 } 4656 }; 4657 4658 Cropper.prototype.componentWillUnmount = function () { 4659 window.removeEventListener('resize', this.computeSizes); 4660 4661 if (this.containerRef) { 4662 this.containerRef.removeEventListener('gesturestart', this.preventZoomSafari); 4663 this.containerRef.removeEventListener('gesturechange', this.preventZoomSafari); 4664 } 4665 4666 if (this.styleRef) { 4667 this.styleRef.remove(); 4668 } 4669 4670 this.cleanEvents(); 4671 this.props.zoomWithScroll && this.clearScrollEvent(); 4672 }; 4673 4674 Cropper.prototype.componentDidUpdate = function (prevProps) { 4675 var _a, _b, _c, _d, _e, _f, _g, _h; 4676 4677 if (prevProps.rotation !== this.props.rotation) { 4678 this.computeSizes(); 4679 this.recomputeCropPosition(); 4680 } else if (prevProps.aspect !== this.props.aspect) { 4681 this.computeSizes(); 4682 } else if (prevProps.zoom !== this.props.zoom) { 4683 this.recomputeCropPosition(); 4684 } else if (((_a = prevProps.cropSize) === null || _a === void 0 ? void 0 : _a.height) !== ((_b = this.props.cropSize) === null || _b === void 0 ? void 0 : _b.height) || ((_c = prevProps.cropSize) === null || _c === void 0 ? void 0 : _c.width) !== ((_d = this.props.cropSize) === null || _d === void 0 ? void 0 : _d.width)) { 4685 this.computeSizes(); 4686 } else if (((_e = prevProps.crop) === null || _e === void 0 ? void 0 : _e.x) !== ((_f = this.props.crop) === null || _f === void 0 ? void 0 : _f.x) || ((_g = prevProps.crop) === null || _g === void 0 ? void 0 : _g.y) !== ((_h = this.props.crop) === null || _h === void 0 ? void 0 : _h.y)) { 4687 this.emitCropAreaChange(); 4688 } 4689 4690 if (prevProps.zoomWithScroll !== this.props.zoomWithScroll && this.containerRef) { 4691 this.props.zoomWithScroll ? this.containerRef.addEventListener('wheel', this.onWheel, { 4692 passive: false 4693 }) : this.clearScrollEvent(); 4694 } 4695 }; 4696 4697 Cropper.prototype.getAspect = function () { 4698 var _a = this.props, 4699 cropSize = _a.cropSize, 4700 aspect = _a.aspect; 4701 4702 if (cropSize) { 4703 return cropSize.width / cropSize.height; 4704 } 4705 4706 return aspect; 4707 }; 4708 4709 Cropper.prototype.onPinchStart = function (e) { 4710 var pointA = Cropper.getTouchPoint(e.touches[0]); 4711 var pointB = Cropper.getTouchPoint(e.touches[1]); 4712 this.lastPinchDistance = getDistanceBetweenPoints(pointA, pointB); 4713 this.lastPinchRotation = getRotationBetweenPoints(pointA, pointB); 4714 this.onDragStart(getCenter(pointA, pointB)); 4715 }; 4716 4717 Cropper.prototype.onPinchMove = function (e) { 4718 var _this = this; 4719 4720 var pointA = Cropper.getTouchPoint(e.touches[0]); 4721 var pointB = Cropper.getTouchPoint(e.touches[1]); 4722 var center = getCenter(pointA, pointB); 4723 this.onDrag(center); 4724 if (this.rafPinchTimeout) window.cancelAnimationFrame(this.rafPinchTimeout); 4725 this.rafPinchTimeout = window.requestAnimationFrame(function () { 4726 var distance = getDistanceBetweenPoints(pointA, pointB); 4727 var newZoom = _this.props.zoom * (distance / _this.lastPinchDistance); 4728 4729 _this.setNewZoom(newZoom, center); 4730 4731 _this.lastPinchDistance = distance; 4732 var rotation = getRotationBetweenPoints(pointA, pointB); 4733 var newRotation = _this.props.rotation + (rotation - _this.lastPinchRotation); 4734 _this.props.onRotationChange && _this.props.onRotationChange(newRotation); 4735 _this.lastPinchRotation = rotation; 4736 }); 4737 }; 4738 4739 Cropper.prototype.render = function () { 4740 var _this = this; 4741 4742 var _a = this.props, 4743 image = _a.image, 4744 video = _a.video, 4745 mediaProps = _a.mediaProps, 4746 transform = _a.transform, 4747 _b = _a.crop, 4748 x = _b.x, 4749 y = _b.y, 4750 rotation = _a.rotation, 4751 zoom = _a.zoom, 4752 cropShape = _a.cropShape, 4753 showGrid = _a.showGrid, 4754 _c = _a.style, 4755 containerStyle = _c.containerStyle, 4756 cropAreaStyle = _c.cropAreaStyle, 4757 mediaStyle = _c.mediaStyle, 4758 _d = _a.classes, 4759 containerClassName = _d.containerClassName, 4760 cropAreaClassName = _d.cropAreaClassName, 4761 mediaClassName = _d.mediaClassName; 4762 return /*#__PURE__*/external_this_React_default.a.createElement("div", { 4763 onMouseDown: this.onMouseDown, 4764 onTouchStart: this.onTouchStart, 4765 ref: function ref(el) { 4766 return _this.containerRef = el; 4767 }, 4768 "data-testid": "container", 4769 style: containerStyle, 4770 className: index_module_classNames('reactEasyCrop_Container', containerClassName) 4771 }, image ? /*#__PURE__*/external_this_React_default.a.createElement("img", __assign({ 4772 alt: "", 4773 className: index_module_classNames('reactEasyCrop_Image', mediaClassName) 4774 }, mediaProps, { 4775 src: image, 4776 ref: function ref(el) { 4777 return _this.imageRef = el; 4778 }, 4779 style: __assign(__assign({}, mediaStyle), { 4780 transform: transform || "translate(" + x + "px, " + y + "px) rotate(" + rotation + "deg) scale(" + zoom + ")" 4781 }), 4782 onLoad: this.onMediaLoad 4783 })) : video && /*#__PURE__*/external_this_React_default.a.createElement("video", __assign({ 4784 autoPlay: true, 4785 loop: true, 4786 muted: true, 4787 className: index_module_classNames('reactEasyCrop_Video', mediaClassName) 4788 }, mediaProps, { 4789 src: video, 4790 ref: function ref(el) { 4791 return _this.videoRef = el; 4792 }, 4793 onLoadedMetadata: this.onMediaLoad, 4794 style: __assign(__assign({}, mediaStyle), { 4795 transform: transform || "translate(" + x + "px, " + y + "px) rotate(" + rotation + "deg) scale(" + zoom + ")" 4796 }), 4797 controls: false 4798 })), this.state.cropSize && /*#__PURE__*/external_this_React_default.a.createElement("div", { 4799 style: __assign(__assign({}, cropAreaStyle), { 4800 width: this.state.cropSize.width, 4801 height: this.state.cropSize.height 4802 }), 4803 "data-testid": "cropper", 4804 className: index_module_classNames('reactEasyCrop_CropArea', cropShape === 'round' && 'reactEasyCrop_CropAreaRound', showGrid && 'reactEasyCrop_CropAreaGrid', cropAreaClassName) 4805 })); 4806 }; 4807 4808 Cropper.defaultProps = { 4809 zoom: 1, 4810 rotation: 0, 4811 aspect: 4 / 3, 4812 maxZoom: MAX_ZOOM, 4813 minZoom: MIN_ZOOM, 4814 cropShape: 'rect', 4815 showGrid: true, 4816 style: {}, 4817 classes: {}, 4818 mediaProps: {}, 4819 zoomSpeed: 1, 4820 restrictPosition: true, 4821 zoomWithScroll: true 4822 }; 4823 4824 Cropper.getMousePoint = function (e) { 4825 return { 4826 x: Number(e.clientX), 4827 y: Number(e.clientY) 4828 }; 4829 }; 4830 4831 Cropper.getTouchPoint = function (touch) { 4832 return { 4833 x: Number(touch.clientX), 4834 y: Number(touch.clientY) 4835 }; 4836 }; 4837 4838 return Cropper; 4839 }(external_this_React_default.a.Component); 4840 4841 /* harmony default export */ var index_module = (index_module_Cropper); 4842 4843 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js 4844 var check = __webpack_require__(161); 4845 4846 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/aspect-ratio.js 4847 4848 4849 /** 4850 * WordPress dependencies 4851 */ 4852 4853 var aspect_ratio_aspectRatio = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], { 4854 xmlns: "http://www.w3.org/2000/svg", 4855 viewBox: "0 0 24 24" 4856 }, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], { 4857 d: "M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z" 4858 })); 4859 /* harmony default export */ var aspect_ratio = (aspect_ratio_aspectRatio); 4860 4861 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js 4862 var search = __webpack_require__(307); 4863 4864 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/rotate-right.js 4865 4866 4867 /** 4868 * WordPress dependencies 4869 */ 4870 4871 var rotateRight = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], { 4872 xmlns: "http://www.w3.org/2000/svg", 4873 viewBox: "0 0 24 24" 4874 }, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], { 4875 d: "M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z" 4876 })); 4877 /* harmony default export */ var rotate_right = (rotateRight); 4878 4879 // EXTERNAL MODULE: external {"this":["wp","apiFetch"]} 4880 var external_this_wp_apiFetch_ = __webpack_require__(47); 4881 var external_this_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_apiFetch_); 4882 4883 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image-editor.js 4884 4885 4886 4887 /** 4888 * External dependencies 4889 */ 4890 4891 4892 /** 4893 * WordPress dependencies 4894 */ 4895 4896 4897 4898 4899 4900 4901 4902 4903 var image_editor_MIN_ZOOM = 100; 4904 var image_editor_MAX_ZOOM = 300; 4905 var POPOVER_PROPS = { 4906 position: 'bottom right', 4907 isAlternate: true 4908 }; 4909 4910 function AspectGroup(_ref) { 4911 var aspectRatios = _ref.aspectRatios, 4912 isDisabled = _ref.isDisabled, 4913 label = _ref.label, 4914 _onClick = _ref.onClick, 4915 value = _ref.value; 4916 return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["MenuGroup"], { 4917 label: label 4918 }, aspectRatios.map(function (_ref2) { 4919 var title = _ref2.title, 4920 aspect = _ref2.aspect; 4921 return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["MenuItem"], { 4922 key: aspect, 4923 disabled: isDisabled, 4924 onClick: function onClick() { 4925 _onClick(aspect); 4926 }, 4927 role: "menuitemradio", 4928 isSelected: aspect === value, 4929 icon: aspect === value ? check["a" /* default */] : undefined 4930 }, title); 4931 })); 4932 } 4933 4934 function AspectMenu(_ref3) { 4935 var toggleProps = _ref3.toggleProps, 4936 isDisabled = _ref3.isDisabled, 4937 _onClick2 = _ref3.onClick, 4938 value = _ref3.value, 4939 defaultValue = _ref3.defaultValue; 4940 return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["DropdownMenu"], { 4941 icon: aspect_ratio, 4942 label: Object(external_this_wp_i18n_["__"])('Aspect Ratio'), 4943 popoverProps: POPOVER_PROPS, 4944 toggleProps: toggleProps, 4945 className: "wp-block-image__aspect-ratio" 4946 }, function (_ref4) { 4947 var onClose = _ref4.onClose; 4948 return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(AspectGroup, { 4949 isDisabled: isDisabled, 4950 onClick: function onClick(aspect) { 4951 _onClick2(aspect); 4952 4953 onClose(); 4954 }, 4955 value: value, 4956 aspectRatios: [{ 4957 title: Object(external_this_wp_i18n_["__"])('Original'), 4958 aspect: defaultValue 4959 }, { 4960 title: Object(external_this_wp_i18n_["__"])('Square'), 4961 aspect: 1 4962 }] 4963 }), Object(external_this_wp_element_["createElement"])(AspectGroup, { 4964 label: Object(external_this_wp_i18n_["__"])('Landscape'), 4965 isDisabled: isDisabled, 4966 onClick: function onClick(aspect) { 4967 _onClick2(aspect); 4968 4969 onClose(); 4970 }, 4971 value: value, 4972 aspectRatios: [{ 4973 title: Object(external_this_wp_i18n_["__"])('16:10'), 4974 aspect: 16 / 10 4975 }, { 4976 title: Object(external_this_wp_i18n_["__"])('16:9'), 4977 aspect: 16 / 9 4978 }, { 4979 title: Object(external_this_wp_i18n_["__"])('4:3'), 4980 aspect: 4 / 3 4981 }, { 4982 title: Object(external_this_wp_i18n_["__"])('3:2'), 4983 aspect: 3 / 2 4984 }] 4985 }), Object(external_this_wp_element_["createElement"])(AspectGroup, { 4986 label: Object(external_this_wp_i18n_["__"])('Portrait'), 4987 isDisabled: isDisabled, 4988 onClick: function onClick(aspect) { 4989 _onClick2(aspect); 4990 4991 onClose(); 4992 }, 4993 value: value, 4994 aspectRatios: [{ 4995 title: Object(external_this_wp_i18n_["__"])('10:16'), 4996 aspect: 10 / 16 4997 }, { 4998 title: Object(external_this_wp_i18n_["__"])('9:16'), 4999 aspect: 9 / 16 5000 }, { 5001 title: Object(external_this_wp_i18n_["__"])('3:4'), 5002 aspect: 3 / 4 5003 }, { 5004 title: Object(external_this_wp_i18n_["__"])('2:3'), 5005 aspect: 2 / 3 5006 }] 5007 })); 5008 }); 5009 } 5010 5011 function ImageEditor(_ref5) { 5012 var id = _ref5.id, 5013 url = _ref5.url, 5014 setAttributes = _ref5.setAttributes, 5015 naturalWidth = _ref5.naturalWidth, 5016 naturalHeight = _ref5.naturalHeight, 5017 width = _ref5.width, 5018 height = _ref5.height, 5019 clientWidth = _ref5.clientWidth, 5020 setIsEditingImage = _ref5.setIsEditingImage; 5021 5022 var _useDispatch = Object(external_this_wp_data_["useDispatch"])('core/notices'), 5023 createErrorNotice = _useDispatch.createErrorNotice; 5024 5025 var _useState = Object(external_this_wp_element_["useState"])(false), 5026 _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), 5027 inProgress = _useState2[0], 5028 setIsProgress = _useState2[1]; 5029 5030 var _useState3 = Object(external_this_wp_element_["useState"])(null), 5031 _useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2), 5032 crop = _useState4[0], 5033 setCrop = _useState4[1]; 5034 5035 var _useState5 = Object(external_this_wp_element_["useState"])({ 5036 x: 0, 5037 y: 0 5038 }), 5039 _useState6 = Object(slicedToArray["a" /* default */])(_useState5, 2), 5040 position = _useState6[0], 5041 setPosition = _useState6[1]; 5042 5043 var _useState7 = Object(external_this_wp_element_["useState"])(100), 5044 _useState8 = Object(slicedToArray["a" /* default */])(_useState7, 2), 5045 zoom = _useState8[0], 5046 setZoom = _useState8[1]; 5047 5048 var _useState9 = Object(external_this_wp_element_["useState"])(naturalWidth / naturalHeight), 5049 _useState10 = Object(slicedToArray["a" /* default */])(_useState9, 2), 5050 aspect = _useState10[0], 5051 setAspect = _useState10[1]; 5052 5053 var _useState11 = Object(external_this_wp_element_["useState"])(0), 5054 _useState12 = Object(slicedToArray["a" /* default */])(_useState11, 2), 5055 rotation = _useState12[0], 5056 setRotation = _useState12[1]; 5057 5058 var _useState13 = Object(external_this_wp_element_["useState"])(), 5059 _useState14 = Object(slicedToArray["a" /* default */])(_useState13, 2), 5060 editedUrl = _useState14[0], 5061 setEditedUrl = _useState14[1]; 5062 5063 var editedWidth = width; 5064 var editedHeight = height || clientWidth * naturalHeight / naturalWidth; 5065 var naturalAspectRatio = naturalWidth / naturalHeight; 5066 5067 if (rotation % 180 === 90) { 5068 editedHeight = clientWidth * naturalWidth / naturalHeight; 5069 naturalAspectRatio = naturalHeight / naturalWidth; 5070 } 5071 5072 function apply() { 5073 setIsProgress(true); 5074 var attrs = {}; // The crop script may return some very small, sub-pixel values when the image was not cropped. 5075 // Crop only when the new size has changed by more than 0.1%. 5076 5077 if (crop.width < 99.9 || crop.height < 99.9) { 5078 attrs = crop; 5079 } 5080 5081 if (rotation > 0) { 5082 attrs.rotation = rotation; 5083 } 5084 5085 attrs.src = url; 5086 external_this_wp_apiFetch_default()({ 5087 path: "/wp/v2/media/".concat(id, "/edit"), 5088 method: 'POST', 5089 data: attrs 5090 }).then(function (response) { 5091 setAttributes({ 5092 id: response.id, 5093 url: response.source_url, 5094 height: height && width ? width / aspect : undefined 5095 }); 5096 }).catch(function (error) { 5097 createErrorNotice(Object(external_this_wp_i18n_["sprintf"])( 5098 /* translators: 1. Error message */ 5099 Object(external_this_wp_i18n_["__"])('Could not edit image. %s'), error.message), { 5100 id: 'image-editing-error', 5101 type: 'snackbar' 5102 }); 5103 }).finally(function () { 5104 setIsProgress(false); 5105 setIsEditingImage(false); 5106 }); 5107 } 5108 5109 function rotate() { 5110 var angle = (rotation + 90) % 360; 5111 5112 if (angle === 0) { 5113 setEditedUrl(); 5114 setRotation(angle); 5115 setAspect(1 / aspect); 5116 setPosition({ 5117 x: -(position.y * naturalAspectRatio), 5118 y: position.x * naturalAspectRatio 5119 }); 5120 return; 5121 } 5122 5123 function editImage(event) { 5124 var canvas = document.createElement('canvas'); 5125 var translateX = 0; 5126 var translateY = 0; 5127 5128 if (angle % 180) { 5129 canvas.width = event.target.height; 5130 canvas.height = event.target.width; 5131 } else { 5132 canvas.width = event.target.width; 5133 canvas.height = event.target.height; 5134 } 5135 5136 if (angle === 90 || angle === 180) { 5137 translateX = canvas.width; 5138 } 5139 5140 if (angle === 270 || angle === 180) { 5141 translateY = canvas.height; 5142 } 5143 5144 var context = canvas.getContext('2d'); 5145 context.translate(translateX, translateY); 5146 context.rotate(angle * Math.PI / 180); 5147 context.drawImage(event.target, 0, 0); 5148 canvas.toBlob(function (blob) { 5149 setEditedUrl(URL.createObjectURL(blob)); 5150 setRotation(angle); 5151 setAspect(1 / aspect); 5152 setPosition({ 5153 x: -(position.y * naturalAspectRatio), 5154 y: position.x * naturalAspectRatio 5155 }); 5156 }); 5157 } 5158 5159 var el = new window.Image(); 5160 el.src = url; 5161 el.onload = editImage; 5162 } 5163 5164 return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])("div", { 5165 className: classnames_default()('wp-block-image__crop-area', { 5166 'is-applying': inProgress 5167 }), 5168 style: { 5169 width: editedWidth, 5170 height: editedHeight 5171 } 5172 }, Object(external_this_wp_element_["createElement"])(index_module, { 5173 image: editedUrl || url, 5174 disabled: inProgress, 5175 minZoom: image_editor_MIN_ZOOM / 100, 5176 maxZoom: image_editor_MAX_ZOOM / 100, 5177 crop: position, 5178 zoom: zoom / 100, 5179 aspect: aspect, 5180 onCropChange: setPosition, 5181 onCropComplete: function onCropComplete(newCropPercent) { 5182 setCrop(newCropPercent); 5183 }, 5184 onZoomChange: function onZoomChange(newZoom) { 5185 setZoom(newZoom * 100); 5186 } 5187 }), inProgress && Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Spinner"], null)), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["BlockControls"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToolbarGroup"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Dropdown"], { 5188 contentClassName: "wp-block-image__zoom", 5189 popoverProps: POPOVER_PROPS, 5190 renderToggle: function renderToggle(_ref6) { 5191 var isOpen = _ref6.isOpen, 5192 onToggle = _ref6.onToggle; 5193 return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToolbarButton"], { 5194 icon: search["a" /* default */], 5195 label: Object(external_this_wp_i18n_["__"])('Zoom'), 5196 onClick: onToggle, 5197 "aria-expanded": isOpen, 5198 disabled: inProgress 5199 }); 5200 }, 5201 renderContent: function renderContent() { 5202 return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["RangeControl"], { 5203 min: image_editor_MIN_ZOOM, 5204 max: image_editor_MAX_ZOOM, 5205 value: Math.round(zoom), 5206 onChange: setZoom 5207 }); 5208 } 5209 }), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToolbarItem"], null, function (toggleProps) { 5210 return Object(external_this_wp_element_["createElement"])(AspectMenu, { 5211 toggleProps: toggleProps, 5212 isDisabled: inProgress, 5213 onClick: setAspect, 5214 value: aspect, 5215 defaultValue: naturalWidth / naturalHeight 5216 }); 5217 })), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToolbarGroup"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToolbarButton"], { 5218 icon: rotate_right, 5219 label: Object(external_this_wp_i18n_["__"])('Rotate'), 5220 onClick: rotate, 5221 disabled: inProgress 5222 })), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToolbarGroup"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToolbarButton"], { 5223 onClick: apply, 5224 disabled: inProgress 5225 }, Object(external_this_wp_i18n_["__"])('Apply')), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToolbarButton"], { 5226 onClick: function onClick() { 5227 return setIsEditingImage(false); 5228 } 5229 }, Object(external_this_wp_i18n_["__"])('Cancel'))))); 5230 } 5231 5232 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/constants.js 5233 var MIN_SIZE = 20; 5234 var LINK_DESTINATION_NONE = 'none'; 5235 var LINK_DESTINATION_MEDIA = 'media'; 5236 var LINK_DESTINATION_ATTACHMENT = 'attachment'; 5237 var LINK_DESTINATION_CUSTOM = 'custom'; 5238 var NEW_TAB_REL = ['noreferrer', 'noopener']; 5239 var ALLOWED_MEDIA_TYPES = ['image']; 5240 var DEFAULT_SIZE_SLUG = 'large'; 5241 5242 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image.js 5243 5244 5245 5246 /** 5247 * External dependencies 5248 */ 5249 5250 /** 5251 * WordPress dependencies 5252 */ 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 /** 5265 * Internal dependencies 5266 */ 5267 5268 5269 5270 5271 5272 /** 5273 * Module constants 5274 */ 5275 5276 5277 5278 function getFilename(url) { 5279 var path = Object(external_this_wp_url_["getPath"])(url); 5280 5281 if (path) { 5282 return Object(external_this_lodash_["last"])(path.split('/')); 5283 } 5284 } 5285 5286 function Image(_ref) { 5287 var _ref$attributes = _ref.attributes, 5288 _ref$attributes$url = _ref$attributes.url, 5289 url = _ref$attributes$url === void 0 ? '' : _ref$attributes$url, 5290 alt = _ref$attributes.alt, 5291 caption = _ref$attributes.caption, 5292 align = _ref$attributes.align, 5293 id = _ref$attributes.id, 5294 href = _ref$attributes.href, 5295 rel = _ref$attributes.rel, 5296 linkClass = _ref$attributes.linkClass, 5297 linkDestination = _ref$attributes.linkDestination, 5298 title = _ref$attributes.title, 5299 width = _ref$attributes.width, 5300 height = _ref$attributes.height, 5301 linkTarget = _ref$attributes.linkTarget, 5302 sizeSlug = _ref$attributes.sizeSlug, 5303 setAttributes = _ref.setAttributes, 5304 isSelected = _ref.isSelected, 5305 insertBlocksAfter = _ref.insertBlocksAfter, 5306 onReplace = _ref.onReplace, 5307 onSelectImage = _ref.onSelectImage, 5308 onSelectURL = _ref.onSelectURL, 5309 onUploadError = _ref.onUploadError, 5310 containerRef = _ref.containerRef; 5311 var captionRef = Object(external_this_wp_element_["useRef"])(); 5312 var prevUrl = Object(external_this_wp_compose_["usePrevious"])(url); 5313 var image = Object(external_this_wp_data_["useSelect"])(function (select) { 5314 var _select = select('core'), 5315 getMedia = _select.getMedia; 5316 5317 return id && isSelected ? getMedia(id) : null; 5318 }, [id, isSelected]); 5319 5320 var _useSelect = Object(external_this_wp_data_["useSelect"])(function (select) { 5321 var _select2 = select('core/block-editor'), 5322 getSettings = _select2.getSettings; 5323 5324 return Object(external_this_lodash_["pick"])(getSettings(), ['imageEditing', 'imageSizes', 'isRTL', 'maxWidth', 'mediaUpload']); 5325 }), 5326 imageEditing = _useSelect.imageEditing, 5327 imageSizes = _useSelect.imageSizes, 5328 isRTL = _useSelect.isRTL, 5329 maxWidth = _useSelect.maxWidth, 5330 mediaUpload = _useSelect.mediaUpload; 5331 5332 var _useDispatch = Object(external_this_wp_data_["useDispatch"])('core/block-editor'), 5333 toggleSelection = _useDispatch.toggleSelection; 5334 5335 var _useDispatch2 = Object(external_this_wp_data_["useDispatch"])('core/notices'), 5336 createErrorNotice = _useDispatch2.createErrorNotice, 5337 createSuccessNotice = _useDispatch2.createSuccessNotice; 5338 5339 var isLargeViewport = Object(external_this_wp_compose_["useViewportMatch"])('medium'); 5340 5341 var _useState = Object(external_this_wp_element_["useState"])(false), 5342 _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), 5343 captionFocused = _useState2[0], 5344 setCaptionFocused = _useState2[1]; 5345 5346 var isWideAligned = Object(external_this_lodash_["includes"])(['wide', 'full'], align); 5347 5348 var _useState3 = Object(external_this_wp_element_["useState"])({}), 5349 _useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2), 5350 _useState4$ = _useState4[0], 5351 naturalWidth = _useState4$.naturalWidth, 5352 naturalHeight = _useState4$.naturalHeight, 5353 setNaturalSize = _useState4[1]; 5354 5355 var _useState5 = Object(external_this_wp_element_["useState"])(false), 5356 _useState6 = Object(slicedToArray["a" /* default */])(_useState5, 2), 5357 isEditingImage = _useState6[0], 5358 setIsEditingImage = _useState6[1]; 5359 5360 var _useState7 = Object(external_this_wp_element_["useState"])(), 5361 _useState8 = Object(slicedToArray["a" /* default */])(_useState7, 2), 5362 externalBlob = _useState8[0], 5363 setExternalBlob = _useState8[1]; 5364 5365 var clientWidth = useClientWidth(containerRef, [align]); 5366 var isResizable = !isWideAligned && isLargeViewport; 5367 var imageSizeOptions = Object(external_this_lodash_["map"])(Object(external_this_lodash_["filter"])(imageSizes, function (_ref2) { 5368 var slug = _ref2.slug; 5369 return Object(external_this_lodash_["get"])(image, ['media_details', 'sizes', slug, 'source_url']); 5370 }), function (_ref3) { 5371 var name = _ref3.name, 5372 slug = _ref3.slug; 5373 return { 5374 value: slug, 5375 label: name 5376 }; 5377 }); 5378 Object(external_this_wp_element_["useEffect"])(function () { 5379 if (!isSelected) { 5380 setCaptionFocused(false); 5381 } 5382 }, [isSelected]); // If an image is externally hosted, try to fetch the image data. This may 5383 // fail if the image host doesn't allow CORS with the domain. If it works, 5384 // we can enable a button in the toolbar to upload the image. 5385 5386 Object(external_this_wp_element_["useEffect"])(function () { 5387 if (!edit_isExternalImage(id, url) || !isSelected || externalBlob) { 5388 return; 5389 } 5390 5391 window.fetch(url).then(function (response) { 5392 return response.blob(); 5393 }).then(function (blob) { 5394 return setExternalBlob(blob); 5395 }); 5396 }, [id, url, isSelected, externalBlob]); // Focus the caption after inserting an image from the placeholder. This is 5397 // done to preserve the behaviour of focussing the first tabbable element 5398 // when a block is mounted. Previously, the image block would remount when 5399 // the placeholder is removed. Maybe this behaviour could be removed. 5400 5401 Object(external_this_wp_element_["useEffect"])(function () { 5402 if (url && !prevUrl && isSelected) { 5403 captionRef.current.focus(); 5404 } 5405 }, [url, prevUrl]); 5406 5407 function onResizeStart() { 5408 toggleSelection(false); 5409 } 5410 5411 function _onResizeStop() { 5412 toggleSelection(true); 5413 } 5414 5415 function onImageError() { 5416 // Check if there's an embed block that handles this URL. 5417 var embedBlock = util_createUpgradedEmbedBlock({ 5418 attributes: { 5419 url: url 5420 } 5421 }); 5422 5423 if (undefined !== embedBlock) { 5424 onReplace(embedBlock); 5425 } 5426 } 5427 5428 function onSetHref(props) { 5429 setAttributes(props); 5430 } 5431 5432 function onSetTitle(value) { 5433 // This is the HTML title attribute, separate from the media object 5434 // title. 5435 setAttributes({ 5436 title: value 5437 }); 5438 } 5439 5440 function onFocusCaption() { 5441 if (!captionFocused) { 5442 setCaptionFocused(true); 5443 } 5444 } 5445 5446 function onImageClick() { 5447 if (captionFocused) { 5448 setCaptionFocused(false); 5449 } 5450 } 5451 5452 function updateAlt(newAlt) { 5453 setAttributes({ 5454 alt: newAlt 5455 }); 5456 } 5457 5458 function updateImage(newSizeSlug) { 5459 var newUrl = Object(external_this_lodash_["get"])(image, ['media_details', 'sizes', newSizeSlug, 'source_url']); 5460 5461 if (!newUrl) { 5462 return null; 5463 } 5464 5465 setAttributes({ 5466 url: newUrl, 5467 width: undefined, 5468 height: undefined, 5469 sizeSlug: newSizeSlug 5470 }); 5471 } 5472 5473 function uploadExternal() { 5474 mediaUpload({ 5475 filesList: [externalBlob], 5476 onFileChange: function onFileChange(_ref4) { 5477 var _ref5 = Object(slicedToArray["a" /* default */])(_ref4, 1), 5478 img = _ref5[0]; 5479 5480 onSelectImage(img); 5481 5482 if (Object(external_this_wp_blob_["isBlobURL"])(img.url)) { 5483 return; 5484 } 5485 5486 setExternalBlob(); 5487 createSuccessNotice(Object(external_this_wp_i18n_["__"])('Image uploaded.'), { 5488 type: 'snackbar' 5489 }); 5490 }, 5491 allowedTypes: ALLOWED_MEDIA_TYPES, 5492 onError: function onError(message) { 5493 createErrorNotice(message, { 5494 type: 'snackbar' 5495 }); 5496 } 5497 }); 5498 } 5499 5500 Object(external_this_wp_element_["useEffect"])(function () { 5501 if (!isSelected) { 5502 setIsEditingImage(false); 5503 } 5504 }, [isSelected]); 5505 var canEditImage = id && naturalWidth && naturalHeight && imageEditing; 5506 var controls = Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["BlockControls"], null, !isEditingImage && Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToolbarGroup"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["__experimentalImageURLInputUI"], { 5507 url: href || '', 5508 onChangeUrl: onSetHref, 5509 linkDestination: linkDestination, 5510 mediaUrl: image && image.source_url || url, 5511 mediaLink: image && image.link, 5512 linkTarget: linkTarget, 5513 linkClass: linkClass, 5514 rel: rel 5515 })), canEditImage && !isEditingImage && Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToolbarGroup"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToolbarButton"], { 5516 onClick: function onClick() { 5517 return setIsEditingImage(true); 5518 }, 5519 icon: library_crop, 5520 label: Object(external_this_wp_i18n_["__"])('Crop') 5521 })), externalBlob && Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToolbarGroup"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToolbarButton"], { 5522 onClick: uploadExternal, 5523 icon: upload["a" /* default */], 5524 label: Object(external_this_wp_i18n_["__"])('Upload external image') 5525 })), !isEditingImage && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["MediaReplaceFlow"], { 5526 mediaId: id, 5527 mediaURL: url, 5528 allowedTypes: ALLOWED_MEDIA_TYPES, 5529 accept: "image/*", 5530 onSelect: onSelectImage, 5531 onSelectURL: onSelectURL, 5532 onError: onUploadError 5533 })), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["InspectorControls"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["PanelBody"], { 5534 title: Object(external_this_wp_i18n_["__"])('Image settings') 5535 }, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["TextareaControl"], { 5536 label: Object(external_this_wp_i18n_["__"])('Alt text (alternative text)'), 5537 value: alt, 5538 onChange: updateAlt, 5539 help: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ExternalLink"], { 5540 href: "https://www.w3.org/WAI/tutorials/images/decision-tree" 5541 }, Object(external_this_wp_i18n_["__"])('Describe the purpose of the image')), Object(external_this_wp_i18n_["__"])('Leave empty if the image is purely decorative.')) 5542 }), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["__experimentalImageSizeControl"], { 5543 onChangeImage: updateImage, 5544 onChange: function onChange(value) { 5545 return setAttributes(value); 5546 }, 5547 slug: sizeSlug, 5548 width: width, 5549 height: height, 5550 imageSizeOptions: imageSizeOptions, 5551 isResizable: isResizable, 5552 imageWidth: naturalWidth, 5553 imageHeight: naturalHeight 5554 }))), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["InspectorAdvancedControls"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["TextControl"], { 5555 label: Object(external_this_wp_i18n_["__"])('Title attribute'), 5556 value: title || '', 5557 onChange: onSetTitle, 5558 help: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_i18n_["__"])('Describe the role of this image on the page.'), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ExternalLink"], { 5559 href: "https://www.w3.org/TR/html52/dom.html#the-title-attribute" 5560 }, Object(external_this_wp_i18n_["__"])('(Note: many devices and browsers do not display this text.)'))) 5561 }))); 5562 var filename = getFilename(url); 5563 var defaultedAlt; 5564 5565 if (alt) { 5566 defaultedAlt = alt; 5567 } else if (filename) { 5568 defaultedAlt = Object(external_this_wp_i18n_["sprintf"])( 5569 /* translators: %s: file name */ 5570 Object(external_this_wp_i18n_["__"])('This image has an empty alt attribute; its file name is %s'), filename); 5571 } else { 5572 defaultedAlt = Object(external_this_wp_i18n_["__"])('This image has an empty alt attribute'); 5573 } 5574 5575 var img = // Disable reason: Image itself is not meant to be interactive, but 5576 // should direct focus to block. 5577 5578 /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */ 5579 Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])("img", { 5580 src: url, 5581 alt: defaultedAlt, 5582 onClick: onImageClick, 5583 onError: function onError() { 5584 return onImageError(); 5585 }, 5586 onLoad: function onLoad(event) { 5587 setNaturalSize(Object(external_this_lodash_["pick"])(event.target, ['naturalWidth', 'naturalHeight'])); 5588 } 5589 }), Object(external_this_wp_blob_["isBlobURL"])(url) && Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Spinner"], null)) 5590 /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */ 5591 ; 5592 var imageWidthWithinContainer; 5593 var imageHeightWithinContainer; 5594 5595 if (clientWidth && naturalWidth && naturalHeight) { 5596 var exceedMaxWidth = naturalWidth > clientWidth; 5597 var ratio = naturalHeight / naturalWidth; 5598 imageWidthWithinContainer = exceedMaxWidth ? clientWidth : naturalWidth; 5599 imageHeightWithinContainer = exceedMaxWidth ? clientWidth * ratio : naturalHeight; 5600 } 5601 5602 if (canEditImage && isEditingImage) { 5603 img = Object(external_this_wp_element_["createElement"])(ImageEditor, { 5604 id: id, 5605 url: url, 5606 setAttributes: setAttributes, 5607 naturalWidth: naturalWidth, 5608 naturalHeight: naturalHeight, 5609 width: width, 5610 height: height, 5611 clientWidth: clientWidth, 5612 setIsEditingImage: setIsEditingImage 5613 }); 5614 } else if (!isResizable || !imageWidthWithinContainer) { 5615 img = Object(external_this_wp_element_["createElement"])("div", { 5616 style: { 5617 width: width, 5618 height: height 5619 } 5620 }, img); 5621 } else { 5622 var currentWidth = width || imageWidthWithinContainer; 5623 var currentHeight = height || imageHeightWithinContainer; 5624 5625 var _ratio = naturalWidth / naturalHeight; 5626 5627 var minWidth = naturalWidth < naturalHeight ? MIN_SIZE : MIN_SIZE * _ratio; 5628 var minHeight = naturalHeight < naturalWidth ? MIN_SIZE : MIN_SIZE / _ratio; // With the current implementation of ResizableBox, an image needs an 5629 // explicit pixel value for the max-width. In absence of being able to 5630 // set the content-width, this max-width is currently dictated by the 5631 // vanilla editor style. The following variable adds a buffer to this 5632 // vanilla style, so 3rd party themes have some wiggleroom. This does, 5633 // in most cases, allow you to scale the image beyond the width of the 5634 // main column, though not infinitely. 5635 // @todo It would be good to revisit this once a content-width variable 5636 // becomes available. 5637 5638 var maxWidthBuffer = maxWidth * 2.5; 5639 var showRightHandle = false; 5640 var showLeftHandle = false; 5641 /* eslint-disable no-lonely-if */ 5642 // See https://github.com/WordPress/gutenberg/issues/7584. 5643 5644 if (align === 'center') { 5645 // When the image is centered, show both handles. 5646 showRightHandle = true; 5647 showLeftHandle = true; 5648 } else if (isRTL) { 5649 // In RTL mode the image is on the right by default. 5650 // Show the right handle and hide the left handle only when it is 5651 // aligned left. Otherwise always show the left handle. 5652 if (align === 'left') { 5653 showRightHandle = true; 5654 } else { 5655 showLeftHandle = true; 5656 } 5657 } else { 5658 // Show the left handle and hide the right handle only when the 5659 // image is aligned right. Otherwise always show the right handle. 5660 if (align === 'right') { 5661 showLeftHandle = true; 5662 } else { 5663 showRightHandle = true; 5664 } 5665 } 5666 /* eslint-enable no-lonely-if */ 5667 5668 5669 img = Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ResizableBox"], { 5670 size: { 5671 width: width, 5672 height: height 5673 }, 5674 showHandle: isSelected, 5675 minWidth: minWidth, 5676 maxWidth: maxWidthBuffer, 5677 minHeight: minHeight, 5678 maxHeight: maxWidthBuffer / _ratio, 5679 lockAspectRatio: true, 5680 enable: { 5681 top: false, 5682 right: showRightHandle, 5683 bottom: true, 5684 left: showLeftHandle 5685 }, 5686 onResizeStart: onResizeStart, 5687 onResizeStop: function onResizeStop(event, direction, elt, delta) { 5688 _onResizeStop(); 5689 5690 setAttributes({ 5691 width: parseInt(currentWidth + delta.width, 10), 5692 height: parseInt(currentHeight + delta.height, 10) 5693 }); 5694 } 5695 }, img); 5696 } 5697 5698 return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, controls, img, (!external_this_wp_blockEditor_["RichText"].isEmpty(caption) || isSelected) && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"], { 5699 ref: captionRef, 5700 tagName: "figcaption", 5701 placeholder: Object(external_this_wp_i18n_["__"])('Write caption…'), 5702 value: caption, 5703 unstableOnFocus: onFocusCaption, 5704 onChange: function onChange(value) { 5705 return setAttributes({ 5706 caption: value 5707 }); 5708 }, 5709 isSelected: captionFocused, 5710 inlineToolbar: true, 5711 __unstableOnSplitAtEnd: function __unstableOnSplitAtEnd() { 5712 return insertBlocksAfter(Object(external_this_wp_blocks_["createBlock"])('core/paragraph')); 5713 } 5714 })); 5715 } 5716 5717 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/edit.js 5718 5719 5720 5721 5722 function image_edit_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } 5723 5724 function image_edit_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { image_edit_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { image_edit_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 5725 5726 /** 5727 * External dependencies 5728 */ 5729 5730 5731 /** 5732 * WordPress dependencies 5733 */ 5734 5735 5736 5737 5738 5739 5740 5741 5742 /* global wp */ 5743 5744 /** 5745 * Internal dependencies 5746 */ 5747 5748 5749 /** 5750 * Module constants 5751 */ 5752 5753 5754 var edit_pickRelevantMediaFiles = function pickRelevantMediaFiles(image) { 5755 var imageProps = Object(external_this_lodash_["pick"])(image, ['alt', 'id', 'link', 'caption']); 5756 imageProps.url = Object(external_this_lodash_["get"])(image, ['sizes', 'large', 'url']) || Object(external_this_lodash_["get"])(image, ['media_details', 'sizes', 'large', 'source_url']) || image.url; 5757 return imageProps; 5758 }; 5759 /** 5760 * Is the URL a temporary blob URL? A blob URL is one that is used temporarily 5761 * while the image is being uploaded and will not have an id yet allocated. 5762 * 5763 * @param {number=} id The id of the image. 5764 * @param {string=} url The url of the image. 5765 * 5766 * @return {boolean} Is the URL a Blob URL 5767 */ 5768 5769 var edit_isTemporaryImage = function isTemporaryImage(id, url) { 5770 return !id && Object(external_this_wp_blob_["isBlobURL"])(url); 5771 }; 5772 /** 5773 * Is the url for the image hosted externally. An externally hosted image has no 5774 * id and is not a blob url. 5775 * 5776 * @param {number=} id The id of the image. 5777 * @param {string=} url The url of the image. 5778 * 5779 * @return {boolean} Is the url an externally hosted url? 5780 */ 5781 5782 5783 var edit_isExternalImage = function isExternalImage(id, url) { 5784 return url && !id && !Object(external_this_wp_blob_["isBlobURL"])(url); 5785 }; 5786 function ImageEdit(_ref) { 5787 var attributes = _ref.attributes, 5788 setAttributes = _ref.setAttributes, 5789 isSelected = _ref.isSelected, 5790 className = _ref.className, 5791 noticeUI = _ref.noticeUI, 5792 insertBlocksAfter = _ref.insertBlocksAfter, 5793 noticeOperations = _ref.noticeOperations, 5794 onReplace = _ref.onReplace; 5795 var _attributes$url = attributes.url, 5796 url = _attributes$url === void 0 ? '' : _attributes$url, 5797 alt = attributes.alt, 5798 caption = attributes.caption, 5799 align = attributes.align, 5800 id = attributes.id, 5801 width = attributes.width, 5802 height = attributes.height, 5803 sizeSlug = attributes.sizeSlug; 5804 var altRef = Object(external_this_wp_element_["useRef"])(); 5805 Object(external_this_wp_element_["useEffect"])(function () { 5806 altRef.current = alt; 5807 }, [alt]); 5808 var captionRef = Object(external_this_wp_element_["useRef"])(); 5809 Object(external_this_wp_element_["useEffect"])(function () { 5810 captionRef.current = caption; 5811 }, [caption]); 5812 var ref = Object(external_this_wp_element_["useRef"])(); 5813 var mediaUpload = Object(external_this_wp_data_["useSelect"])(function (select) { 5814 var _select = select('core/block-editor'), 5815 getSettings = _select.getSettings; 5816 5817 return getSettings().mediaUpload; 5818 }); 5819 5820 function onUploadError(message) { 5821 noticeOperations.removeAllNotices(); 5822 noticeOperations.createErrorNotice(message); 5823 } 5824 5825 function onSelectImage(media) { 5826 var _wp, _wp$media, _wp$media$view, _wp$media$view$settin, _wp$media$view$settin2; 5827 5828 if (!media || !media.url) { 5829 setAttributes({ 5830 url: undefined, 5831 alt: undefined, 5832 id: undefined, 5833 title: undefined, 5834 caption: undefined 5835 }); 5836 return; 5837 } 5838 5839 var mediaAttributes = edit_pickRelevantMediaFiles(media); // If the current image is temporary but an alt text was meanwhile 5840 // written by the user, make sure the text is not overwritten. 5841 5842 if (edit_isTemporaryImage(id, url)) { 5843 if (altRef.current) { 5844 mediaAttributes = Object(external_this_lodash_["omit"])(mediaAttributes, ['alt']); 5845 } 5846 } // If a caption text was meanwhile written by the user, 5847 // make sure the text is not overwritten by empty captions. 5848 5849 5850 if (captionRef.current && !Object(external_this_lodash_["get"])(mediaAttributes, ['caption'])) { 5851 mediaAttributes = Object(external_this_lodash_["omit"])(mediaAttributes, ['caption']); 5852 } 5853 5854 var additionalAttributes; // Reset the dimension attributes if changing to a different image. 5855 5856 if (!media.id || media.id !== id) { 5857 additionalAttributes = { 5858 width: undefined, 5859 height: undefined, 5860 sizeSlug: DEFAULT_SIZE_SLUG 5861 }; 5862 } else { 5863 // Keep the same url when selecting the same file, so "Image Size" 5864 // option is not changed. 5865 additionalAttributes = { 5866 url: url 5867 }; 5868 } // Check if default link setting should be used. 5869 5870 5871 var linkDestination = attributes.linkDestination; 5872 5873 if (!linkDestination) { 5874 // Use the WordPress option to determine the proper default. 5875 // The constants used in Gutenberg do not match WP options so a little more complicated than ideal. 5876 // TODO: fix this in a follow up PR, requires updating media-text and ui component. 5877 switch (((_wp = wp) === null || _wp === void 0 ? void 0 : (_wp$media = _wp.media) === null || _wp$media === void 0 ? void 0 : (_wp$media$view = _wp$media.view) === null || _wp$media$view === void 0 ? void 0 : (_wp$media$view$settin = _wp$media$view.settings) === null || _wp$media$view$settin === void 0 ? void 0 : (_wp$media$view$settin2 = _wp$media$view$settin.defaultProps) === null || _wp$media$view$settin2 === void 0 ? void 0 : _wp$media$view$settin2.link) || LINK_DESTINATION_NONE) { 5878 case 'file': 5879 case LINK_DESTINATION_MEDIA: 5880 linkDestination = LINK_DESTINATION_MEDIA; 5881 break; 5882 5883 case 'post': 5884 case LINK_DESTINATION_ATTACHMENT: 5885 linkDestination = LINK_DESTINATION_ATTACHMENT; 5886 break; 5887 5888 case LINK_DESTINATION_CUSTOM: 5889 linkDestination = LINK_DESTINATION_CUSTOM; 5890 break; 5891 5892 case LINK_DESTINATION_NONE: 5893 linkDestination = LINK_DESTINATION_NONE; 5894 break; 5895 } 5896 } // Check if the image is linked to it's media. 5897 5898 5899 var href; 5900 5901 switch (linkDestination) { 5902 case LINK_DESTINATION_MEDIA: 5903 href = media.url; 5904 break; 5905 5906 case LINK_DESTINATION_ATTACHMENT: 5907 href = media.link; 5908 break; 5909 } 5910 5911 mediaAttributes.href = href; 5912 setAttributes(image_edit_objectSpread(image_edit_objectSpread(image_edit_objectSpread({}, mediaAttributes), additionalAttributes), {}, { 5913 linkDestination: linkDestination 5914 })); 5915 } 5916 5917 function onSelectURL(newURL) { 5918 if (newURL !== url) { 5919 setAttributes({ 5920 url: newURL, 5921 id: undefined, 5922 sizeSlug: DEFAULT_SIZE_SLUG 5923 }); 5924 } 5925 } 5926 5927 function updateAlignment(nextAlign) { 5928 var extraUpdatedAttributes = ['wide', 'full'].includes(nextAlign) ? { 5929 width: undefined, 5930 height: undefined 5931 } : {}; 5932 setAttributes(image_edit_objectSpread(image_edit_objectSpread({}, extraUpdatedAttributes), {}, { 5933 align: nextAlign 5934 })); 5935 } 5936 5937 var isTemp = edit_isTemporaryImage(id, url); // Upload a temporary image on mount. 5938 5939 Object(external_this_wp_element_["useEffect"])(function () { 5940 if (!isTemp) { 5941 return; 5942 } 5943 5944 var file = Object(external_this_wp_blob_["getBlobByURL"])(url); 5945 5946 if (file) { 5947 mediaUpload({ 5948 filesList: [file], 5949 onFileChange: function onFileChange(_ref2) { 5950 var _ref3 = Object(slicedToArray["a" /* default */])(_ref2, 1), 5951 img = _ref3[0]; 5952 5953 onSelectImage(img); 5954 }, 5955 allowedTypes: ALLOWED_MEDIA_TYPES, 5956 onError: function onError(message) { 5957 noticeOperations.createErrorNotice(message); 5958 setAttributes({ 5959 src: undefined, 5960 id: undefined, 5961 url: undefined 5962 }); 5963 } 5964 }); 5965 } 5966 }, []); // If an image is temporary, revoke the Blob url when it is uploaded (and is 5967 // no longer temporary). 5968 5969 Object(external_this_wp_element_["useEffect"])(function () { 5970 if (!isTemp) { 5971 return; 5972 } 5973 5974 return function () { 5975 Object(external_this_wp_blob_["revokeBlobURL"])(url); 5976 }; 5977 }, [isTemp]); 5978 var isExternal = edit_isExternalImage(id, url); 5979 var controls = Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["BlockControls"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["BlockAlignmentToolbar"], { 5980 value: align, 5981 onChange: updateAlignment 5982 })); 5983 var src = isExternal ? url : undefined; 5984 var mediaPreview = !!url && Object(external_this_wp_element_["createElement"])("img", { 5985 alt: Object(external_this_wp_i18n_["__"])('Edit image'), 5986 title: Object(external_this_wp_i18n_["__"])('Edit image'), 5987 className: 'edit-image-preview', 5988 src: url 5989 }); 5990 var mediaPlaceholder = Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["MediaPlaceholder"], { 5991 icon: Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["BlockIcon"], { 5992 icon: library_image 5993 }), 5994 onSelect: onSelectImage, 5995 onSelectURL: onSelectURL, 5996 notices: noticeUI, 5997 onError: onUploadError, 5998 accept: "image/*", 5999 allowedTypes: ALLOWED_MEDIA_TYPES, 6000 value: { 6001 id: id, 6002 src: src 6003 }, 6004 mediaPreview: mediaPreview, 6005 disableMediaButtons: url 6006 }); 6007 var classes = classnames_default()(className, Object(defineProperty["a" /* default */])({ 6008 'is-transient': Object(external_this_wp_blob_["isBlobURL"])(url), 6009 'is-resized': !!width || !!height, 6010 'is-focused': isSelected 6011 }, "size-".concat(sizeSlug), sizeSlug)); 6012 var blockProps = Object(external_this_wp_blockEditor_["useBlockProps"])({ 6013 ref: ref, 6014 className: classes 6015 }); 6016 return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, controls, Object(external_this_wp_element_["createElement"])("figure", blockProps, url && Object(external_this_wp_element_["createElement"])(Image, { 6017 attributes: attributes, 6018 setAttributes: setAttributes, 6019 isSelected: isSelected, 6020 insertBlocksAfter: insertBlocksAfter, 6021 onReplace: onReplace, 6022 onSelectImage: onSelectImage, 6023 onSelectURL: onSelectURL, 6024 onUploadError: onUploadError, 6025 containerRef: ref 6026 }), mediaPlaceholder)); 6027 } 6028 /* harmony default export */ var image_edit = (Object(external_this_wp_components_["withNotices"])(ImageEdit)); 6029 6030 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/save.js 6031 6032 6033 6034 /** 6035 * External dependencies 6036 */ 6037 6038 6039 /** 6040 * WordPress dependencies 6041 */ 6042 6043 6044 function image_save_save(_ref) { 6045 var _classnames; 6046 6047 var attributes = _ref.attributes; 6048 var url = attributes.url, 6049 alt = attributes.alt, 6050 caption = attributes.caption, 6051 align = attributes.align, 6052 href = attributes.href, 6053 rel = attributes.rel, 6054 linkClass = attributes.linkClass, 6055 width = attributes.width, 6056 height = attributes.height, 6057 id = attributes.id, 6058 linkTarget = attributes.linkTarget, 6059 sizeSlug = attributes.sizeSlug, 6060 title = attributes.title; 6061 var newRel = Object(external_this_lodash_["isEmpty"])(rel) ? undefined : rel; 6062 var classes = classnames_default()((_classnames = {}, Object(defineProperty["a" /* default */])(_classnames, "align".concat(align), align), Object(defineProperty["a" /* default */])(_classnames, "size-".concat(sizeSlug), sizeSlug), Object(defineProperty["a" /* default */])(_classnames, 'is-resized', width || height), _classnames)); 6063 var image = Object(external_this_wp_element_["createElement"])("img", { 6064 src: url, 6065 alt: alt, 6066 className: id ? "wp-image-".concat(id) : null, 6067 width: width, 6068 height: height, 6069 title: title 6070 }); 6071 var figure = Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, href ? Object(external_this_wp_element_["createElement"])("a", { 6072 className: linkClass, 6073 href: href, 6074 target: linkTarget, 6075 rel: newRel 6076 }, image) : image, !external_this_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 6077 tagName: "figcaption", 6078 value: caption 6079 })); 6080 6081 if ('left' === align || 'right' === align || 'center' === align) { 6082 return Object(external_this_wp_element_["createElement"])("div", external_this_wp_blockEditor_["useBlockProps"].save(), Object(external_this_wp_element_["createElement"])("figure", { 6083 className: classes 6084 }, figure)); 6085 } 6086 6087 return Object(external_this_wp_element_["createElement"])("figure", external_this_wp_blockEditor_["useBlockProps"].save({ 6088 className: classes 6089 }), figure); 6090 } 6091 6092 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/transforms.js 6093 6094 6095 function transforms_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } 6096 6097 function transforms_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { transforms_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { transforms_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 6098 6099 /** 6100 * WordPress dependencies 6101 */ 6102 6103 6104 function stripFirstImage(attributes, _ref) { 6105 var shortcode = _ref.shortcode; 6106 6107 var _document$implementat = document.implementation.createHTMLDocument(''), 6108 body = _document$implementat.body; 6109 6110 body.innerHTML = shortcode.content; 6111 var nodeToRemove = body.querySelector('img'); // if an image has parents, find the topmost node to remove 6112 6113 while (nodeToRemove && nodeToRemove.parentNode && nodeToRemove.parentNode !== body) { 6114 nodeToRemove = nodeToRemove.parentNode; 6115 } 6116 6117 if (nodeToRemove) { 6118 nodeToRemove.parentNode.removeChild(nodeToRemove); 6119 } 6120 6121 return body.innerHTML.trim(); 6122 } 6123 6124 function getFirstAnchorAttributeFormHTML(html, attributeName) { 6125 var _document$implementat2 = document.implementation.createHTMLDocument(''), 6126 body = _document$implementat2.body; 6127 6128 body.innerHTML = html; 6129 var firstElementChild = body.firstElementChild; 6130 6131 if (firstElementChild && firstElementChild.nodeName === 'A') { 6132 return firstElementChild.getAttribute(attributeName) || undefined; 6133 } 6134 } 6135 6136 var imageSchema = { 6137 img: { 6138 attributes: ['src', 'alt', 'title'], 6139 classes: ['alignleft', 'aligncenter', 'alignright', 'alignnone', /^wp-image-\d+$/] 6140 } 6141 }; 6142 6143 var schema = function schema(_ref2) { 6144 var phrasingContentSchema = _ref2.phrasingContentSchema; 6145 return { 6146 figure: { 6147 require: ['img'], 6148 children: transforms_objectSpread(transforms_objectSpread({}, imageSchema), {}, { 6149 a: { 6150 attributes: ['href', 'rel', 'target'], 6151 children: imageSchema 6152 }, 6153 figcaption: { 6154 children: phrasingContentSchema 6155 } 6156 }) 6157 } 6158 }; 6159 }; 6160 6161 var transforms_transforms = { 6162 from: [{ 6163 type: 'raw', 6164 isMatch: function isMatch(node) { 6165 return node.nodeName === 'FIGURE' && !!node.querySelector('img'); 6166 }, 6167 schema: schema, 6168 transform: function transform(node) { 6169 // Search both figure and image classes. Alignment could be 6170 // set on either. ID is set on the image. 6171 var className = node.className + ' ' + node.querySelector('img').className; 6172 var alignMatches = /(?:^|\s)align(left|center|right)(?:$|\s)/.exec(className); 6173 var anchor = node.id === '' ? undefined : node.id; 6174 var align = alignMatches ? alignMatches[1] : undefined; 6175 var idMatches = /(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(className); 6176 var id = idMatches ? Number(idMatches[1]) : undefined; 6177 var anchorElement = node.querySelector('a'); 6178 var linkDestination = anchorElement && anchorElement.href ? 'custom' : undefined; 6179 var href = anchorElement && anchorElement.href ? anchorElement.href : undefined; 6180 var rel = anchorElement && anchorElement.rel ? anchorElement.rel : undefined; 6181 var linkClass = anchorElement && anchorElement.className ? anchorElement.className : undefined; 6182 var attributes = Object(external_this_wp_blocks_["getBlockAttributes"])('core/image', node.outerHTML, { 6183 align: align, 6184 id: id, 6185 linkDestination: linkDestination, 6186 href: href, 6187 rel: rel, 6188 linkClass: linkClass, 6189 anchor: anchor 6190 }); 6191 return Object(external_this_wp_blocks_["createBlock"])('core/image', attributes); 6192 } 6193 }, { 6194 type: 'files', 6195 isMatch: function isMatch(files) { 6196 return files.length === 1 && files[0].type.indexOf('image/') === 0; 6197 }, 6198 transform: function transform(files) { 6199 var file = files[0]; // We don't need to upload the media directly here 6200 // It's already done as part of the `componentDidMount` 6201 // int the image block 6202 6203 return Object(external_this_wp_blocks_["createBlock"])('core/image', { 6204 url: Object(external_this_wp_blob_["createBlobURL"])(file) 6205 }); 6206 } 6207 }, { 6208 type: 'shortcode', 6209 tag: 'caption', 6210 attributes: { 6211 url: { 6212 type: 'string', 6213 source: 'attribute', 6214 attribute: 'src', 6215 selector: 'img' 6216 }, 6217 alt: { 6218 type: 'string', 6219 source: 'attribute', 6220 attribute: 'alt', 6221 selector: 'img' 6222 }, 6223 caption: { 6224 shortcode: stripFirstImage 6225 }, 6226 href: { 6227 shortcode: function shortcode(attributes, _ref3) { 6228 var _shortcode = _ref3.shortcode; 6229 return getFirstAnchorAttributeFormHTML(_shortcode.content, 'href'); 6230 } 6231 }, 6232 rel: { 6233 shortcode: function shortcode(attributes, _ref4) { 6234 var _shortcode2 = _ref4.shortcode; 6235 return getFirstAnchorAttributeFormHTML(_shortcode2.content, 'rel'); 6236 } 6237 }, 6238 linkClass: { 6239 shortcode: function shortcode(attributes, _ref5) { 6240 var _shortcode3 = _ref5.shortcode; 6241 return getFirstAnchorAttributeFormHTML(_shortcode3.content, 'class'); 6242 } 6243 }, 6244 id: { 6245 type: 'number', 6246 shortcode: function shortcode(_ref6) { 6247 var id = _ref6.named.id; 6248 6249 if (!id) { 6250 return; 6251 } 6252 6253 return parseInt(id.replace('attachment_', ''), 10); 6254 } 6255 }, 6256 align: { 6257 type: 'string', 6258 shortcode: function shortcode(_ref7) { 6259 var _ref7$named$align = _ref7.named.align, 6260 align = _ref7$named$align === void 0 ? 'alignnone' : _ref7$named$align; 6261 return align.replace('align', ''); 6262 } 6263 } 6264 } 6265 }] 6266 }; 6267 /* harmony default export */ var image_transforms = (transforms_transforms); 6268 6269 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/index.js 6270 /** 6271 * WordPress dependencies 6272 */ 6273 6274 6275 /** 6276 * Internal dependencies 6277 */ 6278 6279 6280 6281 var image_metadata = { 6282 apiVersion: 2, 6283 name: "core/image", 6284 category: "media", 6285 attributes: { 6286 align: { 6287 type: "string" 6288 }, 6289 url: { 6290 type: "string", 6291 source: "attribute", 6292 selector: "img", 6293 attribute: "src" 6294 }, 6295 alt: { 6296 type: "string", 6297 source: "attribute", 6298 selector: "img", 6299 attribute: "alt", 6300 "default": "" 6301 }, 6302 caption: { 6303 type: "string", 6304 source: "html", 6305 selector: "figcaption" 6306 }, 6307 title: { 6308 type: "string", 6309 source: "attribute", 6310 selector: "img", 6311 attribute: "title" 6312 }, 6313 href: { 6314 type: "string", 6315 source: "attribute", 6316 selector: "figure > a", 6317 attribute: "href" 6318 }, 6319 rel: { 6320 type: "string", 6321 source: "attribute", 6322 selector: "figure > a", 6323 attribute: "rel" 6324 }, 6325 linkClass: { 6326 type: "string", 6327 source: "attribute", 6328 selector: "figure > a", 6329 attribute: "class" 6330 }, 6331 id: { 6332 type: "number" 6333 }, 6334 width: { 6335 type: "number" 6336 }, 6337 height: { 6338 type: "number" 6339 }, 6340 sizeSlug: { 6341 type: "string" 6342 }, 6343 linkDestination: { 6344 type: "string" 6345 }, 6346 linkTarget: { 6347 type: "string", 6348 source: "attribute", 6349 selector: "figure > a", 6350 attribute: "target" 6351 } 6352 }, 6353 supports: { 6354 anchor: true 6355 } 6356 }; 6357 6358 6359 var image_name = image_metadata.name; 6360 6361 var image_settings = { 6362 title: Object(external_this_wp_i18n_["__"])('Image'), 6363 description: Object(external_this_wp_i18n_["__"])('Insert an image to make a visual statement.'), 6364 icon: library_image, 6365 keywords: ['img', // "img" is not translated as it is intended to reflect the HTML <img> tag. 6366 Object(external_this_wp_i18n_["__"])('photo'), Object(external_this_wp_i18n_["__"])('picture')], 6367 example: { 6368 attributes: { 6369 sizeSlug: 'large', 6370 url: 'https://s.w.org/images/core/5.3/MtBlanc1.jpg', 6371 // translators: Caption accompanying an image of the Mont Blanc, which serves as an example for the Image block. 6372 caption: Object(external_this_wp_i18n_["__"])('Mont Blanc appears—still, snowy, and serene.') 6373 } 6374 }, 6375 styles: [{ 6376 name: 'default', 6377 label: Object(external_this_wp_i18n_["_x"])('Default', 'block style'), 6378 isDefault: true 6379 }, { 6380 name: 'rounded', 6381 label: Object(external_this_wp_i18n_["_x"])('Rounded', 'block style') 6382 }], 6383 __experimentalLabel: function __experimentalLabel(attributes, _ref) { 6384 var context = _ref.context; 6385 6386 if (context === 'accessibility') { 6387 var caption = attributes.caption, 6388 alt = attributes.alt, 6389 url = attributes.url; 6390 6391 if (!url) { 6392 return Object(external_this_wp_i18n_["__"])('Empty'); 6393 } 6394 6395 if (!alt) { 6396 return caption || ''; 6397 } // This is intended to be read by a screen reader. 6398 // A period simply means a pause, no need to translate it. 6399 6400 6401 return alt + (caption ? '. ' + caption : ''); 6402 } 6403 }, 6404 getEditWrapperProps: function getEditWrapperProps(attributes) { 6405 return { 6406 'data-align': attributes.align 6407 }; 6408 }, 6409 transforms: image_transforms, 6410 edit: image_edit, 6411 save: image_save_save, 6412 deprecated: image_deprecated 6413 }; 6414 6415 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/heading.js 6416 6417 6418 /** 6419 * WordPress dependencies 6420 */ 6421 6422 var heading = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], { 6423 xmlns: "http://www.w3.org/2000/svg", 6424 viewBox: "0 0 24 24" 6425 }, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], { 6426 d: "M6.2 5.2v13.4l5.8-4.8 5.8 4.8V5.2z" 6427 })); 6428 /* harmony default export */ var library_heading = (heading); 6429 6430 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js 6431 var objectWithoutProperties = __webpack_require__(14); 6432 6433 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/deprecated.js 6434 6435 6436 6437 6438 function deprecated_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } 6439 6440 function deprecated_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { deprecated_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { deprecated_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 6441 6442 /** 6443 * External dependencies 6444 */ 6445 6446 6447 /** 6448 * WordPress dependencies 6449 */ 6450 6451 6452 var blockSupports = { 6453 className: false, 6454 anchor: true 6455 }; 6456 var heading_deprecated_blockAttributes = { 6457 align: { 6458 type: 'string' 6459 }, 6460 content: { 6461 type: 'string', 6462 source: 'html', 6463 selector: 'h1,h2,h3,h4,h5,h6', 6464 default: '' 6465 }, 6466 level: { 6467 type: 'number', 6468 default: 2 6469 }, 6470 placeholder: { 6471 type: 'string' 6472 } 6473 }; 6474 6475 var deprecated_migrateCustomColors = function migrateCustomColors(attributes) { 6476 if (!attributes.customTextColor) { 6477 return attributes; 6478 } 6479 6480 var style = { 6481 color: { 6482 text: attributes.customTextColor 6483 } 6484 }; 6485 return deprecated_objectSpread(deprecated_objectSpread({}, Object(external_this_lodash_["omit"])(attributes, ['customTextColor'])), {}, { 6486 style: style 6487 }); 6488 }; 6489 6490 var TEXT_ALIGN_OPTIONS = ['left', 'right', 'center']; 6491 6492 var deprecated_migrateTextAlign = function migrateTextAlign(attributes) { 6493 var align = attributes.align, 6494 rest = Object(objectWithoutProperties["a" /* default */])(attributes, ["align"]); 6495 6496 return TEXT_ALIGN_OPTIONS.includes(align) ? deprecated_objectSpread(deprecated_objectSpread({}, rest), {}, { 6497 textAlign: align 6498 }) : attributes; 6499 }; 6500 6501 var heading_deprecated_deprecated = [{ 6502 supports: { 6503 align: ['wide', 'full'], 6504 anchor: true, 6505 className: false, 6506 color: { 6507 link: true 6508 }, 6509 fontSize: true, 6510 lineHeight: true, 6511 __experimentalSelector: { 6512 'core/heading/h1': 'h1', 6513 'core/heading/h2': 'h2', 6514 'core/heading/h3': 'h3', 6515 'core/heading/h4': 'h4', 6516 'core/heading/h5': 'h5', 6517 'core/heading/h6': 'h6' 6518 }, 6519 __unstablePasteTextInline: true 6520 }, 6521 attributes: heading_deprecated_blockAttributes, 6522 isEligible: function isEligible(_ref) { 6523 var align = _ref.align; 6524 return TEXT_ALIGN_OPTIONS.includes(align); 6525 }, 6526 migrate: deprecated_migrateTextAlign, 6527 save: function save(_ref2) { 6528 var attributes = _ref2.attributes; 6529 var align = attributes.align, 6530 content = attributes.content, 6531 level = attributes.level; 6532 var TagName = 'h' + level; 6533 var className = classnames_default()(Object(defineProperty["a" /* default */])({}, "has-text-align-".concat(align), align)); 6534 return Object(external_this_wp_element_["createElement"])(TagName, external_this_wp_blockEditor_["useBlockProps"].save({ 6535 className: className 6536 }), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 6537 value: content 6538 })); 6539 } 6540 }, { 6541 supports: blockSupports, 6542 attributes: deprecated_objectSpread(deprecated_objectSpread({}, heading_deprecated_blockAttributes), {}, { 6543 customTextColor: { 6544 type: 'string' 6545 }, 6546 textColor: { 6547 type: 'string' 6548 } 6549 }), 6550 migrate: function migrate(attributes) { 6551 return deprecated_migrateCustomColors(deprecated_migrateTextAlign(attributes)); 6552 }, 6553 save: function save(_ref3) { 6554 var _classnames2; 6555 6556 var attributes = _ref3.attributes; 6557 var align = attributes.align, 6558 content = attributes.content, 6559 customTextColor = attributes.customTextColor, 6560 level = attributes.level, 6561 textColor = attributes.textColor; 6562 var tagName = 'h' + level; 6563 var textClass = Object(external_this_wp_blockEditor_["getColorClassName"])('color', textColor); 6564 var className = classnames_default()((_classnames2 = {}, Object(defineProperty["a" /* default */])(_classnames2, textClass, textClass), Object(defineProperty["a" /* default */])(_classnames2, 'has-text-color', textColor || customTextColor), Object(defineProperty["a" /* default */])(_classnames2, "has-text-align-".concat(align), align), _classnames2)); 6565 return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 6566 className: className ? className : undefined, 6567 tagName: tagName, 6568 style: { 6569 color: textClass ? undefined : customTextColor 6570 }, 6571 value: content 6572 }); 6573 } 6574 }, { 6575 attributes: deprecated_objectSpread(deprecated_objectSpread({}, heading_deprecated_blockAttributes), {}, { 6576 customTextColor: { 6577 type: 'string' 6578 }, 6579 textColor: { 6580 type: 'string' 6581 } 6582 }), 6583 migrate: function migrate(attributes) { 6584 return deprecated_migrateCustomColors(deprecated_migrateTextAlign(attributes)); 6585 }, 6586 save: function save(_ref4) { 6587 var _classnames3; 6588 6589 var attributes = _ref4.attributes; 6590 var align = attributes.align, 6591 content = attributes.content, 6592 customTextColor = attributes.customTextColor, 6593 level = attributes.level, 6594 textColor = attributes.textColor; 6595 var tagName = 'h' + level; 6596 var textClass = Object(external_this_wp_blockEditor_["getColorClassName"])('color', textColor); 6597 var className = classnames_default()((_classnames3 = {}, Object(defineProperty["a" /* default */])(_classnames3, textClass, textClass), Object(defineProperty["a" /* default */])(_classnames3, "has-text-align-".concat(align), align), _classnames3)); 6598 return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 6599 className: className ? className : undefined, 6600 tagName: tagName, 6601 style: { 6602 color: textClass ? undefined : customTextColor 6603 }, 6604 value: content 6605 }); 6606 }, 6607 supports: blockSupports 6608 }, { 6609 supports: blockSupports, 6610 attributes: deprecated_objectSpread(deprecated_objectSpread({}, heading_deprecated_blockAttributes), {}, { 6611 customTextColor: { 6612 type: 'string' 6613 }, 6614 textColor: { 6615 type: 'string' 6616 } 6617 }), 6618 migrate: function migrate(attributes) { 6619 return deprecated_migrateCustomColors(deprecated_migrateTextAlign(attributes)); 6620 }, 6621 save: function save(_ref5) { 6622 var attributes = _ref5.attributes; 6623 var align = attributes.align, 6624 level = attributes.level, 6625 content = attributes.content, 6626 textColor = attributes.textColor, 6627 customTextColor = attributes.customTextColor; 6628 var tagName = 'h' + level; 6629 var textClass = Object(external_this_wp_blockEditor_["getColorClassName"])('color', textColor); 6630 var className = classnames_default()(Object(defineProperty["a" /* default */])({}, textClass, textClass)); 6631 return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 6632 className: className ? className : undefined, 6633 tagName: tagName, 6634 style: { 6635 textAlign: align, 6636 color: textClass ? undefined : customTextColor 6637 }, 6638 value: content 6639 }); 6640 } 6641 }]; 6642 /* harmony default export */ var heading_deprecated = (heading_deprecated_deprecated); 6643 6644 // EXTERNAL MODULE: external {"this":["wp","keycodes"]} 6645 var external_this_wp_keycodes_ = __webpack_require__(18); 6646 6647 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/heading-level-icon.js 6648 6649 6650 /** 6651 * WordPress dependencies 6652 */ 6653 6654 /** @typedef {import('@wordpress/element').WPComponent} WPComponent */ 6655 6656 /** 6657 * HeadingLevelIcon props. 6658 * 6659 * @typedef WPHeadingLevelIconProps 6660 * 6661 * @property {number} level The heading level to show an icon for. 6662 * @property {?boolean} isPressed Whether or not the icon should appear pressed; default: false. 6663 */ 6664 6665 /** 6666 * Heading level icon. 6667 * 6668 * @param {WPHeadingLevelIconProps} props Component props. 6669 * 6670 * @return {?WPComponent} The icon. 6671 */ 6672 6673 function HeadingLevelIcon(_ref) { 6674 var level = _ref.level, 6675 _ref$isPressed = _ref.isPressed, 6676 isPressed = _ref$isPressed === void 0 ? false : _ref$isPressed; 6677 var levelToPath = { 6678 1: 'M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z', 6679 2: 'M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z', 6680 3: 'M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z', 6681 4: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z', 6682 5: 'M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z', 6683 6: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z' 6684 }; 6685 6686 if (!levelToPath.hasOwnProperty(level)) { 6687 return null; 6688 } 6689 6690 return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["SVG"], { 6691 width: "24", 6692 height: "24", 6693 viewBox: "0 0 20 20", 6694 xmlns: "http://www.w3.org/2000/svg", 6695 isPressed: isPressed 6696 }, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Path"], { 6697 d: levelToPath[level] 6698 })); 6699 } 6700 6701 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/heading-level-dropdown.js 6702 6703 6704 /** 6705 * WordPress dependencies 6706 */ 6707 6708 6709 6710 /** 6711 * Internal dependencies 6712 */ 6713 6714 6715 var HEADING_LEVELS = [1, 2, 3, 4, 5, 6]; 6716 var heading_level_dropdown_POPOVER_PROPS = { 6717 className: 'block-library-heading-level-dropdown', 6718 isAlternate: true 6719 }; 6720 /** @typedef {import('@wordpress/element').WPComponent} WPComponent */ 6721 6722 /** 6723 * HeadingLevelDropdown props. 6724 * 6725 * @typedef WPHeadingLevelDropdownProps 6726 * 6727 * @property {number} selectedLevel The chosen heading level. 6728 * @property {(newValue:number)=>any} onChange Callback to run when 6729 * toolbar value is changed. 6730 */ 6731 6732 /** 6733 * Dropdown for selecting a heading level (1 through 6). 6734 * 6735 * @param {WPHeadingLevelDropdownProps} props Component props. 6736 * 6737 * @return {WPComponent} The toolbar. 6738 */ 6739 6740 function HeadingLevelDropdown(_ref) { 6741 var selectedLevel = _ref.selectedLevel, 6742 onChange = _ref.onChange; 6743 return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Dropdown"], { 6744 popoverProps: heading_level_dropdown_POPOVER_PROPS, 6745 renderToggle: function renderToggle(_ref2) { 6746 var onToggle = _ref2.onToggle, 6747 isOpen = _ref2.isOpen; 6748 6749 var openOnArrowDown = function openOnArrowDown(event) { 6750 if (!isOpen && event.keyCode === external_this_wp_keycodes_["DOWN"]) { 6751 event.preventDefault(); 6752 event.stopPropagation(); 6753 onToggle(); 6754 } 6755 }; 6756 6757 return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToolbarButton"], { 6758 "aria-expanded": isOpen, 6759 "aria-haspopup": "true", 6760 icon: Object(external_this_wp_element_["createElement"])(HeadingLevelIcon, { 6761 level: selectedLevel 6762 }), 6763 label: Object(external_this_wp_i18n_["__"])('Change heading level'), 6764 onClick: onToggle, 6765 onKeyDown: openOnArrowDown, 6766 showTooltip: true 6767 }); 6768 }, 6769 renderContent: function renderContent() { 6770 return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Toolbar"], { 6771 className: "block-library-heading-level-toolbar", 6772 label: Object(external_this_wp_i18n_["__"])('Change heading level') 6773 }, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToolbarGroup"], { 6774 isCollapsed: false, 6775 controls: HEADING_LEVELS.map(function (targetLevel) { 6776 var isActive = targetLevel === selectedLevel; 6777 return { 6778 icon: Object(external_this_wp_element_["createElement"])(HeadingLevelIcon, { 6779 level: targetLevel, 6780 isPressed: isActive 6781 }), 6782 title: Object(external_this_wp_i18n_["sprintf"])( // translators: %s: heading level e.g: "1", "2", "3" 6783 Object(external_this_wp_i18n_["__"])('Heading %d'), targetLevel), 6784 isActive: isActive, 6785 onClick: function onClick() { 6786 onChange(targetLevel); 6787 } 6788 }; 6789 }) 6790 })); 6791 } 6792 }); 6793 } 6794 6795 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/edit.js 6796 6797 6798 6799 6800 function heading_edit_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } 6801 6802 function heading_edit_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { heading_edit_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { heading_edit_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 6803 6804 /** 6805 * External dependencies 6806 */ 6807 6808 /** 6809 * WordPress dependencies 6810 */ 6811 6812 6813 6814 6815 6816 /** 6817 * Internal dependencies 6818 */ 6819 6820 6821 6822 function HeadingEdit(_ref) { 6823 var attributes = _ref.attributes, 6824 setAttributes = _ref.setAttributes, 6825 mergeBlocks = _ref.mergeBlocks, 6826 onReplace = _ref.onReplace, 6827 mergedStyle = _ref.mergedStyle; 6828 var textAlign = attributes.textAlign, 6829 content = attributes.content, 6830 level = attributes.level, 6831 placeholder = attributes.placeholder; 6832 var tagName = 'h' + level; 6833 var blockProps = Object(external_this_wp_blockEditor_["useBlockProps"])({ 6834 className: classnames_default()(Object(defineProperty["a" /* default */])({}, "has-text-align-".concat(textAlign), textAlign)), 6835 style: mergedStyle 6836 }); 6837 return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["BlockControls"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToolbarGroup"], null, Object(external_this_wp_element_["createElement"])(HeadingLevelDropdown, { 6838 selectedLevel: level, 6839 onChange: function onChange(newLevel) { 6840 return setAttributes({ 6841 level: newLevel 6842 }); 6843 } 6844 })), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["AlignmentToolbar"], { 6845 value: textAlign, 6846 onChange: function onChange(nextAlign) { 6847 setAttributes({ 6848 textAlign: nextAlign 6849 }); 6850 } 6851 })), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"], Object(esm_extends["a" /* default */])({ 6852 identifier: "content", 6853 tagName: tagName, 6854 value: content, 6855 onChange: function onChange(value) { 6856 return setAttributes({ 6857 content: value 6858 }); 6859 }, 6860 onMerge: mergeBlocks, 6861 onSplit: function onSplit(value) { 6862 if (!value) { 6863 return Object(external_this_wp_blocks_["createBlock"])('core/paragraph'); 6864 } 6865 6866 return Object(external_this_wp_blocks_["createBlock"])('core/heading', heading_edit_objectSpread(heading_edit_objectSpread({}, attributes), {}, { 6867 content: value 6868 })); 6869 }, 6870 onReplace: onReplace, 6871 onRemove: function onRemove() { 6872 return onReplace([]); 6873 }, 6874 placeholder: placeholder || Object(external_this_wp_i18n_["__"])('Write heading…'), 6875 textAlign: textAlign 6876 }, blockProps))); 6877 } 6878 6879 /* harmony default export */ var heading_edit = (HeadingEdit); 6880 6881 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/save.js 6882 6883 6884 6885 /** 6886 * External dependencies 6887 */ 6888 6889 /** 6890 * WordPress dependencies 6891 */ 6892 6893 6894 function heading_save_save(_ref) { 6895 var attributes = _ref.attributes; 6896 var textAlign = attributes.textAlign, 6897 content = attributes.content, 6898 level = attributes.level; 6899 var TagName = 'h' + level; 6900 var className = classnames_default()(Object(defineProperty["a" /* default */])({}, "has-text-align-".concat(textAlign), textAlign)); 6901 return Object(external_this_wp_element_["createElement"])(TagName, external_this_wp_blockEditor_["useBlockProps"].save({ 6902 className: className 6903 }), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 6904 value: content 6905 })); 6906 } 6907 6908 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/shared.js 6909 /** 6910 * Given a node name string for a heading node, returns its numeric level. 6911 * 6912 * @param {string} nodeName Heading node name. 6913 * 6914 * @return {number} Heading level. 6915 */ 6916 function getLevelFromHeadingNodeName(nodeName) { 6917 return Number(nodeName.substr(1)); 6918 } 6919 6920 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/transforms.js 6921 6922 6923 /** 6924 * WordPress dependencies 6925 */ 6926 6927 /** 6928 * Internal dependencies 6929 */ 6930 6931 6932 var transforms_apiVersion$name$cate = { 6933 apiVersion: 2, 6934 name: "core/heading", 6935 category: "text", 6936 attributes: { 6937 textAlign: { 6938 type: "string" 6939 }, 6940 content: { 6941 type: "string", 6942 source: "html", 6943 selector: "h1,h2,h3,h4,h5,h6", 6944 "default": "" 6945 }, 6946 level: { 6947 type: "number", 6948 "default": 2 6949 }, 6950 placeholder: { 6951 type: "string" 6952 } 6953 }, 6954 supports: { 6955 align: ["wide", "full"], 6956 anchor: true, 6957 className: false, 6958 color: { 6959 link: true 6960 }, 6961 fontSize: true, 6962 lineHeight: true, 6963 __experimentalSelector: { 6964 "core/heading/h1": "h1", 6965 "core/heading/h2": "h2", 6966 "core/heading/h3": "h3", 6967 "core/heading/h4": "h4", 6968 "core/heading/h5": "h5", 6969 "core/heading/h6": "h6" 6970 }, 6971 __unstablePasteTextInline: true 6972 } 6973 }, 6974 heading_transforms_name = transforms_apiVersion$name$cate.name; 6975 var heading_transforms_transforms = { 6976 from: [{ 6977 type: 'block', 6978 isMultiBlock: true, 6979 blocks: ['core/paragraph'], 6980 transform: function transform(attributes) { 6981 return attributes.map(function (_ref) { 6982 var content = _ref.content, 6983 anchor = _ref.anchor; 6984 return Object(external_this_wp_blocks_["createBlock"])(heading_transforms_name, { 6985 content: content, 6986 anchor: anchor 6987 }); 6988 }); 6989 } 6990 }, { 6991 type: 'raw', 6992 selector: 'h1,h2,h3,h4,h5,h6', 6993 schema: function schema(_ref2) { 6994 var phrasingContentSchema = _ref2.phrasingContentSchema, 6995 isPaste = _ref2.isPaste; 6996 var schema = { 6997 children: phrasingContentSchema, 6998 attributes: isPaste ? [] : ['style', 'id'] 6999 }; 7000 return { 7001 h1: schema, 7002 h2: schema, 7003 h3: schema, 7004 h4: schema, 7005 h5: schema, 7006 h6: schema 7007 }; 7008 }, 7009 transform: function transform(node) { 7010 var attributes = Object(external_this_wp_blocks_["getBlockAttributes"])(heading_transforms_name, node.outerHTML); 7011 7012 var _ref3 = node.style || {}, 7013 textAlign = _ref3.textAlign; 7014 7015 attributes.level = getLevelFromHeadingNodeName(node.nodeName); 7016 7017 if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') { 7018 attributes.align = textAlign; 7019 } 7020 7021 return Object(external_this_wp_blocks_["createBlock"])(heading_transforms_name, attributes); 7022 } 7023 }].concat(Object(toConsumableArray["a" /* default */])([1, 2, 3, 4, 5, 6].map(function (level) { 7024 return { 7025 type: 'prefix', 7026 prefix: Array(level + 1).join('#'), 7027 transform: function transform(content) { 7028 return Object(external_this_wp_blocks_["createBlock"])(heading_transforms_name, { 7029 level: level, 7030 content: content 7031 }); 7032 } 7033 }; 7034 }))), 7035 to: [{ 7036 type: 'block', 7037 isMultiBlock: true, 7038 blocks: ['core/paragraph'], 7039 transform: function transform(attributes) { 7040 return attributes.map(function (_ref4) { 7041 var content = _ref4.content, 7042 anchor = _ref4.anchor; 7043 return Object(external_this_wp_blocks_["createBlock"])('core/paragraph', { 7044 content: content, 7045 anchor: anchor 7046 }); 7047 }); 7048 } 7049 }] 7050 }; 7051 /* harmony default export */ var heading_transforms = (heading_transforms_transforms); 7052 7053 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/index.js 7054 /** 7055 * External dependencies 7056 */ 7057 7058 /** 7059 * WordPress dependencies 7060 */ 7061 7062 7063 7064 /** 7065 * Internal dependencies 7066 */ 7067 7068 7069 7070 var heading_metadata = { 7071 apiVersion: 2, 7072 name: "core/heading", 7073 category: "text", 7074 attributes: { 7075 textAlign: { 7076 type: "string" 7077 }, 7078 content: { 7079 type: "string", 7080 source: "html", 7081 selector: "h1,h2,h3,h4,h5,h6", 7082 "default": "" 7083 }, 7084 level: { 7085 type: "number", 7086 "default": 2 7087 }, 7088 placeholder: { 7089 type: "string" 7090 } 7091 }, 7092 supports: { 7093 align: ["wide", "full"], 7094 anchor: true, 7095 className: false, 7096 color: { 7097 link: true 7098 }, 7099 fontSize: true, 7100 lineHeight: true, 7101 __experimentalSelector: { 7102 "core/heading/h1": "h1", 7103 "core/heading/h2": "h2", 7104 "core/heading/h3": "h3", 7105 "core/heading/h4": "h4", 7106 "core/heading/h5": "h5", 7107 "core/heading/h6": "h6" 7108 }, 7109 __unstablePasteTextInline: true 7110 } 7111 }; 7112 7113 7114 var heading_name = heading_metadata.name; 7115 7116 var heading_settings = { 7117 title: Object(external_this_wp_i18n_["__"])('Heading'), 7118 description: Object(external_this_wp_i18n_["__"])('Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.'), 7119 icon: library_heading, 7120 keywords: [Object(external_this_wp_i18n_["__"])('title'), Object(external_this_wp_i18n_["__"])('subtitle')], 7121 example: { 7122 attributes: { 7123 content: Object(external_this_wp_i18n_["__"])('Code is Poetry'), 7124 level: 2 7125 } 7126 }, 7127 __experimentalLabel: function __experimentalLabel(attributes, _ref) { 7128 var context = _ref.context; 7129 7130 if (context === 'accessibility') { 7131 var content = attributes.content, 7132 level = attributes.level; 7133 return Object(external_this_lodash_["isEmpty"])(content) ? Object(external_this_wp_i18n_["sprintf"])( 7134 /* translators: accessibility text. %s: heading level. */ 7135 Object(external_this_wp_i18n_["__"])('Level %s. Empty.'), level) : Object(external_this_wp_i18n_["sprintf"])( 7136 /* translators: accessibility text. 1: heading level. 2: heading content. */ 7137 Object(external_this_wp_i18n_["__"])('Level %1$s. %2$s'), level, content); 7138 } 7139 }, 7140 transforms: heading_transforms, 7141 deprecated: heading_deprecated, 7142 merge: function merge(attributes, attributesToMerge) { 7143 return { 7144 content: (attributes.content || '') + (attributesToMerge.content || '') 7145 }; 7146 }, 7147 edit: heading_edit, 7148 save: heading_save_save 7149 }; 7150 7151 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/quote.js 7152 7153 7154 /** 7155 * WordPress dependencies 7156 */ 7157 7158 var quote = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], { 7159 viewBox: "0 0 24 24", 7160 xmlns: "http://www.w3.org/2000/svg" 7161 }, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], { 7162 d: "M13 6v6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H13zm-9 6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H4v6z" 7163 })); 7164 /* harmony default export */ var library_quote = (quote); 7165 7166 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/deprecated.js 7167 7168 7169 7170 function quote_deprecated_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } 7171 7172 function quote_deprecated_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { quote_deprecated_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { quote_deprecated_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 7173 7174 /** 7175 * External dependencies 7176 */ 7177 7178 /** 7179 * WordPress dependencies 7180 */ 7181 7182 7183 var quote_deprecated_blockAttributes = { 7184 value: { 7185 type: 'string', 7186 source: 'html', 7187 selector: 'blockquote', 7188 multiline: 'p', 7189 default: '' 7190 }, 7191 citation: { 7192 type: 'string', 7193 source: 'html', 7194 selector: 'cite', 7195 default: '' 7196 }, 7197 align: { 7198 type: 'string' 7199 } 7200 }; 7201 var quote_deprecated_deprecated = [{ 7202 attributes: quote_deprecated_blockAttributes, 7203 save: function save(_ref) { 7204 var attributes = _ref.attributes; 7205 var align = attributes.align, 7206 value = attributes.value, 7207 citation = attributes.citation; 7208 return Object(external_this_wp_element_["createElement"])("blockquote", { 7209 style: { 7210 textAlign: align ? align : null 7211 } 7212 }, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 7213 multiline: true, 7214 value: value 7215 }), !external_this_wp_blockEditor_["RichText"].isEmpty(citation) && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 7216 tagName: "cite", 7217 value: citation 7218 })); 7219 } 7220 }, { 7221 attributes: quote_deprecated_objectSpread(quote_deprecated_objectSpread({}, quote_deprecated_blockAttributes), {}, { 7222 style: { 7223 type: 'number', 7224 default: 1 7225 } 7226 }), 7227 migrate: function migrate(attributes) { 7228 if (attributes.style === 2) { 7229 return quote_deprecated_objectSpread(quote_deprecated_objectSpread({}, Object(external_this_lodash_["omit"])(attributes, ['style'])), {}, { 7230 className: attributes.className ? attributes.className + ' is-style-large' : 'is-style-large' 7231 }); 7232 } 7233 7234 return attributes; 7235 }, 7236 save: function save(_ref2) { 7237 var attributes = _ref2.attributes; 7238 var align = attributes.align, 7239 value = attributes.value, 7240 citation = attributes.citation, 7241 style = attributes.style; 7242 return Object(external_this_wp_element_["createElement"])("blockquote", { 7243 className: style === 2 ? 'is-large' : '', 7244 style: { 7245 textAlign: align ? align : null 7246 } 7247 }, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 7248 multiline: true, 7249 value: value 7250 }), !external_this_wp_blockEditor_["RichText"].isEmpty(citation) && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 7251 tagName: "cite", 7252 value: citation 7253 })); 7254 } 7255 }, { 7256 attributes: quote_deprecated_objectSpread(quote_deprecated_objectSpread({}, quote_deprecated_blockAttributes), {}, { 7257 citation: { 7258 type: 'string', 7259 source: 'html', 7260 selector: 'footer', 7261 default: '' 7262 }, 7263 style: { 7264 type: 'number', 7265 default: 1 7266 } 7267 }), 7268 save: function save(_ref3) { 7269 var attributes = _ref3.attributes; 7270 var align = attributes.align, 7271 value = attributes.value, 7272 citation = attributes.citation, 7273 style = attributes.style; 7274 return Object(external_this_wp_element_["createElement"])("blockquote", { 7275 className: "blocks-quote-style-".concat(style), 7276 style: { 7277 textAlign: align ? align : null 7278 } 7279 }, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 7280 multiline: true, 7281 value: value 7282 }), !external_this_wp_blockEditor_["RichText"].isEmpty(citation) && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 7283 tagName: "footer", 7284 value: citation 7285 })); 7286 } 7287 }]; 7288 /* harmony default export */ var quote_deprecated = (quote_deprecated_deprecated); 7289 7290 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/edit.js 7291 7292 7293 7294 function quote_edit_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } 7295 7296 function quote_edit_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { quote_edit_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { quote_edit_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 7297 7298 /** 7299 * External dependencies 7300 */ 7301 7302 /** 7303 * WordPress dependencies 7304 */ 7305 7306 7307 7308 7309 7310 function QuoteEdit(_ref) { 7311 var attributes = _ref.attributes, 7312 setAttributes = _ref.setAttributes, 7313 isSelected = _ref.isSelected, 7314 mergeBlocks = _ref.mergeBlocks, 7315 onReplace = _ref.onReplace, 7316 className = _ref.className, 7317 insertBlocksAfter = _ref.insertBlocksAfter; 7318 var align = attributes.align, 7319 value = attributes.value, 7320 citation = attributes.citation; 7321 var blockProps = Object(external_this_wp_blockEditor_["useBlockProps"])({ 7322 className: classnames_default()(className, Object(defineProperty["a" /* default */])({}, "has-text-align-".concat(align), align)) 7323 }); 7324 return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["BlockControls"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["AlignmentToolbar"], { 7325 value: align, 7326 onChange: function onChange(nextAlign) { 7327 setAttributes({ 7328 align: nextAlign 7329 }); 7330 } 7331 })), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["BlockQuotation"], blockProps, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"], { 7332 identifier: "value", 7333 multiline: true, 7334 value: value, 7335 onChange: function onChange(nextValue) { 7336 return setAttributes({ 7337 value: nextValue 7338 }); 7339 }, 7340 onMerge: mergeBlocks, 7341 onRemove: function onRemove(forward) { 7342 var hasEmptyCitation = !citation || citation.length === 0; 7343 7344 if (!forward && hasEmptyCitation) { 7345 onReplace([]); 7346 } 7347 }, 7348 placeholder: // translators: placeholder text used for the quote 7349 Object(external_this_wp_i18n_["__"])('Write quote…'), 7350 onReplace: onReplace, 7351 onSplit: function onSplit(piece) { 7352 return Object(external_this_wp_blocks_["createBlock"])('core/quote', quote_edit_objectSpread(quote_edit_objectSpread({}, attributes), {}, { 7353 value: piece 7354 })); 7355 }, 7356 __unstableOnSplitMiddle: function __unstableOnSplitMiddle() { 7357 return Object(external_this_wp_blocks_["createBlock"])('core/paragraph'); 7358 }, 7359 textAlign: align 7360 }), (!external_this_wp_blockEditor_["RichText"].isEmpty(citation) || isSelected) && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"], { 7361 identifier: "citation", 7362 value: citation, 7363 onChange: function onChange(nextCitation) { 7364 return setAttributes({ 7365 citation: nextCitation 7366 }); 7367 }, 7368 __unstableMobileNoFocusOnMount: true, 7369 placeholder: // translators: placeholder text used for the citation 7370 Object(external_this_wp_i18n_["__"])('Write citation…'), 7371 className: "wp-block-quote__citation", 7372 textAlign: align, 7373 __unstableOnSplitAtEnd: function __unstableOnSplitAtEnd() { 7374 return insertBlocksAfter(Object(external_this_wp_blocks_["createBlock"])('core/paragraph')); 7375 } 7376 }))); 7377 } 7378 7379 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/save.js 7380 7381 7382 7383 /** 7384 * External dependencies 7385 */ 7386 7387 /** 7388 * WordPress dependencies 7389 */ 7390 7391 7392 function quote_save_save(_ref) { 7393 var attributes = _ref.attributes; 7394 var align = attributes.align, 7395 value = attributes.value, 7396 citation = attributes.citation; 7397 var className = classnames_default()(Object(defineProperty["a" /* default */])({}, "has-text-align-".concat(align), align)); 7398 return Object(external_this_wp_element_["createElement"])("blockquote", external_this_wp_blockEditor_["useBlockProps"].save({ 7399 className: className 7400 }), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 7401 multiline: true, 7402 value: value 7403 }), !external_this_wp_blockEditor_["RichText"].isEmpty(citation) && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 7404 tagName: "cite", 7405 value: citation 7406 })); 7407 } 7408 7409 // EXTERNAL MODULE: external {"this":["wp","richText"]} 7410 var external_this_wp_richText_ = __webpack_require__(25); 7411 7412 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/transforms.js 7413 7414 7415 7416 7417 function quote_transforms_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } 7418 7419 function quote_transforms_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { quote_transforms_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { quote_transforms_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 7420 7421 /** 7422 * WordPress dependencies 7423 */ 7424 7425 7426 var quote_transforms_transforms = { 7427 from: [{ 7428 type: 'block', 7429 isMultiBlock: true, 7430 blocks: ['core/paragraph'], 7431 transform: function transform(attributes) { 7432 return Object(external_this_wp_blocks_["createBlock"])('core/quote', { 7433 value: Object(external_this_wp_richText_["toHTMLString"])({ 7434 value: Object(external_this_wp_richText_["join"])(attributes.map(function (_ref) { 7435 var content = _ref.content; 7436 return Object(external_this_wp_richText_["create"])({ 7437 html: content 7438 }); 7439 }), "\u2028"), 7440 multilineTag: 'p' 7441 }), 7442 anchor: attributes.anchor 7443 }); 7444 } 7445 }, { 7446 type: 'block', 7447 blocks: ['core/heading'], 7448 transform: function transform(_ref2) { 7449 var content = _ref2.content, 7450 anchor = _ref2.anchor; 7451 return Object(external_this_wp_blocks_["createBlock"])('core/quote', { 7452 value: "<p>".concat(content, "</p>"), 7453 anchor: anchor 7454 }); 7455 } 7456 }, { 7457 type: 'block', 7458 blocks: ['core/pullquote'], 7459 transform: function transform(_ref3) { 7460 var value = _ref3.value, 7461 citation = _ref3.citation, 7462 anchor = _ref3.anchor; 7463 return Object(external_this_wp_blocks_["createBlock"])('core/quote', { 7464 value: value, 7465 citation: citation, 7466 anchor: anchor 7467 }); 7468 } 7469 }, { 7470 type: 'prefix', 7471 prefix: '>', 7472 transform: function transform(content) { 7473 return Object(external_this_wp_blocks_["createBlock"])('core/quote', { 7474 value: "<p>".concat(content, "</p>") 7475 }); 7476 } 7477 }, { 7478 type: 'raw', 7479 isMatch: function isMatch(node) { 7480 var isParagraphOrSingleCite = function () { 7481 var hasCitation = false; 7482 return function (child) { 7483 // Child is a paragraph. 7484 if (child.nodeName === 'P') { 7485 return true; 7486 } // Child is a cite and no other cite child exists before it. 7487 7488 7489 if (!hasCitation && child.nodeName === 'CITE') { 7490 hasCitation = true; 7491 return true; 7492 } 7493 }; 7494 }(); 7495 7496 return node.nodeName === 'BLOCKQUOTE' && // The quote block can only handle multiline paragraph 7497 // content with an optional cite child. 7498 Array.from(node.childNodes).every(isParagraphOrSingleCite); 7499 }, 7500 schema: function schema(_ref4) { 7501 var phrasingContentSchema = _ref4.phrasingContentSchema; 7502 return { 7503 blockquote: { 7504 children: { 7505 p: { 7506 children: phrasingContentSchema 7507 }, 7508 cite: { 7509 children: phrasingContentSchema 7510 } 7511 } 7512 } 7513 }; 7514 } 7515 }], 7516 to: [{ 7517 type: 'block', 7518 blocks: ['core/paragraph'], 7519 transform: function transform(_ref5) { 7520 var value = _ref5.value, 7521 citation = _ref5.citation; 7522 var paragraphs = []; 7523 7524 if (value && value !== '<p></p>') { 7525 paragraphs.push.apply(paragraphs, Object(toConsumableArray["a" /* default */])(Object(external_this_wp_richText_["split"])(Object(external_this_wp_richText_["create"])({ 7526 html: value, 7527 multilineTag: 'p' 7528 }), "\u2028").map(function (piece) { 7529 return Object(external_this_wp_blocks_["createBlock"])('core/paragraph', { 7530 content: Object(external_this_wp_richText_["toHTMLString"])({ 7531 value: piece 7532 }) 7533 }); 7534 }))); 7535 } 7536 7537 if (citation && citation !== '<p></p>') { 7538 paragraphs.push(Object(external_this_wp_blocks_["createBlock"])('core/paragraph', { 7539 content: citation 7540 })); 7541 } 7542 7543 if (paragraphs.length === 0) { 7544 return Object(external_this_wp_blocks_["createBlock"])('core/paragraph', { 7545 content: '' 7546 }); 7547 } 7548 7549 return paragraphs; 7550 } 7551 }, { 7552 type: 'block', 7553 blocks: ['core/heading'], 7554 transform: function transform(_ref6) { 7555 var value = _ref6.value, 7556 citation = _ref6.citation, 7557 attrs = Object(objectWithoutProperties["a" /* default */])(_ref6, ["value", "citation"]); 7558 7559 // If there is no quote content, use the citation as the 7560 // content of the resulting heading. A nonexistent citation 7561 // will result in an empty heading. 7562 if (value === '<p></p>') { 7563 return Object(external_this_wp_blocks_["createBlock"])('core/heading', { 7564 content: citation 7565 }); 7566 } 7567 7568 var pieces = Object(external_this_wp_richText_["split"])(Object(external_this_wp_richText_["create"])({ 7569 html: value, 7570 multilineTag: 'p' 7571 }), "\u2028"); 7572 var headingBlock = Object(external_this_wp_blocks_["createBlock"])('core/heading', { 7573 content: Object(external_this_wp_richText_["toHTMLString"])({ 7574 value: pieces[0] 7575 }) 7576 }); 7577 7578 if (!citation && pieces.length === 1) { 7579 return headingBlock; 7580 } 7581 7582 var quotePieces = pieces.slice(1); 7583 var quoteBlock = Object(external_this_wp_blocks_["createBlock"])('core/quote', quote_transforms_objectSpread(quote_transforms_objectSpread({}, attrs), {}, { 7584 citation: citation, 7585 value: Object(external_this_wp_richText_["toHTMLString"])({ 7586 value: quotePieces.length ? Object(external_this_wp_richText_["join"])(pieces.slice(1), "\u2028") : Object(external_this_wp_richText_["create"])(), 7587 multilineTag: 'p' 7588 }) 7589 })); 7590 return [headingBlock, quoteBlock]; 7591 } 7592 }, { 7593 type: 'block', 7594 blocks: ['core/pullquote'], 7595 transform: function transform(_ref7) { 7596 var value = _ref7.value, 7597 citation = _ref7.citation, 7598 anchor = _ref7.anchor; 7599 return Object(external_this_wp_blocks_["createBlock"])('core/pullquote', { 7600 value: value, 7601 citation: citation, 7602 anchor: anchor 7603 }); 7604 } 7605 }] 7606 }; 7607 /* harmony default export */ var quote_transforms = (quote_transforms_transforms); 7608 7609 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/index.js 7610 7611 7612 function quote_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } 7613 7614 function quote_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { quote_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { quote_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 7615 7616 /** 7617 * WordPress dependencies 7618 */ 7619 7620 7621 /** 7622 * Internal dependencies 7623 */ 7624 7625 7626 7627 var quote_metadata = { 7628 apiVersion: 2, 7629 name: "core/quote", 7630 category: "text", 7631 attributes: { 7632 value: { 7633 type: "string", 7634 source: "html", 7635 selector: "blockquote", 7636 multiline: "p", 7637 "default": "" 7638 }, 7639 citation: { 7640 type: "string", 7641 source: "html", 7642 selector: "cite", 7643 "default": "" 7644 }, 7645 align: { 7646 type: "string" 7647 } 7648 }, 7649 supports: { 7650 anchor: true 7651 } 7652 }; 7653 7654 7655 var quote_name = quote_metadata.name; 7656 7657 var quote_settings = { 7658 title: Object(external_this_wp_i18n_["__"])('Quote'), 7659 description: Object(external_this_wp_i18n_["__"])('Give quoted text visual emphasis. "In quoting others, we cite ourselves." — Julio Cortázar'), 7660 icon: library_quote, 7661 keywords: [Object(external_this_wp_i18n_["__"])('blockquote'), Object(external_this_wp_i18n_["__"])('cite')], 7662 example: { 7663 attributes: { 7664 value: '<p>' + Object(external_this_wp_i18n_["__"])('In quoting others, we cite ourselves.') + '</p>', 7665 citation: 'Julio Cortázar', 7666 className: 'is-style-large' 7667 } 7668 }, 7669 styles: [{ 7670 name: 'default', 7671 label: Object(external_this_wp_i18n_["_x"])('Default', 'block style'), 7672 isDefault: true 7673 }, { 7674 name: 'large', 7675 label: Object(external_this_wp_i18n_["_x"])('Large', 'block style') 7676 }], 7677 transforms: quote_transforms, 7678 edit: QuoteEdit, 7679 save: quote_save_save, 7680 merge: function merge(attributes, _ref) { 7681 var value = _ref.value, 7682 citation = _ref.citation; 7683 7684 // Quote citations cannot be merged. Pick the second one unless it's 7685 // empty. 7686 if (!citation) { 7687 citation = attributes.citation; 7688 } 7689 7690 if (!value || value === '<p></p>') { 7691 return quote_objectSpread(quote_objectSpread({}, attributes), {}, { 7692 citation: citation 7693 }); 7694 } 7695 7696 return quote_objectSpread(quote_objectSpread({}, attributes), {}, { 7697 value: attributes.value + value, 7698 citation: citation 7699 }); 7700 }, 7701 deprecated: quote_deprecated 7702 }; 7703 7704 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/gallery.js 7705 7706 7707 /** 7708 * WordPress dependencies 7709 */ 7710 7711 var gallery = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], { 7712 viewBox: "0 0 24 24", 7713 xmlns: "http://www.w3.org/2000/svg" 7714 }, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], { 7715 d: "M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8h-1.5zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zM4.5 4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1V12l-2.3-1.7c-.3-.2-.6-.2-.9 0l-2.9 2.1L8 11.3c-.2-.1-.5-.1-.7 0l-2.9 1.5V4.6zm0 11.8v-1.8l3.2-1.7 2.4 1.2c.2.1.5.1.8-.1l2.8-2 2.8 2v2.5c0 .1-.1.1-.1.1H4.6c0-.1-.1-.2-.1-.2z" 7716 })); 7717 /* harmony default export */ var library_gallery = (gallery); 7718 7719 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/shared.js 7720 /** 7721 * External dependencies 7722 */ 7723 7724 function defaultColumnsNumber(attributes) { 7725 return Math.min(3, attributes.images.length); 7726 } 7727 var shared_pickRelevantMediaFiles = function pickRelevantMediaFiles(image) { 7728 var sizeSlug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'large'; 7729 var imageProps = Object(external_this_lodash_["pick"])(image, ['alt', 'id', 'link', 'caption']); 7730 imageProps.url = Object(external_this_lodash_["get"])(image, ['sizes', sizeSlug, 'url']) || Object(external_this_lodash_["get"])(image, ['media_details', 'sizes', sizeSlug, 'source_url']) || image.url; 7731 var fullUrl = Object(external_this_lodash_["get"])(image, ['sizes', 'full', 'url']) || Object(external_this_lodash_["get"])(image, ['media_details', 'sizes', 'full', 'source_url']); 7732 7733 if (fullUrl) { 7734 imageProps.fullUrl = fullUrl; 7735 } 7736 7737 return imageProps; 7738 }; 7739 7740 // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/deprecated.js 7741 7742 7743 7744 function gallery_deprecated_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } 7745 7746 function gallery_deprecated_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { gallery_deprecated_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { gallery_deprecated_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 7747 7748 /** 7749 * External dependencies 7750 */ 7751 7752 7753 /** 7754 * WordPress dependencies 7755 */ 7756 7757 7758 /** 7759 * Internal dependencies 7760 */ 7761 7762 7763 var gallery_deprecated_deprecated = [{ 7764 attributes: { 7765 images: { 7766 type: 'array', 7767 default: [], 7768 source: 'query', 7769 selector: '.blocks-gallery-item', 7770 query: { 7771 url: { 7772 type: 'string', 7773 source: 'attribute', 7774 selector: 'img', 7775 attribute: 'src' 7776 }, 7777 fullUrl: { 7778 type: 'string', 7779 source: 'attribute', 7780 selector: 'img', 7781 attribute: 'data-full-url' 7782 }, 7783 link: { 7784 type: 'string', 7785 source: 'attribute', 7786 selector: 'img', 7787 attribute: 'data-link' 7788 }, 7789 alt: { 7790 type: 'string', 7791 source: 'attribute', 7792 selector: 'img', 7793 attribute: 'alt', 7794 default: '' 7795 }, 7796 id: { 7797 type: 'string', 7798 source: 'attribute', 7799 selector: 'img', 7800 attribute: 'data-id' 7801 }, 7802 caption: { 7803 type: 'string', 7804 source: 'html', 7805 selector: '.blocks-gallery-item__caption' 7806 } 7807 } 7808 }, 7809 ids: { 7810 type: 'array', 7811 items: { 7812 type: 'number' 7813 }, 7814 default: [] 7815 }, 7816 columns: { 7817 type: 'number', 7818 minimum: 1, 7819 maximum: 8 7820 }, 7821 caption: { 7822 type: 'string', 7823 source: 'html', 7824 selector: '.blocks-gallery-caption' 7825 }, 7826 imageCrop: { 7827 type: 'boolean', 7828 default: true 7829 }, 7830 linkTo: { 7831 type: 'string', 7832 default: 'none' 7833 }, 7834 sizeSlug: { 7835 type: 'string', 7836 default: 'large' 7837 } 7838 }, 7839 supports: { 7840 align: true 7841 }, 7842 isEligible: function isEligible(_ref) { 7843 var linkTo = _ref.linkTo; 7844 return !linkTo || linkTo === 'attachment' || linkTo === 'media'; 7845 }, 7846 migrate: function migrate(attributes) { 7847 var linkTo = attributes.linkTo; 7848 7849 if (!attributes.linkTo) { 7850 linkTo = 'none'; 7851 } else if (attributes.linkTo === 'attachment') { 7852 linkTo = 'post'; 7853 } else if (attributes.linkTo === 'media') { 7854 linkTo = 'file'; 7855 } 7856 7857 return gallery_deprecated_objectSpread(gallery_deprecated_objectSpread({}, attributes), {}, { 7858 linkTo: linkTo 7859 }); 7860 }, 7861 save: function save(_ref2) { 7862 var attributes = _ref2.attributes; 7863 var images = attributes.images, 7864 _attributes$columns = attributes.columns, 7865 columns = _attributes$columns === void 0 ? defaultColumnsNumber(attributes) : _attributes$columns, 7866 imageCrop = attributes.imageCrop, 7867 caption = attributes.caption, 7868 linkTo = attributes.linkTo; 7869 return Object(external_this_wp_element_["createElement"])("figure", { 7870 className: "columns-".concat(columns, " ").concat(imageCrop ? 'is-cropped' : '') 7871 }, Object(external_this_wp_element_["createElement"])("ul", { 7872 className: "blocks-gallery-grid" 7873 }, images.map(function (image) { 7874 var href; 7875 7876 switch (linkTo) { 7877 case 'media': 7878 href = image.fullUrl || image.url; 7879 break; 7880 7881 case 'attachment': 7882 href = image.link; 7883 break; 7884 } 7885 7886 var img = Object(external_this_wp_element_["createElement"])("img", { 7887 src: image.url, 7888 alt: image.alt, 7889 "data-id": image.id, 7890 "data-full-url": image.fullUrl, 7891 "data-link": image.link, 7892 className: image.id ? "wp-image-".concat(image.id) : null 7893 }); 7894 return Object(external_this_wp_element_["createElement"])("li", { 7895 key: image.id || image.url, 7896 className: "blocks-gallery-item" 7897 }, Object(external_this_wp_element_["createElement"])("figure", null, href ? Object(external_this_wp_element_["createElement"])("a", { 7898 href: href 7899 }, img) : img, !external_this_wp_blockEditor_["RichText"].isEmpty(image.caption) && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 7900 tagName: "figcaption", 7901 className: "blocks-gallery-item__caption", 7902 value: image.caption 7903 }))); 7904 })), !external_this_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 7905 tagName: "figcaption", 7906 className: "blocks-gallery-caption", 7907 value: caption 7908 })); 7909 } 7910 }, { 7911 attributes: { 7912 images: { 7913 type: 'array', 7914 default: [], 7915 source: 'query', 7916 selector: '.blocks-gallery-item', 7917 query: { 7918 url: { 7919 source: 'attribute', 7920 selector: 'img', 7921 attribute: 'src' 7922 }, 7923 fullUrl: { 7924 source: 'attribute', 7925 selector: 'img', 7926 attribute: 'data-full-url' 7927 }, 7928 link: { 7929 source: 'attribute', 7930 selector: 'img', 7931 attribute: 'data-link' 7932 }, 7933 alt: { 7934 source: 'attribute', 7935 selector: 'img', 7936 attribute: 'alt', 7937 default: '' 7938 }, 7939 id: { 7940 source: 'attribute', 7941 selector: 'img', 7942 attribute: 'data-id' 7943 }, 7944 caption: { 7945 type: 'string', 7946 source: 'html', 7947 selector: '.blocks-gallery-item__caption' 7948 } 7949 } 7950 }, 7951 ids: { 7952 type: 'array', 7953 default: [] 7954 }, 7955 columns: { 7956 type: 'number' 7957 }, 7958 caption: { 7959 type: 'string', 7960 source: 'html', 7961 selector: '.blocks-gallery-caption' 7962 }, 7963 imageCrop: { 7964 type: 'boolean', 7965 default: true 7966 }, 7967 linkTo: { 7968 type: 'string', 7969 default: 'none' 7970 } 7971 }, 7972 supports: { 7973 align: true 7974 }, 7975 isEligible: function isEligible(_ref3) { 7976 var ids = _ref3.ids; 7977 return ids && ids.some(function (id) { 7978 return typeof id === 'string'; 7979 }); 7980 }, 7981 migrate: function migrate(attributes) { 7982 return gallery_deprecated_objectSpread(gallery_deprecated_objectSpread({}, attributes), {}, { 7983 ids: Object(external_this_lodash_["map"])(attributes.ids, function (id) { 7984 var parsedId = parseInt(id, 10); 7985 return Number.isInteger(parsedId) ? parsedId : null; 7986 }) 7987 }); 7988 }, 7989 save: function save(_ref4) { 7990 var attributes = _ref4.attributes; 7991 var images = attributes.images, 7992 _attributes$columns2 = attributes.columns, 7993 columns = _attributes$columns2 === void 0 ? defaultColumnsNumber(attributes) : _attributes$columns2, 7994 imageCrop = attributes.imageCrop, 7995 caption = attributes.caption, 7996 linkTo = attributes.linkTo; 7997 return Object(external_this_wp_element_["createElement"])("figure", { 7998 className: "columns-".concat(columns, " ").concat(imageCrop ? 'is-cropped' : '') 7999 }, Object(external_this_wp_element_["createElement"])("ul", { 8000 className: "blocks-gallery-grid" 8001 }, images.map(function (image) { 8002 var href; 8003 8004 switch (linkTo) { 8005 case 'media': 8006 href = image.fullUrl || image.url; 8007 break; 8008 8009 case 'attachment': 8010 href = image.link; 8011 break; 8012 } 8013 8014 var img = Object(external_this_wp_element_["createElement"])("img", { 8015 src: image.url, 8016 alt: image.alt, 8017 "data-id": image.id, 8018 "data-full-url": image.fullUrl, 8019 "data-link": image.link, 8020 className: image.id ? "wp-image-".concat(image.id) : null 8021 }); 8022 return Object(external_this_wp_element_["createElement"])("li", { 8023 key: image.id || image.url, 8024 className: "blocks-gallery-item" 8025 }, Object(external_this_wp_element_["createElement"])("figure", null, href ? Object(external_this_wp_element_["createElement"])("a", { 8026 href: href 8027 }, img) : img, !external_this_wp_blockEditor_["RichText"].isEmpty(image.caption) && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 8028 tagName: "figcaption", 8029 className: "blocks-gallery-item__caption", 8030 value: image.caption 8031 }))); 8032 })), !external_this_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, { 8033 tagName: "figcaption", 8034 className: "blocks-gallery-caption", 8035 value: caption 8036 })); 8037 } 8038 }, { 8039 attributes: { 8040 images: { 8041 type: 'array', 8042 default: [], 8043 source: 'query', 8044 selector: 'ul.wp-block-gallery .blocks-gallery-item', 8045 query: { 8046 url: { 8047 source: 'attribute', 8048 selector: 'img', 8049 attribute: 'src' 8050 }, 8051 fullUrl: { 8052 source: 'attribute', 8053 selector: 'img', 8054 attribute: 'data-full-url' 8055 }, 8056 alt: { 8057 source: 'attribute', 8058 selector: 'img', 8059 attribute: 'alt', 8060 default: '' 8061 }, 8062 id: { 8063 source: 'attribute', 8064 selector: 'img', 8065 attribute: 'data-id' 8066 }, 8067 link: { 8068 source: 'attribute', 8069 selector: 'img', 8070 attribute: 'data-link' 8071 }, 8072 caption: { 8073 type: 'array', 8074 source: 'children', 8075 selector: 'figcaption' 8076 } 8077 } 8078 }, 8079 ids: { 8080 type: 'array', 8081 default: [] 8082 }, 8083 columns: { 8084 type: 'number' 8085 }, 8086 imageCrop: { 8087 type: 'boolean', 8088 default: true 8089 }, 8090 linkTo: { 8091 type: 'string', 8092 default: 'none' 8093 } 8094 }, 8095 supports: { 8096 align: true 8097 }, 8098 save: function save(_ref5) { 8099 var attributes = _ref5.attributes; 8100 var images = attributes.images, 8101 _attributes$columns3 = attributes.columns, 8102 columns = _attributes$columns3 === void 0 ? defaultColumnsNumber(attributes) : _attributes$columns3, 8103 imageCrop = attributes.imageCrop, 8104 linkTo = attributes.linkTo; 8105 return Object(external_this_wp_element_["createElement"])("ul", { 8106 className: "columns-".concat(columns, " ").concat(imageCrop ? 'is-cropped' : '') 8107 }, images.map(function (image) { 8108 var href; 8109 8110 switch (linkTo) { 8111 case 'media': 8112 href = image.fullUrl || image.url; 8113 break; 8114 8115 case 'attachment': 8116 href = image.link; 8117 break; 8118 } 8119 8120 var img = Object(external_this_wp_element_["createElement"])("img", { 8121 src: image.url, 8122 alt: image.alt, 8123 "data-id": image.id, 8124 "data-full-url": image.fullUrl, 8125 "data-link": image.link, 8126 className: image.id ? "wp-image-".concat(image.id) : null 8127 }); 8128 return Object(external_this_wp_element_["createElement"])("li", { 8129 key: image.id || image.url, 8130<