edit-post.js (680459B)
1 this["wp"] = this["wp"] || {}; this["wp"]["editPost"] = 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 = "dSQ2"); 86 /******/ }) 87 /************************************************************************/ 88 /******/ ({ 89 90 /***/ "0dt7": 91 /***/ (function(module, __webpack_exports__, __webpack_require__) { 92 93 "use strict"; 94 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return STORE_NAME; }); 95 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return VIEW_AS_LINK_SELECTOR; }); 96 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return VIEW_AS_PREVIEW_LINK_SELECTOR; }); 97 /** 98 * The identifier for the data store. 99 * 100 * @type {string} 101 */ 102 const STORE_NAME = 'core/edit-post'; 103 /** 104 * CSS selector string for the admin bar view post link anchor tag. 105 * 106 * @type {string} 107 */ 108 109 const VIEW_AS_LINK_SELECTOR = '#wp-admin-bar-view a'; 110 /** 111 * CSS selector string for the admin bar preview post link anchor tag. 112 * 113 * @type {string} 114 */ 115 116 const VIEW_AS_PREVIEW_LINK_SELECTOR = '#wp-admin-bar-preview a'; 117 118 119 /***/ }), 120 121 /***/ "1ZqX": 122 /***/ (function(module, exports) { 123 124 (function() { module.exports = window["wp"]["data"]; }()); 125 126 /***/ }), 127 128 /***/ "4qRI": 129 /***/ (function(module, __webpack_exports__, __webpack_require__) { 130 131 "use strict"; 132 function memoize(fn) { 133 var cache = {}; 134 return function (arg) { 135 if (cache[arg] === undefined) cache[arg] = fn(arg); 136 return cache[arg]; 137 }; 138 } 139 140 /* harmony default export */ __webpack_exports__["a"] = (memoize); 141 142 143 /***/ }), 144 145 /***/ "51Zz": 146 /***/ (function(module, exports) { 147 148 (function() { module.exports = window["wp"]["dataControls"]; }()); 149 150 /***/ }), 151 152 /***/ "6aBm": 153 /***/ (function(module, exports) { 154 155 (function() { module.exports = window["wp"]["mediaUtils"]; }()); 156 157 /***/ }), 158 159 /***/ "8oxB": 160 /***/ (function(module, exports) { 161 162 // shim for using process in browser 163 var process = module.exports = {}; 164 165 // cached from whatever global is present so that test runners that stub it 166 // don't break things. But we need to wrap it in a try catch in case it is 167 // wrapped in strict mode code which doesn't define any globals. It's inside a 168 // function because try/catches deoptimize in certain engines. 169 170 var cachedSetTimeout; 171 var cachedClearTimeout; 172 173 function defaultSetTimout() { 174 throw new Error('setTimeout has not been defined'); 175 } 176 function defaultClearTimeout () { 177 throw new Error('clearTimeout has not been defined'); 178 } 179 (function () { 180 try { 181 if (typeof setTimeout === 'function') { 182 cachedSetTimeout = setTimeout; 183 } else { 184 cachedSetTimeout = defaultSetTimout; 185 } 186 } catch (e) { 187 cachedSetTimeout = defaultSetTimout; 188 } 189 try { 190 if (typeof clearTimeout === 'function') { 191 cachedClearTimeout = clearTimeout; 192 } else { 193 cachedClearTimeout = defaultClearTimeout; 194 } 195 } catch (e) { 196 cachedClearTimeout = defaultClearTimeout; 197 } 198 } ()) 199 function runTimeout(fun) { 200 if (cachedSetTimeout === setTimeout) { 201 //normal enviroments in sane situations 202 return setTimeout(fun, 0); 203 } 204 // if setTimeout wasn't available but was latter defined 205 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { 206 cachedSetTimeout = setTimeout; 207 return setTimeout(fun, 0); 208 } 209 try { 210 // when when somebody has screwed with setTimeout but no I.E. maddness 211 return cachedSetTimeout(fun, 0); 212 } catch(e){ 213 try { 214 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 215 return cachedSetTimeout.call(null, fun, 0); 216 } catch(e){ 217 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error 218 return cachedSetTimeout.call(this, fun, 0); 219 } 220 } 221 222 223 } 224 function runClearTimeout(marker) { 225 if (cachedClearTimeout === clearTimeout) { 226 //normal enviroments in sane situations 227 return clearTimeout(marker); 228 } 229 // if clearTimeout wasn't available but was latter defined 230 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { 231 cachedClearTimeout = clearTimeout; 232 return clearTimeout(marker); 233 } 234 try { 235 // when when somebody has screwed with setTimeout but no I.E. maddness 236 return cachedClearTimeout(marker); 237 } catch (e){ 238 try { 239 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 240 return cachedClearTimeout.call(null, marker); 241 } catch (e){ 242 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. 243 // Some versions of I.E. have different rules for clearTimeout vs setTimeout 244 return cachedClearTimeout.call(this, marker); 245 } 246 } 247 248 249 250 } 251 var queue = []; 252 var draining = false; 253 var currentQueue; 254 var queueIndex = -1; 255 256 function cleanUpNextTick() { 257 if (!draining || !currentQueue) { 258 return; 259 } 260 draining = false; 261 if (currentQueue.length) { 262 queue = currentQueue.concat(queue); 263 } else { 264 queueIndex = -1; 265 } 266 if (queue.length) { 267 drainQueue(); 268 } 269 } 270 271 function drainQueue() { 272 if (draining) { 273 return; 274 } 275 var timeout = runTimeout(cleanUpNextTick); 276 draining = true; 277 278 var len = queue.length; 279 while(len) { 280 currentQueue = queue; 281 queue = []; 282 while (++queueIndex < len) { 283 if (currentQueue) { 284 currentQueue[queueIndex].run(); 285 } 286 } 287 queueIndex = -1; 288 len = queue.length; 289 } 290 currentQueue = null; 291 draining = false; 292 runClearTimeout(timeout); 293 } 294 295 process.nextTick = function (fun) { 296 var args = new Array(arguments.length - 1); 297 if (arguments.length > 1) { 298 for (var i = 1; i < arguments.length; i++) { 299 args[i - 1] = arguments[i]; 300 } 301 } 302 queue.push(new Item(fun, args)); 303 if (queue.length === 1 && !draining) { 304 runTimeout(drainQueue); 305 } 306 }; 307 308 // v8 likes predictible objects 309 function Item(fun, array) { 310 this.fun = fun; 311 this.array = array; 312 } 313 Item.prototype.run = function () { 314 this.fun.apply(null, this.array); 315 }; 316 process.title = 'browser'; 317 process.browser = true; 318 process.env = {}; 319 process.argv = []; 320 process.version = ''; // empty string to avoid regexp issues 321 process.versions = {}; 322 323 function noop() {} 324 325 process.on = noop; 326 process.addListener = noop; 327 process.once = noop; 328 process.off = noop; 329 process.removeListener = noop; 330 process.removeAllListeners = noop; 331 process.emit = noop; 332 process.prependListener = noop; 333 process.prependOnceListener = noop; 334 335 process.listeners = function (name) { return [] } 336 337 process.binding = function (name) { 338 throw new Error('process.binding is not supported'); 339 }; 340 341 process.cwd = function () { return '/' }; 342 process.chdir = function (dir) { 343 throw new Error('process.chdir is not supported'); 344 }; 345 process.umask = function() { return 0; }; 346 347 348 /***/ }), 349 350 /***/ "9uj6": 351 /***/ (function(module, __webpack_exports__, __webpack_require__) { 352 353 "use strict"; 354 __webpack_require__.r(__webpack_exports__); 355 /* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("4qRI"); 356 357 358 var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23 359 360 var index = Object(_emotion_memoize__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(function (prop) { 361 return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 362 /* o */ 363 && prop.charCodeAt(1) === 110 364 /* n */ 365 && prop.charCodeAt(2) < 91; 366 } 367 /* Z+1 */ 368 ); 369 370 /* harmony default export */ __webpack_exports__["default"] = (index); 371 372 373 /***/ }), 374 375 /***/ "Cg8A": 376 /***/ (function(module, __webpack_exports__, __webpack_require__) { 377 378 "use strict"; 379 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 380 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 381 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 382 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 383 384 385 /** 386 * WordPress dependencies 387 */ 388 389 const cog = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 390 xmlns: "http://www.w3.org/2000/svg", 391 viewBox: "0 0 24 24" 392 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 393 fillRule: "evenodd", 394 d: "M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z", 395 clipRule: "evenodd" 396 })); 397 /* harmony default export */ __webpack_exports__["a"] = (cog); 398 399 400 /***/ }), 401 402 /***/ "Civd": 403 /***/ (function(module, __webpack_exports__, __webpack_require__) { 404 405 "use strict"; 406 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 407 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 408 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 409 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 410 411 412 /** 413 * WordPress dependencies 414 */ 415 416 const layout = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 417 xmlns: "http://www.w3.org/2000/svg", 418 viewBox: "0 0 24 24" 419 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 420 d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" 421 })); 422 /* harmony default export */ __webpack_exports__["a"] = (layout); 423 424 425 /***/ }), 426 427 /***/ "GRId": 428 /***/ (function(module, exports) { 429 430 (function() { module.exports = window["wp"]["element"]; }()); 431 432 /***/ }), 433 434 /***/ "HSyU": 435 /***/ (function(module, exports) { 436 437 (function() { module.exports = window["wp"]["blocks"]; }()); 438 439 /***/ }), 440 441 /***/ "K+tz": 442 /***/ (function(module, __webpack_exports__, __webpack_require__) { 443 444 "use strict"; 445 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 446 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 447 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 448 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 449 450 451 /** 452 * WordPress dependencies 453 */ 454 455 const external = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 456 xmlns: "http://www.w3.org/2000/svg", 457 viewBox: "0 0 24 24" 458 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 459 d: "M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z" 460 })); 461 /* harmony default export */ __webpack_exports__["a"] = (external); 462 463 464 /***/ }), 465 466 /***/ "K9lf": 467 /***/ (function(module, exports) { 468 469 (function() { module.exports = window["wp"]["compose"]; }()); 470 471 /***/ }), 472 473 /***/ "KEfo": 474 /***/ (function(module, exports) { 475 476 (function() { module.exports = window["wp"]["viewport"]; }()); 477 478 /***/ }), 479 480 /***/ "Mmq9": 481 /***/ (function(module, exports) { 482 483 (function() { module.exports = window["wp"]["url"]; }()); 484 485 /***/ }), 486 487 /***/ "NWDH": 488 /***/ (function(module, __webpack_exports__, __webpack_require__) { 489 490 "use strict"; 491 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 492 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 493 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 494 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 495 496 497 /** 498 * WordPress dependencies 499 */ 500 501 const chevronDown = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 502 viewBox: "0 0 24 24", 503 xmlns: "http://www.w3.org/2000/svg" 504 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 505 d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" 506 })); 507 /* harmony default export */ __webpack_exports__["a"] = (chevronDown); 508 509 510 /***/ }), 511 512 /***/ "OzlF": 513 /***/ (function(module, __webpack_exports__, __webpack_require__) { 514 515 "use strict"; 516 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 517 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 518 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 519 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 520 521 522 /** 523 * WordPress dependencies 524 */ 525 526 const listView = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 527 viewBox: "0 0 24 24", 528 xmlns: "http://www.w3.org/2000/svg" 529 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 530 d: "M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z" 531 })); 532 /* harmony default export */ __webpack_exports__["a"] = (listView); 533 534 535 /***/ }), 536 537 /***/ "Q4Sy": 538 /***/ (function(module, __webpack_exports__, __webpack_require__) { 539 540 "use strict"; 541 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 542 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 543 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 544 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 545 546 547 /** 548 * WordPress dependencies 549 */ 550 551 const plus = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 552 xmlns: "http://www.w3.org/2000/svg", 553 viewBox: "0 0 24 24" 554 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 555 d: "M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z" 556 })); 557 /* harmony default export */ __webpack_exports__["a"] = (plus); 558 559 560 /***/ }), 561 562 /***/ "QyPg": 563 /***/ (function(module, exports) { 564 565 (function() { module.exports = window["wp"]["blockLibrary"]; }()); 566 567 /***/ }), 568 569 /***/ "RMJe": 570 /***/ (function(module, __webpack_exports__, __webpack_require__) { 571 572 "use strict"; 573 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 574 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 575 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 576 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 577 578 579 /** 580 * WordPress dependencies 581 */ 582 583 const check = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 584 xmlns: "http://www.w3.org/2000/svg", 585 viewBox: "0 0 24 24" 586 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 587 d: "M18.3 5.6L9.9 16.9l-4.6-3.4-.9 1.2 5.8 4.3 9.3-12.6z" 588 })); 589 /* harmony default export */ __webpack_exports__["a"] = (check); 590 591 592 /***/ }), 593 594 /***/ "RxS6": 595 /***/ (function(module, exports) { 596 597 (function() { module.exports = window["wp"]["keycodes"]; }()); 598 599 /***/ }), 600 601 /***/ "T40v": 602 /***/ (function(module, __webpack_exports__, __webpack_require__) { 603 604 "use strict"; 605 606 // EXPORTS 607 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ store; }); 608 609 // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-post/build-module/store/actions.js 610 var actions_namespaceObject = {}; 611 __webpack_require__.r(actions_namespaceObject); 612 __webpack_require__.d(actions_namespaceObject, "openGeneralSidebar", function() { return openGeneralSidebar; }); 613 __webpack_require__.d(actions_namespaceObject, "closeGeneralSidebar", function() { return closeGeneralSidebar; }); 614 __webpack_require__.d(actions_namespaceObject, "openModal", function() { return openModal; }); 615 __webpack_require__.d(actions_namespaceObject, "closeModal", function() { return closeModal; }); 616 __webpack_require__.d(actions_namespaceObject, "openPublishSidebar", function() { return openPublishSidebar; }); 617 __webpack_require__.d(actions_namespaceObject, "closePublishSidebar", function() { return closePublishSidebar; }); 618 __webpack_require__.d(actions_namespaceObject, "togglePublishSidebar", function() { return togglePublishSidebar; }); 619 __webpack_require__.d(actions_namespaceObject, "toggleEditorPanelEnabled", function() { return toggleEditorPanelEnabled; }); 620 __webpack_require__.d(actions_namespaceObject, "toggleEditorPanelOpened", function() { return toggleEditorPanelOpened; }); 621 __webpack_require__.d(actions_namespaceObject, "removeEditorPanel", function() { return removeEditorPanel; }); 622 __webpack_require__.d(actions_namespaceObject, "toggleFeature", function() { return toggleFeature; }); 623 __webpack_require__.d(actions_namespaceObject, "switchEditorMode", function() { return switchEditorMode; }); 624 __webpack_require__.d(actions_namespaceObject, "togglePinnedPluginItem", function() { return togglePinnedPluginItem; }); 625 __webpack_require__.d(actions_namespaceObject, "hideBlockTypes", function() { return hideBlockTypes; }); 626 __webpack_require__.d(actions_namespaceObject, "updatePreferredStyleVariations", function() { return updatePreferredStyleVariations; }); 627 __webpack_require__.d(actions_namespaceObject, "__experimentalUpdateLocalAutosaveInterval", function() { return __experimentalUpdateLocalAutosaveInterval; }); 628 __webpack_require__.d(actions_namespaceObject, "showBlockTypes", function() { return showBlockTypes; }); 629 __webpack_require__.d(actions_namespaceObject, "setAvailableMetaBoxesPerLocation", function() { return setAvailableMetaBoxesPerLocation; }); 630 __webpack_require__.d(actions_namespaceObject, "requestMetaBoxUpdates", function() { return requestMetaBoxUpdates; }); 631 __webpack_require__.d(actions_namespaceObject, "metaBoxUpdatesSuccess", function() { return metaBoxUpdatesSuccess; }); 632 __webpack_require__.d(actions_namespaceObject, "__experimentalSetPreviewDeviceType", function() { return __experimentalSetPreviewDeviceType; }); 633 __webpack_require__.d(actions_namespaceObject, "setIsInserterOpened", function() { return setIsInserterOpened; }); 634 __webpack_require__.d(actions_namespaceObject, "setIsListViewOpened", function() { return setIsListViewOpened; }); 635 __webpack_require__.d(actions_namespaceObject, "setIsEditingTemplate", function() { return setIsEditingTemplate; }); 636 __webpack_require__.d(actions_namespaceObject, "__unstableSwitchToTemplateMode", function() { return __unstableSwitchToTemplateMode; }); 637 __webpack_require__.d(actions_namespaceObject, "initializeMetaBoxes", function() { return initializeMetaBoxes; }); 638 639 // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-post/build-module/store/selectors.js 640 var selectors_namespaceObject = {}; 641 __webpack_require__.r(selectors_namespaceObject); 642 __webpack_require__.d(selectors_namespaceObject, "getEditorMode", function() { return getEditorMode; }); 643 __webpack_require__.d(selectors_namespaceObject, "isEditorSidebarOpened", function() { return isEditorSidebarOpened; }); 644 __webpack_require__.d(selectors_namespaceObject, "isPluginSidebarOpened", function() { return isPluginSidebarOpened; }); 645 __webpack_require__.d(selectors_namespaceObject, "getActiveGeneralSidebarName", function() { return getActiveGeneralSidebarName; }); 646 __webpack_require__.d(selectors_namespaceObject, "getPreferences", function() { return getPreferences; }); 647 __webpack_require__.d(selectors_namespaceObject, "getPreference", function() { return getPreference; }); 648 __webpack_require__.d(selectors_namespaceObject, "isPublishSidebarOpened", function() { return isPublishSidebarOpened; }); 649 __webpack_require__.d(selectors_namespaceObject, "isEditorPanelRemoved", function() { return isEditorPanelRemoved; }); 650 __webpack_require__.d(selectors_namespaceObject, "isEditorPanelEnabled", function() { return isEditorPanelEnabled; }); 651 __webpack_require__.d(selectors_namespaceObject, "isEditorPanelOpened", function() { return isEditorPanelOpened; }); 652 __webpack_require__.d(selectors_namespaceObject, "isModalActive", function() { return isModalActive; }); 653 __webpack_require__.d(selectors_namespaceObject, "isFeatureActive", function() { return isFeatureActive; }); 654 __webpack_require__.d(selectors_namespaceObject, "isPluginItemPinned", function() { return isPluginItemPinned; }); 655 __webpack_require__.d(selectors_namespaceObject, "getActiveMetaBoxLocations", function() { return getActiveMetaBoxLocations; }); 656 __webpack_require__.d(selectors_namespaceObject, "isMetaBoxLocationVisible", function() { return isMetaBoxLocationVisible; }); 657 __webpack_require__.d(selectors_namespaceObject, "isMetaBoxLocationActive", function() { return isMetaBoxLocationActive; }); 658 __webpack_require__.d(selectors_namespaceObject, "getMetaBoxesPerLocation", function() { return getMetaBoxesPerLocation; }); 659 __webpack_require__.d(selectors_namespaceObject, "getAllMetaBoxes", function() { return getAllMetaBoxes; }); 660 __webpack_require__.d(selectors_namespaceObject, "hasMetaBoxes", function() { return selectors_hasMetaBoxes; }); 661 __webpack_require__.d(selectors_namespaceObject, "isSavingMetaBoxes", function() { return selectors_isSavingMetaBoxes; }); 662 __webpack_require__.d(selectors_namespaceObject, "__experimentalGetPreviewDeviceType", function() { return __experimentalGetPreviewDeviceType; }); 663 __webpack_require__.d(selectors_namespaceObject, "isInserterOpened", function() { return isInserterOpened; }); 664 __webpack_require__.d(selectors_namespaceObject, "__experimentalGetInsertionPoint", function() { return __experimentalGetInsertionPoint; }); 665 __webpack_require__.d(selectors_namespaceObject, "isListViewOpened", function() { return isListViewOpened; }); 666 __webpack_require__.d(selectors_namespaceObject, "isEditingTemplate", function() { return selectors_isEditingTemplate; }); 667 __webpack_require__.d(selectors_namespaceObject, "areMetaBoxesInitialized", function() { return areMetaBoxesInitialized; }); 668 __webpack_require__.d(selectors_namespaceObject, "getEditedPostTemplate", function() { return getEditedPostTemplate; }); 669 670 // EXTERNAL MODULE: external ["wp","data"] 671 var external_wp_data_ = __webpack_require__("1ZqX"); 672 673 // EXTERNAL MODULE: external ["wp","dataControls"] 674 var external_wp_dataControls_ = __webpack_require__("51Zz"); 675 676 // EXTERNAL MODULE: external "lodash" 677 var external_lodash_ = __webpack_require__("YLtl"); 678 679 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/defaults.js 680 const PREFERENCES_DEFAULTS = { 681 editorMode: 'visual', 682 panels: { 683 'post-status': { 684 opened: true 685 } 686 }, 687 features: { 688 fixedToolbar: false, 689 welcomeGuide: true, 690 fullscreenMode: true, 691 showIconLabels: false, 692 themeStyles: true, 693 showBlockBreadcrumbs: true, 694 welcomeGuideTemplate: true 695 }, 696 hiddenBlockTypes: [], 697 preferredStyleVariations: {}, 698 localAutosaveInterval: 15 699 }; 700 701 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/reducer.js 702 /** 703 * External dependencies 704 */ 705 706 /** 707 * WordPress dependencies 708 */ 709 710 711 /** 712 * Internal dependencies 713 */ 714 715 716 /** 717 * Higher-order reducer creator which provides the given initial state for the 718 * original reducer. 719 * 720 * @param {*} initialState Initial state to provide to reducer. 721 * 722 * @return {Function} Higher-order reducer. 723 */ 724 725 const createWithInitialState = initialState => reducer => { 726 return (state = initialState, action) => reducer(state, action); 727 }; 728 /** 729 * Reducer returning the user preferences. 730 * 731 * @param {Object} state Current state. 732 * @param {string} state.mode Current editor mode, either 733 * "visual" or "text". 734 * @param {boolean} state.isGeneralSidebarDismissed Whether general sidebar is 735 * dismissed. False by default 736 * or when closing general 737 * sidebar, true when opening 738 * sidebar. 739 * @param {boolean} state.isSidebarOpened Whether the sidebar is 740 * opened or closed. 741 * @param {Object} state.panels The state of the different 742 * sidebar panels. 743 * @param {Object} action Dispatched action. 744 * 745 * @return {Object} Updated state. 746 */ 747 748 749 const preferences = Object(external_lodash_["flow"])([external_wp_data_["combineReducers"], createWithInitialState(PREFERENCES_DEFAULTS)])({ 750 panels(state, action) { 751 switch (action.type) { 752 case 'TOGGLE_PANEL_ENABLED': 753 { 754 const { 755 panelName 756 } = action; 757 return { ...state, 758 [panelName]: { ...state[panelName], 759 enabled: !Object(external_lodash_["get"])(state, [panelName, 'enabled'], true) 760 } 761 }; 762 } 763 764 case 'TOGGLE_PANEL_OPENED': 765 { 766 const { 767 panelName 768 } = action; 769 const isOpen = state[panelName] === true || Object(external_lodash_["get"])(state, [panelName, 'opened'], false); 770 return { ...state, 771 [panelName]: { ...state[panelName], 772 opened: !isOpen 773 } 774 }; 775 } 776 } 777 778 return state; 779 }, 780 781 features(state, action) { 782 if (action.type === 'TOGGLE_FEATURE') { 783 return { ...state, 784 [action.feature]: !state[action.feature] 785 }; 786 } 787 788 return state; 789 }, 790 791 editorMode(state, action) { 792 if (action.type === 'SWITCH_MODE') { 793 return action.mode; 794 } 795 796 return state; 797 }, 798 799 hiddenBlockTypes(state, action) { 800 switch (action.type) { 801 case 'SHOW_BLOCK_TYPES': 802 return Object(external_lodash_["without"])(state, ...action.blockNames); 803 804 case 'HIDE_BLOCK_TYPES': 805 return Object(external_lodash_["union"])(state, action.blockNames); 806 } 807 808 return state; 809 }, 810 811 preferredStyleVariations(state, action) { 812 switch (action.type) { 813 case 'UPDATE_PREFERRED_STYLE_VARIATIONS': 814 { 815 if (!action.blockName) { 816 return state; 817 } 818 819 if (!action.blockStyle) { 820 return Object(external_lodash_["omit"])(state, [action.blockName]); 821 } 822 823 return { ...state, 824 [action.blockName]: action.blockStyle 825 }; 826 } 827 } 828 829 return state; 830 }, 831 832 localAutosaveInterval(state, action) { 833 switch (action.type) { 834 case 'UPDATE_LOCAL_AUTOSAVE_INTERVAL': 835 return action.interval; 836 } 837 838 return state; 839 } 840 841 }); 842 /** 843 * Reducer storing the list of all programmatically removed panels. 844 * 845 * @param {Array} state Current state. 846 * @param {Object} action Action object. 847 * 848 * @return {Array} Updated state. 849 */ 850 851 function removedPanels(state = [], action) { 852 switch (action.type) { 853 case 'REMOVE_PANEL': 854 if (!Object(external_lodash_["includes"])(state, action.panelName)) { 855 return [...state, action.panelName]; 856 } 857 858 } 859 860 return state; 861 } 862 /** 863 * Reducer for storing the name of the open modal, or null if no modal is open. 864 * 865 * @param {Object} state Previous state. 866 * @param {Object} action Action object containing the `name` of the modal 867 * 868 * @return {Object} Updated state 869 */ 870 871 function activeModal(state = null, action) { 872 switch (action.type) { 873 case 'OPEN_MODAL': 874 return action.name; 875 876 case 'CLOSE_MODAL': 877 return null; 878 } 879 880 return state; 881 } 882 function publishSidebarActive(state = false, action) { 883 switch (action.type) { 884 case 'OPEN_PUBLISH_SIDEBAR': 885 return true; 886 887 case 'CLOSE_PUBLISH_SIDEBAR': 888 return false; 889 890 case 'TOGGLE_PUBLISH_SIDEBAR': 891 return !state; 892 } 893 894 return state; 895 } 896 /** 897 * Reducer keeping track of the meta boxes isSaving state. 898 * A "true" value means the meta boxes saving request is in-flight. 899 * 900 * 901 * @param {boolean} state Previous state. 902 * @param {Object} action Action Object. 903 * 904 * @return {Object} Updated state. 905 */ 906 907 function isSavingMetaBoxes(state = false, action) { 908 switch (action.type) { 909 case 'REQUEST_META_BOX_UPDATES': 910 return true; 911 912 case 'META_BOX_UPDATES_SUCCESS': 913 return false; 914 915 default: 916 return state; 917 } 918 } 919 /** 920 * Reducer keeping track of the meta boxes per location. 921 * 922 * @param {boolean} state Previous state. 923 * @param {Object} action Action Object. 924 * 925 * @return {Object} Updated state. 926 */ 927 928 function metaBoxLocations(state = {}, action) { 929 switch (action.type) { 930 case 'SET_META_BOXES_PER_LOCATIONS': 931 return action.metaBoxesPerLocation; 932 } 933 934 return state; 935 } 936 /** 937 * Reducer returning the editing canvas device type. 938 * 939 * @param {Object} state Current state. 940 * @param {Object} action Dispatched action. 941 * 942 * @return {Object} Updated state. 943 */ 944 945 function deviceType(state = 'Desktop', action) { 946 switch (action.type) { 947 case 'SET_PREVIEW_DEVICE_TYPE': 948 return action.deviceType; 949 } 950 951 return state; 952 } 953 /** 954 * Reducer to set the block inserter panel open or closed. 955 * 956 * Note: this reducer interacts with the list view panel reducer 957 * to make sure that only one of the two panels is open at the same time. 958 * 959 * @param {Object} state Current state. 960 * @param {Object} action Dispatched action. 961 */ 962 963 function blockInserterPanel(state = false, action) { 964 switch (action.type) { 965 case 'SET_IS_LIST_VIEW_OPENED': 966 return action.isOpen ? false : state; 967 968 case 'SET_IS_INSERTER_OPENED': 969 return action.value; 970 } 971 972 return state; 973 } 974 /** 975 * Reducer to set the list view panel open or closed. 976 * 977 * Note: this reducer interacts with the inserter panel reducer 978 * to make sure that only one of the two panels is open at the same time. 979 * 980 * @param {Object} state Current state. 981 * @param {Object} action Dispatched action. 982 */ 983 984 function listViewPanel(state = false, action) { 985 switch (action.type) { 986 case 'SET_IS_INSERTER_OPENED': 987 return action.value ? false : state; 988 989 case 'SET_IS_LIST_VIEW_OPENED': 990 return action.isOpen; 991 } 992 993 return state; 994 } 995 /** 996 * Reducer tracking whether the inserter is open. 997 * 998 * @param {boolean} state 999 * @param {Object} action 1000 */ 1001 1002 function isEditingTemplate(state = false, action) { 1003 switch (action.type) { 1004 case 'SET_IS_EDITING_TEMPLATE': 1005 return action.value; 1006 } 1007 1008 return state; 1009 } 1010 /** 1011 * Reducer tracking whether meta boxes are initialized. 1012 * 1013 * @param {boolean} state 1014 * @param {Object} action 1015 * 1016 * @return {boolean} Updated state. 1017 */ 1018 1019 1020 function metaBoxesInitialized(state = false, action) { 1021 switch (action.type) { 1022 case 'META_BOXES_INITIALIZED': 1023 return true; 1024 } 1025 1026 return state; 1027 } 1028 1029 const metaBoxes = Object(external_wp_data_["combineReducers"])({ 1030 isSaving: isSavingMetaBoxes, 1031 locations: metaBoxLocations, 1032 initialized: metaBoxesInitialized 1033 }); 1034 /* harmony default export */ var reducer = (Object(external_wp_data_["combineReducers"])({ 1035 activeModal, 1036 metaBoxes, 1037 preferences, 1038 publishSidebarActive, 1039 removedPanels, 1040 deviceType, 1041 blockInserterPanel, 1042 listViewPanel, 1043 isEditingTemplate 1044 })); 1045 1046 // EXTERNAL MODULE: external ["wp","i18n"] 1047 var external_wp_i18n_ = __webpack_require__("l3Sj"); 1048 1049 // EXTERNAL MODULE: ./node_modules/@wordpress/interface/build-module/index.js + 15 modules 1050 var build_module = __webpack_require__("U60i"); 1051 1052 // EXTERNAL MODULE: external ["wp","a11y"] 1053 var external_wp_a11y_ = __webpack_require__("gdqT"); 1054 1055 // EXTERNAL MODULE: external ["wp","notices"] 1056 var external_wp_notices_ = __webpack_require__("onLe"); 1057 1058 // EXTERNAL MODULE: external ["wp","coreData"] 1059 var external_wp_coreData_ = __webpack_require__("jZUy"); 1060 1061 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/utils/meta-boxes.js 1062 /** 1063 * Function returning the current Meta Boxes DOM Node in the editor 1064 * whether the meta box area is opened or not. 1065 * If the MetaBox Area is visible returns it, and returns the original container instead. 1066 * 1067 * @param {string} location Meta Box location. 1068 * @return {string} HTML content. 1069 */ 1070 const getMetaBoxContainer = location => { 1071 const area = document.querySelector(`.edit-post-meta-boxes-area.is-${location} .metabox-location-${location}`); 1072 1073 if (area) { 1074 return area; 1075 } 1076 1077 return document.querySelector('#metaboxes .metabox-location-' + location); 1078 }; 1079 1080 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/actions.js 1081 /** 1082 * External dependencies 1083 */ 1084 1085 /** 1086 * WordPress dependencies 1087 */ 1088 1089 1090 1091 1092 1093 1094 1095 1096 /** 1097 * Internal dependencies 1098 */ 1099 1100 1101 1102 /** 1103 * Returns an action object used in signalling that the user opened an editor sidebar. 1104 * 1105 * @param {?string} name Sidebar name to be opened. 1106 * 1107 * @yield {Object} Action object. 1108 */ 1109 1110 function* openGeneralSidebar(name) { 1111 yield external_wp_data_["controls"].dispatch(build_module["g" /* store */].name, 'enableComplementaryArea', store.name, name); 1112 } 1113 /** 1114 * Returns an action object signalling that the user closed the sidebar. 1115 * 1116 * @yield {Object} Action object. 1117 */ 1118 1119 function* closeGeneralSidebar() { 1120 yield external_wp_data_["controls"].dispatch(build_module["g" /* store */].name, 'disableComplementaryArea', store.name); 1121 } 1122 /** 1123 * Returns an action object used in signalling that the user opened a modal. 1124 * 1125 * @param {string} name A string that uniquely identifies the modal. 1126 * 1127 * @return {Object} Action object. 1128 */ 1129 1130 function openModal(name) { 1131 return { 1132 type: 'OPEN_MODAL', 1133 name 1134 }; 1135 } 1136 /** 1137 * Returns an action object signalling that the user closed a modal. 1138 * 1139 * @return {Object} Action object. 1140 */ 1141 1142 function closeModal() { 1143 return { 1144 type: 'CLOSE_MODAL' 1145 }; 1146 } 1147 /** 1148 * Returns an action object used in signalling that the user opened the publish 1149 * sidebar. 1150 * 1151 * @return {Object} Action object 1152 */ 1153 1154 function openPublishSidebar() { 1155 return { 1156 type: 'OPEN_PUBLISH_SIDEBAR' 1157 }; 1158 } 1159 /** 1160 * Returns an action object used in signalling that the user closed the 1161 * publish sidebar. 1162 * 1163 * @return {Object} Action object. 1164 */ 1165 1166 function closePublishSidebar() { 1167 return { 1168 type: 'CLOSE_PUBLISH_SIDEBAR' 1169 }; 1170 } 1171 /** 1172 * Returns an action object used in signalling that the user toggles the publish sidebar. 1173 * 1174 * @return {Object} Action object 1175 */ 1176 1177 function togglePublishSidebar() { 1178 return { 1179 type: 'TOGGLE_PUBLISH_SIDEBAR' 1180 }; 1181 } 1182 /** 1183 * Returns an action object used to enable or disable a panel in the editor. 1184 * 1185 * @param {string} panelName A string that identifies the panel to enable or disable. 1186 * 1187 * @return {Object} Action object. 1188 */ 1189 1190 function toggleEditorPanelEnabled(panelName) { 1191 return { 1192 type: 'TOGGLE_PANEL_ENABLED', 1193 panelName 1194 }; 1195 } 1196 /** 1197 * Returns an action object used to open or close a panel in the editor. 1198 * 1199 * @param {string} panelName A string that identifies the panel to open or close. 1200 * 1201 * @return {Object} Action object. 1202 */ 1203 1204 function toggleEditorPanelOpened(panelName) { 1205 return { 1206 type: 'TOGGLE_PANEL_OPENED', 1207 panelName 1208 }; 1209 } 1210 /** 1211 * Returns an action object used to remove a panel from the editor. 1212 * 1213 * @param {string} panelName A string that identifies the panel to remove. 1214 * 1215 * @return {Object} Action object. 1216 */ 1217 1218 function removeEditorPanel(panelName) { 1219 return { 1220 type: 'REMOVE_PANEL', 1221 panelName 1222 }; 1223 } 1224 /** 1225 * Returns an action object used to toggle a feature flag. 1226 * 1227 * @param {string} feature Feature name. 1228 * 1229 * @return {Object} Action object. 1230 */ 1231 1232 function toggleFeature(feature) { 1233 return { 1234 type: 'TOGGLE_FEATURE', 1235 feature 1236 }; 1237 } 1238 function* switchEditorMode(mode) { 1239 yield { 1240 type: 'SWITCH_MODE', 1241 mode 1242 }; // Unselect blocks when we switch to the code editor. 1243 1244 if (mode !== 'visual') { 1245 yield external_wp_data_["controls"].dispatch('core/block-editor', 'clearSelectedBlock'); 1246 } 1247 1248 const message = mode === 'visual' ? Object(external_wp_i18n_["__"])('Visual editor selected') : Object(external_wp_i18n_["__"])('Code editor selected'); 1249 Object(external_wp_a11y_["speak"])(message, 'assertive'); 1250 } 1251 /** 1252 * Returns an action object used to toggle a plugin name flag. 1253 * 1254 * @param {string} pluginName Plugin name. 1255 * 1256 * @return {Object} Action object. 1257 */ 1258 1259 function togglePinnedPluginItem(pluginName) { 1260 return { 1261 type: 'TOGGLE_PINNED_PLUGIN_ITEM', 1262 pluginName 1263 }; 1264 } 1265 /** 1266 * Returns an action object used in signalling that block types by the given 1267 * name(s) should be hidden. 1268 * 1269 * @param {string[]} blockNames Names of block types to hide. 1270 * 1271 * @return {Object} Action object. 1272 */ 1273 1274 function hideBlockTypes(blockNames) { 1275 return { 1276 type: 'HIDE_BLOCK_TYPES', 1277 blockNames: Object(external_lodash_["castArray"])(blockNames) 1278 }; 1279 } 1280 /** 1281 * Returns an action object used in signaling that a style should be auto-applied when a block is created. 1282 * 1283 * @param {string} blockName Name of the block. 1284 * @param {?string} blockStyle Name of the style that should be auto applied. If undefined, the "auto apply" setting of the block is removed. 1285 * 1286 * @return {Object} Action object. 1287 */ 1288 1289 function updatePreferredStyleVariations(blockName, blockStyle) { 1290 return { 1291 type: 'UPDATE_PREFERRED_STYLE_VARIATIONS', 1292 blockName, 1293 blockStyle 1294 }; 1295 } 1296 /** 1297 * Returns an action object used in signalling that the editor should attempt 1298 * to locally autosave the current post every `interval` seconds. 1299 * 1300 * @param {number} interval The new interval, in seconds. 1301 * @return {Object} Action object. 1302 */ 1303 1304 function __experimentalUpdateLocalAutosaveInterval(interval) { 1305 return { 1306 type: 'UPDATE_LOCAL_AUTOSAVE_INTERVAL', 1307 interval 1308 }; 1309 } 1310 /** 1311 * Returns an action object used in signalling that block types by the given 1312 * name(s) should be shown. 1313 * 1314 * @param {string[]} blockNames Names of block types to show. 1315 * 1316 * @return {Object} Action object. 1317 */ 1318 1319 function showBlockTypes(blockNames) { 1320 return { 1321 type: 'SHOW_BLOCK_TYPES', 1322 blockNames: Object(external_lodash_["castArray"])(blockNames) 1323 }; 1324 } 1325 /** 1326 * Returns an action object used in signaling 1327 * what Meta boxes are available in which location. 1328 * 1329 * @param {Object} metaBoxesPerLocation Meta boxes per location. 1330 * 1331 * @yield {Object} Action object. 1332 */ 1333 1334 function* setAvailableMetaBoxesPerLocation(metaBoxesPerLocation) { 1335 yield { 1336 type: 'SET_META_BOXES_PER_LOCATIONS', 1337 metaBoxesPerLocation 1338 }; 1339 } 1340 /** 1341 * Returns an action object used to request meta box update. 1342 * 1343 * @yield {Object} Action object. 1344 */ 1345 1346 function* requestMetaBoxUpdates() { 1347 yield { 1348 type: 'REQUEST_META_BOX_UPDATES' 1349 }; // Saves the wp_editor fields 1350 1351 if (window.tinyMCE) { 1352 window.tinyMCE.triggerSave(); 1353 } // Additional data needed for backward compatibility. 1354 // If we do not provide this data, the post will be overridden with the default values. 1355 1356 1357 const post = yield external_wp_data_["controls"].select('core/editor', 'getCurrentPost'); 1358 const additionalData = [post.comment_status ? ['comment_status', post.comment_status] : false, post.ping_status ? ['ping_status', post.ping_status] : false, post.sticky ? ['sticky', post.sticky] : false, post.author ? ['post_author', post.author] : false].filter(Boolean); // We gather all the metaboxes locations data and the base form data 1359 1360 const baseFormData = new window.FormData(document.querySelector('.metabox-base-form')); 1361 const activeMetaBoxLocations = yield external_wp_data_["controls"].select(store.name, 'getActiveMetaBoxLocations'); 1362 const formDataToMerge = [baseFormData, ...activeMetaBoxLocations.map(location => new window.FormData(getMetaBoxContainer(location)))]; // Merge all form data objects into a single one. 1363 1364 const formData = Object(external_lodash_["reduce"])(formDataToMerge, (memo, currentFormData) => { 1365 for (const [key, value] of currentFormData) { 1366 memo.append(key, value); 1367 } 1368 1369 return memo; 1370 }, new window.FormData()); 1371 additionalData.forEach(([key, value]) => formData.append(key, value)); // Save the metaboxes 1372 1373 yield Object(external_wp_dataControls_["apiFetch"])({ 1374 url: window._wpMetaBoxUrl, 1375 method: 'POST', 1376 body: formData, 1377 parse: false 1378 }); 1379 yield external_wp_data_["controls"].dispatch(store.name, 'metaBoxUpdatesSuccess'); 1380 } 1381 /** 1382 * Returns an action object used signal a successful meta box update. 1383 * 1384 * @return {Object} Action object. 1385 */ 1386 1387 function metaBoxUpdatesSuccess() { 1388 return { 1389 type: 'META_BOX_UPDATES_SUCCESS' 1390 }; 1391 } 1392 /** 1393 * Returns an action object used to toggle the width of the editing canvas. 1394 * 1395 * @param {string} deviceType 1396 * 1397 * @return {Object} Action object. 1398 */ 1399 1400 function __experimentalSetPreviewDeviceType(deviceType) { 1401 return { 1402 type: 'SET_PREVIEW_DEVICE_TYPE', 1403 deviceType 1404 }; 1405 } 1406 /** 1407 * Returns an action object used to open/close the inserter. 1408 * 1409 * @param {boolean|Object} value Whether the inserter should be 1410 * opened (true) or closed (false). 1411 * To specify an insertion point, 1412 * use an object. 1413 * @param {string} value.rootClientId The root client ID to insert at. 1414 * @param {number} value.insertionIndex The index to insert at. 1415 * 1416 * @return {Object} Action object. 1417 */ 1418 1419 function setIsInserterOpened(value) { 1420 return { 1421 type: 'SET_IS_INSERTER_OPENED', 1422 value 1423 }; 1424 } 1425 /** 1426 * Returns an action object used to open/close the list view. 1427 * 1428 * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed. 1429 * @return {Object} Action object. 1430 */ 1431 1432 function setIsListViewOpened(isOpen) { 1433 return { 1434 type: 'SET_IS_LIST_VIEW_OPENED', 1435 isOpen 1436 }; 1437 } 1438 /** 1439 * Returns an action object used to switch to template editing. 1440 * 1441 * @param {boolean} value Is editing template. 1442 * @return {Object} Action object. 1443 */ 1444 1445 function setIsEditingTemplate(value) { 1446 return { 1447 type: 'SET_IS_EDITING_TEMPLATE', 1448 value 1449 }; 1450 } 1451 /** 1452 * Potentially create a block based template and switches to the template mode. 1453 * 1454 * @param {Object?} template template to create and assign before switching. 1455 */ 1456 1457 function* __unstableSwitchToTemplateMode(template) { 1458 if (!!template) { 1459 const savedTemplate = yield external_wp_data_["controls"].dispatch(external_wp_coreData_["store"], 'saveEntityRecord', 'postType', 'wp_template', template); 1460 const post = yield external_wp_data_["controls"].select('core/editor', 'getCurrentPost'); 1461 yield external_wp_data_["controls"].dispatch(external_wp_coreData_["store"], 'editEntityRecord', 'postType', post.type, post.id, { 1462 template: savedTemplate.slug 1463 }); 1464 } 1465 1466 yield setIsEditingTemplate(true); 1467 const isWelcomeGuideActive = yield external_wp_data_["controls"].select('core/edit-post', 'isFeatureActive', 'welcomeGuideTemplate'); 1468 1469 if (!isWelcomeGuideActive) { 1470 const message = !!template ? Object(external_wp_i18n_["__"])("Custom template created. You're in template mode now.") : Object(external_wp_i18n_["__"])('Editing template. Changes made here affect all posts and pages that use the template.'); 1471 yield external_wp_data_["controls"].dispatch(external_wp_notices_["store"], 'createSuccessNotice', message, { 1472 type: 'snackbar' 1473 }); 1474 } 1475 } 1476 let actions_metaBoxesInitialized = false; 1477 /** 1478 * Initializes WordPress `postboxes` script and the logic for saving meta boxes. 1479 */ 1480 1481 function* initializeMetaBoxes() { 1482 const isEditorReady = yield external_wp_data_["controls"].select('core/editor', '__unstableIsEditorReady'); 1483 1484 if (!isEditorReady) { 1485 return; 1486 } 1487 1488 const postType = yield external_wp_data_["controls"].select('core/editor', 'getCurrentPostType'); // Only initialize once. 1489 1490 if (actions_metaBoxesInitialized) { 1491 return; 1492 } 1493 1494 if (window.postboxes.page !== postType) { 1495 window.postboxes.add_postbox_toggles(postType); 1496 } 1497 1498 actions_metaBoxesInitialized = true; 1499 let wasSavingPost = yield external_wp_data_["controls"].select('core/editor', 'isSavingPost'); 1500 let wasAutosavingPost = yield external_wp_data_["controls"].select('core/editor', 'isAutosavingPost'); 1501 const hasMetaBoxes = yield external_wp_data_["controls"].select(store, 'hasMetaBoxes'); // Save metaboxes when performing a full save on the post. 1502 1503 Object(external_wp_data_["subscribe"])(() => { 1504 const isSavingPost = Object(external_wp_data_["select"])('core/editor').isSavingPost(); 1505 const isAutosavingPost = Object(external_wp_data_["select"])('core/editor').isAutosavingPost(); // Save metaboxes on save completion, except for autosaves that are not a post preview. 1506 // 1507 // Meta boxes are initialized once at page load. It is not necessary to 1508 // account for updates on each state change. 1509 // 1510 // See: https://github.com/WordPress/WordPress/blob/5.1.1/wp-admin/includes/post.php#L2307-L2309 1511 1512 const shouldTriggerMetaboxesSave = hasMetaBoxes && wasSavingPost && !isSavingPost && !wasAutosavingPost; // Save current state for next inspection. 1513 1514 wasSavingPost = isSavingPost; 1515 wasAutosavingPost = isAutosavingPost; 1516 1517 if (shouldTriggerMetaboxesSave) { 1518 Object(external_wp_data_["dispatch"])(store).requestMetaBoxUpdates(); 1519 } 1520 }); 1521 return { 1522 type: 'META_BOXES_INITIALIZED' 1523 }; 1524 } 1525 1526 // EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js 1527 var rememo = __webpack_require__("pPDe"); 1528 1529 // EXTERNAL MODULE: external ["wp","editor"] 1530 var external_wp_editor_ = __webpack_require__("jSdM"); 1531 1532 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/selectors.js 1533 /** 1534 * External dependencies 1535 */ 1536 1537 1538 /** 1539 * WordPress dependencies 1540 */ 1541 1542 1543 1544 1545 1546 /** 1547 * Returns the current editing mode. 1548 * 1549 * @param {Object} state Global application state. 1550 * 1551 * @return {string} Editing mode. 1552 */ 1553 1554 function getEditorMode(state) { 1555 return getPreference(state, 'editorMode', 'visual'); 1556 } 1557 /** 1558 * Returns true if the editor sidebar is opened. 1559 * 1560 * @param {Object} state Global application state 1561 * 1562 * @return {boolean} Whether the editor sidebar is opened. 1563 */ 1564 1565 const isEditorSidebarOpened = Object(external_wp_data_["createRegistrySelector"])(select => () => { 1566 const activeGeneralSidebar = select(build_module["g" /* store */]).getActiveComplementaryArea('core/edit-post'); 1567 return Object(external_lodash_["includes"])(['edit-post/document', 'edit-post/block'], activeGeneralSidebar); 1568 }); 1569 /** 1570 * Returns true if the plugin sidebar is opened. 1571 * 1572 * @param {Object} state Global application state 1573 * @return {boolean} Whether the plugin sidebar is opened. 1574 */ 1575 1576 const isPluginSidebarOpened = Object(external_wp_data_["createRegistrySelector"])(select => () => { 1577 const activeGeneralSidebar = select(build_module["g" /* store */]).getActiveComplementaryArea('core/edit-post'); 1578 return !!activeGeneralSidebar && !Object(external_lodash_["includes"])(['edit-post/document', 'edit-post/block'], activeGeneralSidebar); 1579 }); 1580 /** 1581 * Returns the current active general sidebar name, or null if there is no 1582 * general sidebar active. The active general sidebar is a unique name to 1583 * identify either an editor or plugin sidebar. 1584 * 1585 * Examples: 1586 * 1587 * - `edit-post/document` 1588 * - `my-plugin/insert-image-sidebar` 1589 * 1590 * @param {Object} state Global application state. 1591 * 1592 * @return {?string} Active general sidebar name. 1593 */ 1594 1595 const getActiveGeneralSidebarName = Object(external_wp_data_["createRegistrySelector"])(select => () => { 1596 return select(build_module["g" /* store */]).getActiveComplementaryArea('core/edit-post'); 1597 }); 1598 /** 1599 * Returns the preferences (these preferences are persisted locally). 1600 * 1601 * @param {Object} state Global application state. 1602 * 1603 * @return {Object} Preferences Object. 1604 */ 1605 1606 function getPreferences(state) { 1607 return state.preferences; 1608 } 1609 /** 1610 * 1611 * @param {Object} state Global application state. 1612 * @param {string} preferenceKey Preference Key. 1613 * @param {*} defaultValue Default Value. 1614 * 1615 * @return {*} Preference Value. 1616 */ 1617 1618 function getPreference(state, preferenceKey, defaultValue) { 1619 const preferences = getPreferences(state); 1620 const value = preferences[preferenceKey]; 1621 return value === undefined ? defaultValue : value; 1622 } 1623 /** 1624 * Returns true if the publish sidebar is opened. 1625 * 1626 * @param {Object} state Global application state 1627 * 1628 * @return {boolean} Whether the publish sidebar is open. 1629 */ 1630 1631 function isPublishSidebarOpened(state) { 1632 return state.publishSidebarActive; 1633 } 1634 /** 1635 * Returns true if the given panel was programmatically removed, or false otherwise. 1636 * All panels are not removed by default. 1637 * 1638 * @param {Object} state Global application state. 1639 * @param {string} panelName A string that identifies the panel. 1640 * 1641 * @return {boolean} Whether or not the panel is removed. 1642 */ 1643 1644 function isEditorPanelRemoved(state, panelName) { 1645 return Object(external_lodash_["includes"])(state.removedPanels, panelName); 1646 } 1647 /** 1648 * Returns true if the given panel is enabled, or false otherwise. Panels are 1649 * enabled by default. 1650 * 1651 * @param {Object} state Global application state. 1652 * @param {string} panelName A string that identifies the panel. 1653 * 1654 * @return {boolean} Whether or not the panel is enabled. 1655 */ 1656 1657 function isEditorPanelEnabled(state, panelName) { 1658 const panels = getPreference(state, 'panels'); 1659 return !isEditorPanelRemoved(state, panelName) && Object(external_lodash_["get"])(panels, [panelName, 'enabled'], true); 1660 } 1661 /** 1662 * Returns true if the given panel is open, or false otherwise. Panels are 1663 * closed by default. 1664 * 1665 * @param {Object} state Global application state. 1666 * @param {string} panelName A string that identifies the panel. 1667 * 1668 * @return {boolean} Whether or not the panel is open. 1669 */ 1670 1671 function isEditorPanelOpened(state, panelName) { 1672 const panels = getPreference(state, 'panels'); 1673 return Object(external_lodash_["get"])(panels, [panelName]) === true || Object(external_lodash_["get"])(panels, [panelName, 'opened']) === true; 1674 } 1675 /** 1676 * Returns true if a modal is active, or false otherwise. 1677 * 1678 * @param {Object} state Global application state. 1679 * @param {string} modalName A string that uniquely identifies the modal. 1680 * 1681 * @return {boolean} Whether the modal is active. 1682 */ 1683 1684 function isModalActive(state, modalName) { 1685 return state.activeModal === modalName; 1686 } 1687 /** 1688 * Returns whether the given feature is enabled or not. 1689 * 1690 * @param {Object} state Global application state. 1691 * @param {string} feature Feature slug. 1692 * 1693 * @return {boolean} Is active. 1694 */ 1695 1696 function isFeatureActive(state, feature) { 1697 return Object(external_lodash_["get"])(state.preferences.features, [feature], false); 1698 } 1699 /** 1700 * Returns true if the plugin item is pinned to the header. 1701 * When the value is not set it defaults to true. 1702 * 1703 * @param {Object} state Global application state. 1704 * @param {string} pluginName Plugin item name. 1705 * 1706 * @return {boolean} Whether the plugin item is pinned. 1707 */ 1708 1709 const isPluginItemPinned = Object(external_wp_data_["createRegistrySelector"])(select => pluginName => { 1710 return select(build_module["g" /* store */]).isItemPinned('core/edit-post', pluginName); 1711 }); 1712 /** 1713 * Returns an array of active meta box locations. 1714 * 1715 * @param {Object} state Post editor state. 1716 * 1717 * @return {string[]} Active meta box locations. 1718 */ 1719 1720 const getActiveMetaBoxLocations = Object(rememo["a" /* default */])(state => { 1721 return Object.keys(state.metaBoxes.locations).filter(location => isMetaBoxLocationActive(state, location)); 1722 }, state => [state.metaBoxes.locations]); 1723 /** 1724 * Returns true if a metabox location is active and visible 1725 * 1726 * @param {Object} state Post editor state. 1727 * @param {string} location Meta box location to test. 1728 * 1729 * @return {boolean} Whether the meta box location is active and visible. 1730 */ 1731 1732 function isMetaBoxLocationVisible(state, location) { 1733 return isMetaBoxLocationActive(state, location) && Object(external_lodash_["some"])(getMetaBoxesPerLocation(state, location), ({ 1734 id 1735 }) => { 1736 return isEditorPanelEnabled(state, `meta-box-${id}`); 1737 }); 1738 } 1739 /** 1740 * Returns true if there is an active meta box in the given location, or false 1741 * otherwise. 1742 * 1743 * @param {Object} state Post editor state. 1744 * @param {string} location Meta box location to test. 1745 * 1746 * @return {boolean} Whether the meta box location is active. 1747 */ 1748 1749 function isMetaBoxLocationActive(state, location) { 1750 const metaBoxes = getMetaBoxesPerLocation(state, location); 1751 return !!metaBoxes && metaBoxes.length !== 0; 1752 } 1753 /** 1754 * Returns the list of all the available meta boxes for a given location. 1755 * 1756 * @param {Object} state Global application state. 1757 * @param {string} location Meta box location to test. 1758 * 1759 * @return {?Array} List of meta boxes. 1760 */ 1761 1762 function getMetaBoxesPerLocation(state, location) { 1763 return state.metaBoxes.locations[location]; 1764 } 1765 /** 1766 * Returns the list of all the available meta boxes. 1767 * 1768 * @param {Object} state Global application state. 1769 * 1770 * @return {Array} List of meta boxes. 1771 */ 1772 1773 const getAllMetaBoxes = Object(rememo["a" /* default */])(state => { 1774 return Object(external_lodash_["flatten"])(Object(external_lodash_["values"])(state.metaBoxes.locations)); 1775 }, state => [state.metaBoxes.locations]); 1776 /** 1777 * Returns true if the post is using Meta Boxes 1778 * 1779 * @param {Object} state Global application state 1780 * 1781 * @return {boolean} Whether there are metaboxes or not. 1782 */ 1783 1784 function selectors_hasMetaBoxes(state) { 1785 return getActiveMetaBoxLocations(state).length > 0; 1786 } 1787 /** 1788 * Returns true if the Meta Boxes are being saved. 1789 * 1790 * @param {Object} state Global application state. 1791 * 1792 * @return {boolean} Whether the metaboxes are being saved. 1793 */ 1794 1795 function selectors_isSavingMetaBoxes(state) { 1796 return state.metaBoxes.isSaving; 1797 } 1798 /** 1799 * Returns the current editing canvas device type. 1800 * 1801 * @param {Object} state Global application state. 1802 * 1803 * @return {string} Device type. 1804 */ 1805 1806 function __experimentalGetPreviewDeviceType(state) { 1807 return state.deviceType; 1808 } 1809 /** 1810 * Returns true if the inserter is opened. 1811 * 1812 * @param {Object} state Global application state. 1813 * 1814 * @return {boolean} Whether the inserter is opened. 1815 */ 1816 1817 function isInserterOpened(state) { 1818 return !!state.blockInserterPanel; 1819 } 1820 /** 1821 * Get the insertion point for the inserter. 1822 * 1823 * @param {Object} state Global application state. 1824 * 1825 * @return {Object} The root client ID and index to insert at. 1826 */ 1827 1828 function __experimentalGetInsertionPoint(state) { 1829 const { 1830 rootClientId, 1831 insertionIndex 1832 } = state.blockInserterPanel; 1833 return { 1834 rootClientId, 1835 insertionIndex 1836 }; 1837 } 1838 /** 1839 * Returns true if the list view is opened. 1840 * 1841 * @param {Object} state Global application state. 1842 * 1843 * @return {boolean} Whether the list view is opened. 1844 */ 1845 1846 function isListViewOpened(state) { 1847 return state.listViewPanel; 1848 } 1849 /** 1850 * Returns true if the template editing mode is enabled. 1851 * 1852 * @param {Object} state Global application state. 1853 * 1854 * @return {boolean} Whether we're editing the template. 1855 */ 1856 1857 function selectors_isEditingTemplate(state) { 1858 return state.isEditingTemplate; 1859 } 1860 /** 1861 * Returns true if meta boxes are initialized. 1862 * 1863 * @param {Object} state Global application state. 1864 * 1865 * @return {boolean} Whether meta boxes are initialized. 1866 */ 1867 1868 function areMetaBoxesInitialized(state) { 1869 return state.metaBoxes.initialized; 1870 } 1871 /** 1872 * Retrieves the template of the currently edited post. 1873 * 1874 * @return {Object?} Post Template. 1875 */ 1876 1877 const getEditedPostTemplate = Object(external_wp_data_["createRegistrySelector"])(select => () => { 1878 const currentTemplate = select(external_wp_editor_["store"]).getEditedPostAttribute('template'); 1879 1880 if (currentTemplate) { 1881 var _select$getEntityReco; 1882 1883 const templateWithSameSlug = (_select$getEntityReco = select(external_wp_coreData_["store"]).getEntityRecords('postType', 'wp_template')) === null || _select$getEntityReco === void 0 ? void 0 : _select$getEntityReco.find(template => template.slug === currentTemplate); 1884 1885 if (!templateWithSameSlug) { 1886 return templateWithSameSlug; 1887 } 1888 1889 return select(external_wp_coreData_["store"]).getEditedEntityRecord('postType', 'wp_template', templateWithSameSlug.id); 1890 } 1891 1892 const post = select(external_wp_editor_["store"]).getCurrentPost(); 1893 1894 if (post.link && post.status !== 'auto-draft') { 1895 return select(external_wp_coreData_["store"]).__experimentalGetTemplateForLink(post.link); 1896 } 1897 1898 return null; 1899 }); 1900 1901 // EXTERNAL MODULE: ./node_modules/@wordpress/edit-post/build-module/store/constants.js 1902 var constants = __webpack_require__("0dt7"); 1903 1904 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/index.js 1905 /** 1906 * WordPress dependencies 1907 */ 1908 1909 1910 /** 1911 * Internal dependencies 1912 */ 1913 1914 1915 1916 1917 1918 const storeConfig = { 1919 reducer: reducer, 1920 actions: actions_namespaceObject, 1921 selectors: selectors_namespaceObject, 1922 controls: external_wp_dataControls_["controls"], 1923 persist: ['preferences'] 1924 }; 1925 /** 1926 * Store definition for the edit post namespace. 1927 * 1928 * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore 1929 * 1930 * @type {Object} 1931 */ 1932 1933 const store = Object(external_wp_data_["createReduxStore"])(constants["a" /* STORE_NAME */], storeConfig); // Ideally we use register instead of register store. 1934 1935 Object(external_wp_data_["registerStore"])(constants["a" /* STORE_NAME */], storeConfig); 1936 1937 1938 /***/ }), 1939 1940 /***/ "TSYQ": 1941 /***/ (function(module, exports, __webpack_require__) { 1942 1943 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 1944 Copyright (c) 2018 Jed Watson. 1945 Licensed under the MIT License (MIT), see 1946 http://jedwatson.github.io/classnames 1947 */ 1948 /* global define */ 1949 1950 (function () { 1951 'use strict'; 1952 1953 var hasOwn = {}.hasOwnProperty; 1954 1955 function classNames() { 1956 var classes = []; 1957 1958 for (var i = 0; i < arguments.length; i++) { 1959 var arg = arguments[i]; 1960 if (!arg) continue; 1961 1962 var argType = typeof arg; 1963 1964 if (argType === 'string' || argType === 'number') { 1965 classes.push(arg); 1966 } else if (Array.isArray(arg)) { 1967 if (arg.length) { 1968 var inner = classNames.apply(null, arg); 1969 if (inner) { 1970 classes.push(inner); 1971 } 1972 } 1973 } else if (argType === 'object') { 1974 if (arg.toString === Object.prototype.toString) { 1975 for (var key in arg) { 1976 if (hasOwn.call(arg, key) && arg[key]) { 1977 classes.push(key); 1978 } 1979 } 1980 } else { 1981 classes.push(arg.toString()); 1982 } 1983 } 1984 } 1985 1986 return classes.join(' '); 1987 } 1988 1989 if ( true && module.exports) { 1990 classNames.default = classNames; 1991 module.exports = classNames; 1992 } else if (true) { 1993 // register as 'classnames', consistent with npm package name 1994 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { 1995 return classNames; 1996 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 1997 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 1998 } else {} 1999 }()); 2000 2001 2002 /***/ }), 2003 2004 /***/ "Tqx9": 2005 /***/ (function(module, exports) { 2006 2007 (function() { module.exports = window["wp"]["primitives"]; }()); 2008 2009 /***/ }), 2010 2011 /***/ "TvNi": 2012 /***/ (function(module, exports) { 2013 2014 (function() { module.exports = window["wp"]["plugins"]; }()); 2015 2016 /***/ }), 2017 2018 /***/ "U60i": 2019 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2020 2021 "use strict"; 2022 2023 // EXPORTS 2024 __webpack_require__.d(__webpack_exports__, "g", function() { return /* reexport */ store; }); 2025 __webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ complementary_area; }); 2026 __webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ ComplementaryAreaMoreMenuItem; }); 2027 __webpack_require__.d(__webpack_exports__, "d", function() { return /* reexport */ fullscreen_mode; }); 2028 __webpack_require__.d(__webpack_exports__, "e", function() { return /* reexport */ interface_skeleton; }); 2029 __webpack_require__.d(__webpack_exports__, "f", function() { return /* reexport */ pinned_items; }); 2030 __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ action_item; }); 2031 2032 // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/actions.js 2033 var actions_namespaceObject = {}; 2034 __webpack_require__.r(actions_namespaceObject); 2035 __webpack_require__.d(actions_namespaceObject, "enableComplementaryArea", function() { return actions_enableComplementaryArea; }); 2036 __webpack_require__.d(actions_namespaceObject, "disableComplementaryArea", function() { return actions_disableComplementaryArea; }); 2037 __webpack_require__.d(actions_namespaceObject, "pinItem", function() { return actions_pinItem; }); 2038 __webpack_require__.d(actions_namespaceObject, "unpinItem", function() { return actions_unpinItem; }); 2039 2040 // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/selectors.js 2041 var selectors_namespaceObject = {}; 2042 __webpack_require__.r(selectors_namespaceObject); 2043 __webpack_require__.d(selectors_namespaceObject, "getActiveComplementaryArea", function() { return selectors_getActiveComplementaryArea; }); 2044 __webpack_require__.d(selectors_namespaceObject, "isItemPinned", function() { return selectors_isItemPinned; }); 2045 2046 // EXTERNAL MODULE: external ["wp","data"] 2047 var external_wp_data_ = __webpack_require__("1ZqX"); 2048 2049 // EXTERNAL MODULE: external "lodash" 2050 var external_lodash_ = __webpack_require__("YLtl"); 2051 2052 // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/reducer.js 2053 /** 2054 * External dependencies 2055 */ 2056 2057 /** 2058 * WordPress dependencies 2059 */ 2060 2061 2062 /** 2063 * Reducer to keep tract of the active area per scope. 2064 * 2065 * @param {boolean} state Previous state. 2066 * @param {Object} action Action object. 2067 * @param {string} action.type Action type. 2068 * @param {string} action.itemType Type of item. 2069 * @param {string} action.scope Item scope. 2070 * @param {string} action.item Item name. 2071 * 2072 * @return {Object} Updated state. 2073 */ 2074 2075 function singleEnableItems(state = {}, { 2076 type, 2077 itemType, 2078 scope, 2079 item 2080 }) { 2081 if (type !== 'SET_SINGLE_ENABLE_ITEM' || !itemType || !scope) { 2082 return state; 2083 } 2084 2085 return { ...state, 2086 [itemType]: { ...state[itemType], 2087 [scope]: item || null 2088 } 2089 }; 2090 } 2091 /** 2092 * Reducer keeping track of the "pinned" items per scope. 2093 * 2094 * @param {boolean} state Previous state. 2095 * @param {Object} action Action object. 2096 * @param {string} action.type Action type. 2097 * @param {string} action.itemType Type of item. 2098 * @param {string} action.scope Item scope. 2099 * @param {string} action.item Item name. 2100 * @param {boolean} action.isEnable Whether the item is pinned. 2101 * 2102 * @return {Object} Updated state. 2103 */ 2104 2105 function multipleEnableItems(state = {}, { 2106 type, 2107 itemType, 2108 scope, 2109 item, 2110 isEnable 2111 }) { 2112 if (type !== 'SET_MULTIPLE_ENABLE_ITEM' || !itemType || !scope || !item || Object(external_lodash_["get"])(state, [itemType, scope, item]) === isEnable) { 2113 return state; 2114 } 2115 2116 const currentTypeState = state[itemType] || {}; 2117 const currentScopeState = currentTypeState[scope] || {}; 2118 return { ...state, 2119 [itemType]: { ...currentTypeState, 2120 [scope]: { ...currentScopeState, 2121 [item]: isEnable || false 2122 } 2123 } 2124 }; 2125 } 2126 const enableItems = Object(external_wp_data_["combineReducers"])({ 2127 singleEnableItems, 2128 multipleEnableItems 2129 }); 2130 /* harmony default export */ var reducer = (Object(external_wp_data_["combineReducers"])({ 2131 enableItems 2132 })); 2133 2134 // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/actions.js 2135 /** 2136 * Returns an action object used in signalling that an active area should be changed. 2137 * 2138 * @param {string} itemType Type of item. 2139 * @param {string} scope Item scope. 2140 * @param {string} item Item identifier. 2141 * 2142 * @return {Object} Action object. 2143 */ 2144 function setSingleEnableItem(itemType, scope, item) { 2145 return { 2146 type: 'SET_SINGLE_ENABLE_ITEM', 2147 itemType, 2148 scope, 2149 item 2150 }; 2151 } 2152 /** 2153 * Returns an action object used in signalling that a complementary item should be enabled. 2154 * 2155 * @param {string} scope Complementary area scope. 2156 * @param {string} area Area identifier. 2157 * 2158 * @return {Object} Action object. 2159 */ 2160 2161 2162 function actions_enableComplementaryArea(scope, area) { 2163 return setSingleEnableItem('complementaryArea', scope, area); 2164 } 2165 /** 2166 * Returns an action object used in signalling that the complementary area of a given scope should be disabled. 2167 * 2168 * @param {string} scope Complementary area scope. 2169 * 2170 * @return {Object} Action object. 2171 */ 2172 2173 function actions_disableComplementaryArea(scope) { 2174 return setSingleEnableItem('complementaryArea', scope, undefined); 2175 } 2176 /** 2177 * Returns an action object to make an area enabled/disabled. 2178 * 2179 * @param {string} itemType Type of item. 2180 * @param {string} scope Item scope. 2181 * @param {string} item Item identifier. 2182 * @param {boolean} isEnable Boolean indicating if an area should be pinned or not. 2183 * 2184 * @return {Object} Action object. 2185 */ 2186 2187 function setMultipleEnableItem(itemType, scope, item, isEnable) { 2188 return { 2189 type: 'SET_MULTIPLE_ENABLE_ITEM', 2190 itemType, 2191 scope, 2192 item, 2193 isEnable 2194 }; 2195 } 2196 /** 2197 * Returns an action object used in signalling that an item should be pinned. 2198 * 2199 * @param {string} scope Item scope. 2200 * @param {string} itemId Item identifier. 2201 * 2202 * @return {Object} Action object. 2203 */ 2204 2205 2206 function actions_pinItem(scope, itemId) { 2207 return setMultipleEnableItem('pinnedItems', scope, itemId, true); 2208 } 2209 /** 2210 * Returns an action object used in signalling that an item should be unpinned. 2211 * 2212 * @param {string} scope Item scope. 2213 * @param {string} itemId Item identifier. 2214 * 2215 * @return {Object} Action object. 2216 */ 2217 2218 function actions_unpinItem(scope, itemId) { 2219 return setMultipleEnableItem('pinnedItems', scope, itemId, false); 2220 } 2221 2222 // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/selectors.js 2223 /** 2224 * External dependencies 2225 */ 2226 2227 /** 2228 * Returns the item that is enabled in a given scope. 2229 * 2230 * @param {Object} state Global application state. 2231 * @param {string} itemType Type of item. 2232 * @param {string} scope Item scope. 2233 * 2234 * @return {?string|null} The item that is enabled in the passed scope and type. 2235 */ 2236 2237 function getSingleEnableItem(state, itemType, scope) { 2238 return Object(external_lodash_["get"])(state.enableItems.singleEnableItems, [itemType, scope]); 2239 } 2240 /** 2241 * Returns the complementary area that is active in a given scope. 2242 * 2243 * @param {Object} state Global application state. 2244 * @param {string} scope Item scope. 2245 * 2246 * @return {string} The complementary area that is active in the given scope. 2247 */ 2248 2249 2250 function selectors_getActiveComplementaryArea(state, scope) { 2251 return getSingleEnableItem(state, 'complementaryArea', scope); 2252 } 2253 /** 2254 * Returns a boolean indicating if an item is enabled or not in a given scope. 2255 * 2256 * @param {Object} state Global application state. 2257 * @param {string} itemType Type of item. 2258 * @param {string} scope Scope. 2259 * @param {string} item Item to check. 2260 * 2261 * @return {boolean|undefined} True if the item is enabled, false otherwise if the item is explicitly disabled, and undefined if there is no information for that item. 2262 */ 2263 2264 function isMultipleEnabledItemEnabled(state, itemType, scope, item) { 2265 return Object(external_lodash_["get"])(state.enableItems.multipleEnableItems, [itemType, scope, item]); 2266 } 2267 /** 2268 * Returns a boolean indicating if an item is pinned or not. 2269 * 2270 * @param {Object} state Global application state. 2271 * @param {string} scope Scope. 2272 * @param {string} item Item to check. 2273 * 2274 * @return {boolean} True if the item is pinned and false otherwise. 2275 */ 2276 2277 2278 function selectors_isItemPinned(state, scope, item) { 2279 return isMultipleEnabledItemEnabled(state, 'pinnedItems', scope, item) !== false; 2280 } 2281 2282 // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/constants.js 2283 /** 2284 * The identifier for the data store. 2285 * 2286 * @type {string} 2287 */ 2288 const STORE_NAME = 'core/interface'; 2289 2290 // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/index.js 2291 /** 2292 * WordPress dependencies 2293 */ 2294 2295 /** 2296 * Internal dependencies 2297 */ 2298 2299 2300 2301 2302 2303 /** 2304 * Store definition for the interface namespace. 2305 * 2306 * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore 2307 * 2308 * @type {Object} 2309 */ 2310 2311 const store = Object(external_wp_data_["createReduxStore"])(STORE_NAME, { 2312 reducer: reducer, 2313 actions: actions_namespaceObject, 2314 selectors: selectors_namespaceObject, 2315 persist: ['enableItems'] 2316 }); // Once we build a more generic persistence plugin that works across types of stores 2317 // we'd be able to replace this with a register call. 2318 2319 Object(external_wp_data_["registerStore"])(STORE_NAME, { 2320 reducer: reducer, 2321 actions: actions_namespaceObject, 2322 selectors: selectors_namespaceObject, 2323 persist: ['enableItems'] 2324 }); 2325 2326 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js 2327 var esm_extends = __webpack_require__("wx14"); 2328 2329 // EXTERNAL MODULE: external ["wp","element"] 2330 var external_wp_element_ = __webpack_require__("GRId"); 2331 2332 // EXTERNAL MODULE: ./node_modules/classnames/index.js 2333 var classnames = __webpack_require__("TSYQ"); 2334 var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); 2335 2336 // EXTERNAL MODULE: external ["wp","components"] 2337 var external_wp_components_ = __webpack_require__("tI+e"); 2338 2339 // EXTERNAL MODULE: external ["wp","i18n"] 2340 var external_wp_i18n_ = __webpack_require__("l3Sj"); 2341 2342 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js 2343 var check = __webpack_require__("RMJe"); 2344 2345 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/star-filled.js 2346 var star_filled = __webpack_require__("URob"); 2347 2348 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/star-empty.js 2349 var star_empty = __webpack_require__("Xxwi"); 2350 2351 // EXTERNAL MODULE: external ["wp","viewport"] 2352 var external_wp_viewport_ = __webpack_require__("KEfo"); 2353 2354 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js 2355 var close_small = __webpack_require__("bWcr"); 2356 2357 // EXTERNAL MODULE: external ["wp","plugins"] 2358 var external_wp_plugins_ = __webpack_require__("TvNi"); 2359 2360 // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-context/index.js 2361 /** 2362 * WordPress dependencies 2363 */ 2364 2365 /* harmony default export */ var complementary_area_context = (Object(external_wp_plugins_["withPluginContext"])((context, ownProps) => { 2366 return { 2367 icon: ownProps.icon || context.icon, 2368 identifier: ownProps.identifier || `${context.name}/${ownProps.name}` 2369 }; 2370 })); 2371 2372 // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-toggle/index.js 2373 2374 2375 2376 /** 2377 * External dependencies 2378 */ 2379 2380 /** 2381 * WordPress dependencies 2382 */ 2383 2384 2385 2386 /** 2387 * Internal dependencies 2388 */ 2389 2390 2391 2392 2393 function ComplementaryAreaToggle({ 2394 as = external_wp_components_["Button"], 2395 scope, 2396 identifier, 2397 icon, 2398 selectedIcon, 2399 ...props 2400 }) { 2401 const ComponentToUse = as; 2402 const isSelected = Object(external_wp_data_["useSelect"])(select => select(store).getActiveComplementaryArea(scope) === identifier, [identifier]); 2403 const { 2404 enableComplementaryArea, 2405 disableComplementaryArea 2406 } = Object(external_wp_data_["useDispatch"])(store); 2407 return Object(external_wp_element_["createElement"])(ComponentToUse, Object(esm_extends["a" /* default */])({ 2408 icon: selectedIcon && isSelected ? selectedIcon : icon, 2409 onClick: () => { 2410 if (isSelected) { 2411 disableComplementaryArea(scope); 2412 } else { 2413 enableComplementaryArea(scope, identifier); 2414 } 2415 } 2416 }, Object(external_lodash_["omit"])(props, ['name']))); 2417 } 2418 2419 /* harmony default export */ var complementary_area_toggle = (complementary_area_context(ComplementaryAreaToggle)); 2420 2421 // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-header/index.js 2422 2423 2424 2425 /** 2426 * External dependencies 2427 */ 2428 2429 /** 2430 * WordPress dependencies 2431 */ 2432 2433 2434 /** 2435 * Internal dependencies 2436 */ 2437 2438 2439 2440 const ComplementaryAreaHeader = ({ 2441 smallScreenTitle, 2442 children, 2443 className, 2444 toggleButtonProps 2445 }) => { 2446 const toggleButton = Object(external_wp_element_["createElement"])(complementary_area_toggle, Object(esm_extends["a" /* default */])({ 2447 icon: close_small["a" /* default */] 2448 }, toggleButtonProps)); 2449 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("div", { 2450 className: "components-panel__header interface-complementary-area-header__small" 2451 }, smallScreenTitle && Object(external_wp_element_["createElement"])("span", { 2452 className: "interface-complementary-area-header__small-title" 2453 }, smallScreenTitle), toggleButton), Object(external_wp_element_["createElement"])("div", { 2454 className: classnames_default()('components-panel__header', 'interface-complementary-area-header', className), 2455 tabIndex: -1 2456 }, children, toggleButton)); 2457 }; 2458 2459 /* harmony default export */ var complementary_area_header = (ComplementaryAreaHeader); 2460 2461 // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/action-item/index.js 2462 2463 2464 2465 /** 2466 * External dependencies 2467 */ 2468 2469 /** 2470 * WordPress dependencies 2471 */ 2472 2473 2474 2475 2476 function ActionItemSlot({ 2477 name, 2478 as: Component = external_wp_components_["ButtonGroup"], 2479 fillProps = {}, 2480 bubblesVirtually, 2481 ...props 2482 }) { 2483 return Object(external_wp_element_["createElement"])(external_wp_components_["Slot"], { 2484 name: name, 2485 bubblesVirtually: bubblesVirtually, 2486 fillProps: fillProps 2487 }, fills => { 2488 if (Object(external_lodash_["isEmpty"])(external_wp_element_["Children"].toArray(fills))) { 2489 return null; 2490 } // Special handling exists for backward compatibility. 2491 // It ensures that menu items created by plugin authors aren't 2492 // duplicated with automatically injected menu items coming 2493 // from pinnable plugin sidebars. 2494 // @see https://github.com/WordPress/gutenberg/issues/14457 2495 2496 2497 const initializedByPlugins = []; 2498 external_wp_element_["Children"].forEach(fills, ({ 2499 props: { 2500 __unstableExplicitMenuItem, 2501 __unstableTarget 2502 } 2503 }) => { 2504 if (__unstableTarget && __unstableExplicitMenuItem) { 2505 initializedByPlugins.push(__unstableTarget); 2506 } 2507 }); 2508 const children = external_wp_element_["Children"].map(fills, child => { 2509 if (!child.props.__unstableExplicitMenuItem && initializedByPlugins.includes(child.props.__unstableTarget)) { 2510 return null; 2511 } 2512 2513 return child; 2514 }); 2515 return Object(external_wp_element_["createElement"])(Component, props, children); 2516 }); 2517 } 2518 2519 function ActionItem({ 2520 name, 2521 as: Component = external_wp_components_["Button"], 2522 onClick, 2523 ...props 2524 }) { 2525 return Object(external_wp_element_["createElement"])(external_wp_components_["Fill"], { 2526 name: name 2527 }, ({ 2528 onClick: fpOnClick 2529 }) => { 2530 return Object(external_wp_element_["createElement"])(Component, Object(esm_extends["a" /* default */])({ 2531 onClick: onClick || fpOnClick ? (...args) => { 2532 (onClick || external_lodash_["noop"])(...args); 2533 (fpOnClick || external_lodash_["noop"])(...args); 2534 } : undefined 2535 }, props)); 2536 }); 2537 } 2538 2539 ActionItem.Slot = ActionItemSlot; 2540 /* harmony default export */ var action_item = (ActionItem); 2541 2542 // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-more-menu-item/index.js 2543 2544 2545 2546 /** 2547 * External dependencies 2548 */ 2549 2550 /** 2551 * WordPress dependencies 2552 */ 2553 2554 2555 2556 /** 2557 * Internal dependencies 2558 */ 2559 2560 2561 2562 2563 const PluginsMenuItem = props => // Menu item is marked with unstable prop for backward compatibility. 2564 // They are removed so they don't leak to DOM elements. 2565 // @see https://github.com/WordPress/gutenberg/issues/14457 2566 Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], Object(external_lodash_["omit"])(props, ['__unstableExplicitMenuItem', '__unstableTarget'])); 2567 2568 function ComplementaryAreaMoreMenuItem({ 2569 scope, 2570 target, 2571 __unstableExplicitMenuItem, 2572 ...props 2573 }) { 2574 return Object(external_wp_element_["createElement"])(complementary_area_toggle, Object(esm_extends["a" /* default */])({ 2575 as: toggleProps => { 2576 return Object(external_wp_element_["createElement"])(action_item, Object(esm_extends["a" /* default */])({ 2577 __unstableExplicitMenuItem: __unstableExplicitMenuItem, 2578 __unstableTarget: `${scope}/${target}`, 2579 as: PluginsMenuItem, 2580 name: `${scope}/plugin-more-menu` 2581 }, toggleProps)); 2582 }, 2583 role: "menuitemcheckbox", 2584 selectedIcon: check["a" /* default */], 2585 name: target, 2586 scope: scope 2587 }, props)); 2588 } 2589 2590 // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/pinned-items/index.js 2591 2592 2593 2594 /** 2595 * External dependencies 2596 */ 2597 2598 2599 /** 2600 * WordPress dependencies 2601 */ 2602 2603 2604 2605 function PinnedItems({ 2606 scope, 2607 ...props 2608 }) { 2609 return Object(external_wp_element_["createElement"])(external_wp_components_["Fill"], Object(esm_extends["a" /* default */])({ 2610 name: `PinnedItems/${scope}` 2611 }, props)); 2612 } 2613 2614 function PinnedItemsSlot({ 2615 scope, 2616 className, 2617 ...props 2618 }) { 2619 return Object(external_wp_element_["createElement"])(external_wp_components_["Slot"], Object(esm_extends["a" /* default */])({ 2620 name: `PinnedItems/${scope}` 2621 }, props), fills => !Object(external_lodash_["isEmpty"])(fills) && Object(external_wp_element_["createElement"])("div", { 2622 className: classnames_default()(className, 'interface-pinned-items') 2623 }, fills)); 2624 } 2625 2626 PinnedItems.Slot = PinnedItemsSlot; 2627 /* harmony default export */ var pinned_items = (PinnedItems); 2628 2629 // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area/index.js 2630 2631 2632 2633 /** 2634 * External dependencies 2635 */ 2636 2637 /** 2638 * WordPress dependencies 2639 */ 2640 2641 2642 2643 2644 2645 2646 2647 /** 2648 * Internal dependencies 2649 */ 2650 2651 2652 2653 2654 2655 2656 2657 2658 function ComplementaryAreaSlot({ 2659 scope, 2660 ...props 2661 }) { 2662 return Object(external_wp_element_["createElement"])(external_wp_components_["Slot"], Object(esm_extends["a" /* default */])({ 2663 name: `ComplementaryArea/${scope}` 2664 }, props)); 2665 } 2666 2667 function ComplementaryAreaFill({ 2668 scope, 2669 children, 2670 className 2671 }) { 2672 return Object(external_wp_element_["createElement"])(external_wp_components_["Fill"], { 2673 name: `ComplementaryArea/${scope}` 2674 }, Object(external_wp_element_["createElement"])("div", { 2675 className: className 2676 }, children)); 2677 } 2678 2679 function useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall) { 2680 const previousIsSmall = Object(external_wp_element_["useRef"])(false); 2681 const shouldOpenWhenNotSmall = Object(external_wp_element_["useRef"])(false); 2682 const { 2683 enableComplementaryArea, 2684 disableComplementaryArea 2685 } = Object(external_wp_data_["useDispatch"])(store); 2686 Object(external_wp_element_["useEffect"])(() => { 2687 // If the complementary area is active and the editor is switching from a big to a small window size. 2688 if (isActive && isSmall && !previousIsSmall.current) { 2689 // Disable the complementary area. 2690 disableComplementaryArea(scope); // Flag the complementary area to be reopened when the window size goes from small to big. 2691 2692 shouldOpenWhenNotSmall.current = true; 2693 } else if ( // If there is a flag indicating the complementary area should be enabled when we go from small to big window size 2694 // and we are going from a small to big window size. 2695 shouldOpenWhenNotSmall.current && !isSmall && previousIsSmall.current) { 2696 // Remove the flag indicating the complementary area should be enabled. 2697 shouldOpenWhenNotSmall.current = false; // Enable the complementary area. 2698 2699 enableComplementaryArea(scope, identifier); 2700 } else if ( // If the flag is indicating the current complementary should be reopened but another complementary area becomes active, 2701 // remove the flag. 2702 shouldOpenWhenNotSmall.current && activeArea && activeArea !== identifier) { 2703 shouldOpenWhenNotSmall.current = false; 2704 } 2705 2706 if (isSmall !== previousIsSmall.current) { 2707 previousIsSmall.current = isSmall; 2708 } 2709 }, [isActive, isSmall, scope, identifier, activeArea]); 2710 } 2711 2712 function ComplementaryArea({ 2713 children, 2714 className, 2715 closeLabel = Object(external_wp_i18n_["__"])('Close plugin'), 2716 identifier, 2717 header, 2718 headerClassName, 2719 icon, 2720 isPinnable = true, 2721 panelClassName, 2722 scope, 2723 name, 2724 smallScreenTitle, 2725 title, 2726 toggleShortcut, 2727 isActiveByDefault, 2728 showIconLabels = false 2729 }) { 2730 const { 2731 isActive, 2732 isPinned, 2733 activeArea, 2734 isSmall, 2735 isLarge 2736 } = Object(external_wp_data_["useSelect"])(select => { 2737 const { 2738 getActiveComplementaryArea, 2739 isItemPinned 2740 } = select(store); 2741 2742 const _activeArea = getActiveComplementaryArea(scope); 2743 2744 return { 2745 isActive: _activeArea === identifier, 2746 isPinned: isItemPinned(scope, identifier), 2747 activeArea: _activeArea, 2748 isSmall: select(external_wp_viewport_["store"]).isViewportMatch('< medium'), 2749 isLarge: select(external_wp_viewport_["store"]).isViewportMatch('large') 2750 }; 2751 }, [identifier, scope]); 2752 useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall); 2753 const { 2754 enableComplementaryArea, 2755 disableComplementaryArea, 2756 pinItem, 2757 unpinItem 2758 } = Object(external_wp_data_["useDispatch"])(store); 2759 Object(external_wp_element_["useEffect"])(() => { 2760 if (isActiveByDefault && activeArea === undefined && !isSmall) { 2761 enableComplementaryArea(scope, identifier); 2762 } 2763 }, [activeArea, isActiveByDefault, scope, identifier, isSmall]); 2764 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, isPinnable && Object(external_wp_element_["createElement"])(pinned_items, { 2765 scope: scope 2766 }, isPinned && Object(external_wp_element_["createElement"])(complementary_area_toggle, { 2767 scope: scope, 2768 identifier: identifier, 2769 isPressed: isActive && (!showIconLabels || isLarge), 2770 "aria-expanded": isActive, 2771 label: title, 2772 icon: showIconLabels ? check["a" /* default */] : icon, 2773 showTooltip: !showIconLabels, 2774 isTertiary: showIconLabels 2775 })), name && isPinnable && Object(external_wp_element_["createElement"])(ComplementaryAreaMoreMenuItem, { 2776 target: name, 2777 scope: scope, 2778 icon: icon 2779 }, title), isActive && Object(external_wp_element_["createElement"])(ComplementaryAreaFill, { 2780 className: classnames_default()('interface-complementary-area', className), 2781 scope: scope 2782 }, Object(external_wp_element_["createElement"])(complementary_area_header, { 2783 className: headerClassName, 2784 closeLabel: closeLabel, 2785 onClose: () => disableComplementaryArea(scope), 2786 smallScreenTitle: smallScreenTitle, 2787 toggleButtonProps: { 2788 label: closeLabel, 2789 shortcut: toggleShortcut, 2790 scope, 2791 identifier 2792 } 2793 }, header || Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("strong", null, title), isPinnable && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 2794 className: "interface-complementary-area__pin-unpin-item", 2795 icon: isPinned ? star_filled["a" /* default */] : star_empty["a" /* default */], 2796 label: isPinned ? Object(external_wp_i18n_["__"])('Unpin from toolbar') : Object(external_wp_i18n_["__"])('Pin to toolbar'), 2797 onClick: () => (isPinned ? unpinItem : pinItem)(scope, identifier), 2798 isPressed: isPinned, 2799 "aria-expanded": isPinned 2800 }))), Object(external_wp_element_["createElement"])(external_wp_components_["Panel"], { 2801 className: panelClassName 2802 }, children))); 2803 } 2804 2805 const ComplementaryAreaWrapped = complementary_area_context(ComplementaryArea); 2806 ComplementaryAreaWrapped.Slot = ComplementaryAreaSlot; 2807 /* harmony default export */ var complementary_area = (ComplementaryAreaWrapped); 2808 2809 // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/fullscreen-mode/index.js 2810 /** 2811 * WordPress dependencies 2812 */ 2813 2814 class fullscreen_mode_FullscreenMode extends external_wp_element_["Component"] { 2815 componentDidMount() { 2816 this.isSticky = false; 2817 this.sync(); // `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes 2818 // `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled 2819 // even if `is-fullscreen-mode` is then removed. Let's remove `sticky-menu` here as 2820 // a consequence of the FullscreenMode setup 2821 2822 if (document.body.classList.contains('sticky-menu')) { 2823 this.isSticky = true; 2824 document.body.classList.remove('sticky-menu'); 2825 } 2826 } 2827 2828 componentWillUnmount() { 2829 if (this.isSticky) { 2830 document.body.classList.add('sticky-menu'); 2831 } 2832 2833 if (this.props.isActive) { 2834 document.body.classList.remove('is-fullscreen-mode'); 2835 } 2836 } 2837 2838 componentDidUpdate(prevProps) { 2839 if (this.props.isActive !== prevProps.isActive) { 2840 this.sync(); 2841 } 2842 } 2843 2844 sync() { 2845 const { 2846 isActive 2847 } = this.props; 2848 2849 if (isActive) { 2850 document.body.classList.add('is-fullscreen-mode'); 2851 } else { 2852 document.body.classList.remove('is-fullscreen-mode'); 2853 } 2854 } 2855 2856 render() { 2857 return null; 2858 } 2859 2860 } 2861 /* harmony default export */ var fullscreen_mode = (fullscreen_mode_FullscreenMode); 2862 2863 // EXTERNAL MODULE: external ["wp","compose"] 2864 var external_wp_compose_ = __webpack_require__("K9lf"); 2865 2866 // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/interface-skeleton/index.js 2867 2868 2869 /** 2870 * External dependencies 2871 */ 2872 2873 /** 2874 * WordPress dependencies 2875 */ 2876 2877 /** 2878 * WordPress dependencies 2879 */ 2880 2881 2882 2883 2884 2885 2886 function useHTMLClass(className) { 2887 Object(external_wp_element_["useEffect"])(() => { 2888 const element = document && document.querySelector(`html:not(.${className})`); 2889 2890 if (!element) { 2891 return; 2892 } 2893 2894 element.classList.toggle(className); 2895 return () => { 2896 element.classList.toggle(className); 2897 }; 2898 }, [className]); 2899 } 2900 2901 function InterfaceSkeleton({ 2902 footer, 2903 header, 2904 sidebar, 2905 secondarySidebar, 2906 notices, 2907 content, 2908 drawer, 2909 actions, 2910 labels, 2911 className, 2912 shortcuts 2913 }, ref) { 2914 const fallbackRef = Object(external_wp_element_["useRef"])(); 2915 const regionsClassName = Object(external_wp_components_["__unstableUseNavigateRegions"])(fallbackRef, shortcuts); 2916 useHTMLClass('interface-interface-skeleton__html-container'); 2917 const defaultLabels = { 2918 /* translators: accessibility text for the nav bar landmark region. */ 2919 drawer: Object(external_wp_i18n_["__"])('Drawer'), 2920 2921 /* translators: accessibility text for the top bar landmark region. */ 2922 header: Object(external_wp_i18n_["__"])('Header'), 2923 2924 /* translators: accessibility text for the content landmark region. */ 2925 body: Object(external_wp_i18n_["__"])('Content'), 2926 2927 /* translators: accessibility text for the secondary sidebar landmark region. */ 2928 secondarySidebar: Object(external_wp_i18n_["__"])('Block Library'), 2929 2930 /* translators: accessibility text for the settings landmark region. */ 2931 sidebar: Object(external_wp_i18n_["__"])('Settings'), 2932 2933 /* translators: accessibility text for the publish landmark region. */ 2934 actions: Object(external_wp_i18n_["__"])('Publish'), 2935 2936 /* translators: accessibility text for the footer landmark region. */ 2937 footer: Object(external_wp_i18n_["__"])('Footer') 2938 }; 2939 const mergedLabels = { ...defaultLabels, 2940 ...labels 2941 }; 2942 return Object(external_wp_element_["createElement"])("div", { 2943 ref: Object(external_wp_compose_["useMergeRefs"])([ref, fallbackRef]), 2944 className: classnames_default()(className, 'interface-interface-skeleton', regionsClassName, !!footer && 'has-footer') 2945 }, !!drawer && Object(external_wp_element_["createElement"])("div", { 2946 className: "interface-interface-skeleton__drawer", 2947 role: "region", 2948 "aria-label": mergedLabels.drawer 2949 }, drawer), Object(external_wp_element_["createElement"])("div", { 2950 className: "interface-interface-skeleton__editor" 2951 }, !!header && Object(external_wp_element_["createElement"])("div", { 2952 className: "interface-interface-skeleton__header", 2953 role: "region", 2954 "aria-label": mergedLabels.header, 2955 tabIndex: "-1" 2956 }, header), Object(external_wp_element_["createElement"])("div", { 2957 className: "interface-interface-skeleton__body" 2958 }, !!secondarySidebar && Object(external_wp_element_["createElement"])("div", { 2959 className: "interface-interface-skeleton__secondary-sidebar", 2960 role: "region", 2961 "aria-label": mergedLabels.secondarySidebar, 2962 tabIndex: "-1" 2963 }, secondarySidebar), !!notices && Object(external_wp_element_["createElement"])("div", { 2964 className: "interface-interface-skeleton__notices" 2965 }, notices), Object(external_wp_element_["createElement"])("div", { 2966 className: "interface-interface-skeleton__content", 2967 role: "region", 2968 "aria-label": mergedLabels.body, 2969 tabIndex: "-1" 2970 }, content), !!sidebar && Object(external_wp_element_["createElement"])("div", { 2971 className: "interface-interface-skeleton__sidebar", 2972 role: "region", 2973 "aria-label": mergedLabels.sidebar, 2974 tabIndex: "-1" 2975 }, sidebar), !!actions && Object(external_wp_element_["createElement"])("div", { 2976 className: "interface-interface-skeleton__actions", 2977 role: "region", 2978 "aria-label": mergedLabels.actions, 2979 tabIndex: "-1" 2980 }, actions))), !!footer && Object(external_wp_element_["createElement"])("div", { 2981 className: "interface-interface-skeleton__footer", 2982 role: "region", 2983 "aria-label": mergedLabels.footer, 2984 tabIndex: "-1" 2985 }, footer)); 2986 } 2987 2988 /* harmony default export */ var interface_skeleton = (Object(external_wp_element_["forwardRef"])(InterfaceSkeleton)); 2989 2990 // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/index.js 2991 2992 2993 2994 2995 2996 2997 2998 // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/index.js 2999 3000 3001 3002 3003 /***/ }), 3004 3005 /***/ "URob": 3006 /***/ (function(module, __webpack_exports__, __webpack_require__) { 3007 3008 "use strict"; 3009 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 3010 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 3011 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 3012 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 3013 3014 3015 /** 3016 * WordPress dependencies 3017 */ 3018 3019 const starFilled = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 3020 xmlns: "http://www.w3.org/2000/svg", 3021 viewBox: "0 0 24 24" 3022 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 3023 d: "M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z" 3024 })); 3025 /* harmony default export */ __webpack_exports__["a"] = (starFilled); 3026 3027 3028 /***/ }), 3029 3030 /***/ "VKE3": 3031 /***/ (function(module, __webpack_exports__, __webpack_require__) { 3032 3033 "use strict"; 3034 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 3035 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 3036 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 3037 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 3038 3039 3040 /** 3041 * WordPress dependencies 3042 */ 3043 3044 const moreVertical = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 3045 xmlns: "http://www.w3.org/2000/svg", 3046 viewBox: "0 0 24 24" 3047 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 3048 d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" 3049 })); 3050 /* harmony default export */ __webpack_exports__["a"] = (moreVertical); 3051 3052 3053 /***/ }), 3054 3055 /***/ "Xxwi": 3056 /***/ (function(module, __webpack_exports__, __webpack_require__) { 3057 3058 "use strict"; 3059 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 3060 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 3061 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 3062 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 3063 3064 3065 /** 3066 * WordPress dependencies 3067 */ 3068 3069 const starEmpty = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 3070 xmlns: "http://www.w3.org/2000/svg", 3071 viewBox: "0 0 24 24" 3072 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 3073 fillRule: "evenodd", 3074 d: "M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z", 3075 clipRule: "evenodd" 3076 })); 3077 /* harmony default export */ __webpack_exports__["a"] = (starEmpty); 3078 3079 3080 /***/ }), 3081 3082 /***/ "Y5n4": 3083 /***/ (function(module, __webpack_exports__, __webpack_require__) { 3084 3085 "use strict"; 3086 3087 // EXPORTS 3088 __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ enable_custom_fields; }); 3089 __webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ enable_panel; }); 3090 __webpack_require__.d(__webpack_exports__, "d", function() { return /* reexport */ enable_plugin_document_setting_panel; }); 3091 __webpack_require__.d(__webpack_exports__, "e", function() { return /* reexport */ enable_publish_sidebar; }); 3092 __webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ enable_feature; }); 3093 3094 // EXTERNAL MODULE: external ["wp","element"] 3095 var external_wp_element_ = __webpack_require__("GRId"); 3096 3097 // EXTERNAL MODULE: external ["wp","i18n"] 3098 var external_wp_i18n_ = __webpack_require__("l3Sj"); 3099 3100 // EXTERNAL MODULE: external ["wp","components"] 3101 var external_wp_components_ = __webpack_require__("tI+e"); 3102 3103 // EXTERNAL MODULE: external ["wp","data"] 3104 var external_wp_data_ = __webpack_require__("1ZqX"); 3105 3106 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/base.js 3107 3108 3109 /** 3110 * WordPress dependencies 3111 */ 3112 3113 3114 function BaseOption({ 3115 help, 3116 label, 3117 isChecked, 3118 onChange, 3119 children 3120 }) { 3121 return Object(external_wp_element_["createElement"])("div", { 3122 className: "edit-post-preferences-modal__option" 3123 }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], { 3124 help: help, 3125 label: label, 3126 checked: isChecked, 3127 onChange: onChange 3128 }), children); 3129 } 3130 3131 /* harmony default export */ var base = (BaseOption); 3132 3133 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-custom-fields.js 3134 3135 3136 /** 3137 * WordPress dependencies 3138 */ 3139 3140 3141 3142 3143 /** 3144 * Internal dependencies 3145 */ 3146 3147 3148 function CustomFieldsConfirmation({ 3149 willEnable 3150 }) { 3151 const [isReloading, setIsReloading] = Object(external_wp_element_["useState"])(false); 3152 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("p", { 3153 className: "edit-post-preferences-modal__custom-fields-confirmation-message" 3154 }, Object(external_wp_i18n_["__"])('A page reload is required for this change. Make sure your content is saved before reloading.')), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 3155 className: "edit-post-preferences-modal__custom-fields-confirmation-button", 3156 isSecondary: true, 3157 isBusy: isReloading, 3158 disabled: isReloading, 3159 onClick: () => { 3160 setIsReloading(true); 3161 document.getElementById('toggle-custom-fields-form').submit(); 3162 } 3163 }, willEnable ? Object(external_wp_i18n_["__"])('Enable & Reload') : Object(external_wp_i18n_["__"])('Disable & Reload'))); 3164 } 3165 function EnableCustomFieldsOption({ 3166 label, 3167 areCustomFieldsEnabled 3168 }) { 3169 const [isChecked, setIsChecked] = Object(external_wp_element_["useState"])(areCustomFieldsEnabled); 3170 return Object(external_wp_element_["createElement"])(base, { 3171 label: label, 3172 isChecked: isChecked, 3173 onChange: setIsChecked 3174 }, isChecked !== areCustomFieldsEnabled && Object(external_wp_element_["createElement"])(CustomFieldsConfirmation, { 3175 willEnable: isChecked 3176 })); 3177 } 3178 /* harmony default export */ var enable_custom_fields = (Object(external_wp_data_["withSelect"])(select => ({ 3179 areCustomFieldsEnabled: !!select('core/editor').getEditorSettings().enableCustomFields 3180 }))(EnableCustomFieldsOption)); 3181 3182 // EXTERNAL MODULE: external ["wp","compose"] 3183 var external_wp_compose_ = __webpack_require__("K9lf"); 3184 3185 // EXTERNAL MODULE: ./node_modules/@wordpress/edit-post/build-module/store/index.js + 5 modules 3186 var store = __webpack_require__("T40v"); 3187 3188 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-panel.js 3189 /** 3190 * WordPress dependencies 3191 */ 3192 3193 3194 /** 3195 * Internal dependencies 3196 */ 3197 3198 3199 3200 /* harmony default export */ var enable_panel = (Object(external_wp_compose_["compose"])(Object(external_wp_data_["withSelect"])((select, { 3201 panelName 3202 }) => { 3203 const { 3204 isEditorPanelEnabled, 3205 isEditorPanelRemoved 3206 } = select(store["a" /* store */]); 3207 return { 3208 isRemoved: isEditorPanelRemoved(panelName), 3209 isChecked: isEditorPanelEnabled(panelName) 3210 }; 3211 }), Object(external_wp_compose_["ifCondition"])(({ 3212 isRemoved 3213 }) => !isRemoved), Object(external_wp_data_["withDispatch"])((dispatch, { 3214 panelName 3215 }) => ({ 3216 onChange: () => dispatch(store["a" /* store */]).toggleEditorPanelEnabled(panelName) 3217 })))(base)); 3218 3219 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js 3220 3221 3222 /** 3223 * WordPress dependencies 3224 */ 3225 3226 /** 3227 * Internal dependencies 3228 */ 3229 3230 3231 const { 3232 Fill, 3233 Slot 3234 } = Object(external_wp_components_["createSlotFill"])('EnablePluginDocumentSettingPanelOption'); 3235 3236 const EnablePluginDocumentSettingPanelOption = ({ 3237 label, 3238 panelName 3239 }) => Object(external_wp_element_["createElement"])(Fill, null, Object(external_wp_element_["createElement"])(enable_panel, { 3240 label: label, 3241 panelName: panelName 3242 })); 3243 3244 EnablePluginDocumentSettingPanelOption.Slot = Slot; 3245 /* harmony default export */ var enable_plugin_document_setting_panel = (EnablePluginDocumentSettingPanelOption); 3246 3247 // EXTERNAL MODULE: external ["wp","viewport"] 3248 var external_wp_viewport_ = __webpack_require__("KEfo"); 3249 3250 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-publish-sidebar.js 3251 /** 3252 * WordPress dependencies 3253 */ 3254 3255 3256 3257 /** 3258 * Internal dependencies 3259 */ 3260 3261 3262 /* harmony default export */ var enable_publish_sidebar = (Object(external_wp_compose_["compose"])(Object(external_wp_data_["withSelect"])(select => ({ 3263 isChecked: select('core/editor').isPublishSidebarEnabled() 3264 })), Object(external_wp_data_["withDispatch"])(dispatch => { 3265 const { 3266 enablePublishSidebar, 3267 disablePublishSidebar 3268 } = dispatch('core/editor'); 3269 return { 3270 onChange: isEnabled => isEnabled ? enablePublishSidebar() : disablePublishSidebar() 3271 }; 3272 }), // In < medium viewports we override this option and always show the publish sidebar. 3273 // See the edit-post's header component for the specific logic. 3274 Object(external_wp_viewport_["ifViewportMatches"])('medium'))(base)); 3275 3276 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-feature.js 3277 /** 3278 * WordPress dependencies 3279 */ 3280 3281 3282 /** 3283 * Internal dependencies 3284 */ 3285 3286 3287 3288 /* harmony default export */ var enable_feature = (Object(external_wp_compose_["compose"])(Object(external_wp_data_["withSelect"])((select, { 3289 featureName 3290 }) => { 3291 const { 3292 isFeatureActive 3293 } = select(store["a" /* store */]); 3294 return { 3295 isChecked: isFeatureActive(featureName) 3296 }; 3297 }), Object(external_wp_data_["withDispatch"])((dispatch, { 3298 featureName 3299 }) => ({ 3300 onChange: () => dispatch(store["a" /* store */]).toggleFeature(featureName) 3301 })))(base)); 3302 3303 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/index.js 3304 3305 3306 3307 3308 3309 3310 3311 /***/ }), 3312 3313 /***/ "YLtl": 3314 /***/ (function(module, exports) { 3315 3316 (function() { module.exports = window["lodash"]; }()); 3317 3318 /***/ }), 3319 3320 /***/ "Z23Y": 3321 /***/ (function(module, exports) { 3322 3323 (function() { module.exports = window["wp"]["warning"]; }()); 3324 3325 /***/ }), 3326 3327 /***/ "axFQ": 3328 /***/ (function(module, exports) { 3329 3330 (function() { module.exports = window["wp"]["blockEditor"]; }()); 3331 3332 /***/ }), 3333 3334 /***/ "bWcr": 3335 /***/ (function(module, __webpack_exports__, __webpack_require__) { 3336 3337 "use strict"; 3338 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 3339 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 3340 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 3341 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 3342 3343 3344 /** 3345 * WordPress dependencies 3346 */ 3347 3348 const closeSmall = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 3349 xmlns: "http://www.w3.org/2000/svg", 3350 viewBox: "0 0 24 24" 3351 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 3352 d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" 3353 })); 3354 /* harmony default export */ __webpack_exports__["a"] = (closeSmall); 3355 3356 3357 /***/ }), 3358 3359 /***/ "cDcd": 3360 /***/ (function(module, exports) { 3361 3362 (function() { module.exports = window["React"]; }()); 3363 3364 /***/ }), 3365 3366 /***/ "cjQ8": 3367 /***/ (function(module, __webpack_exports__, __webpack_require__) { 3368 3369 "use strict"; 3370 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 3371 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 3372 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 3373 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 3374 3375 3376 /** 3377 * WordPress dependencies 3378 */ 3379 3380 const arrowLeft = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 3381 xmlns: "http://www.w3.org/2000/svg", 3382 viewBox: "0 0 24 24" 3383 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 3384 d: "M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z" 3385 })); 3386 /* harmony default export */ __webpack_exports__["a"] = (arrowLeft); 3387 3388 3389 /***/ }), 3390 3391 /***/ "dSQ2": 3392 /***/ (function(module, __webpack_exports__, __webpack_require__) { 3393 3394 "use strict"; 3395 // ESM COMPAT FLAG 3396 __webpack_require__.r(__webpack_exports__); 3397 3398 // EXPORTS 3399 __webpack_require__.d(__webpack_exports__, "reinitializeEditor", function() { return /* binding */ reinitializeEditor; }); 3400 __webpack_require__.d(__webpack_exports__, "initializeEditor", function() { return /* binding */ initializeEditor; }); 3401 __webpack_require__.d(__webpack_exports__, "PluginBlockSettingsMenuItem", function() { return /* reexport */ plugin_block_settings_menu_item; }); 3402 __webpack_require__.d(__webpack_exports__, "PluginDocumentSettingPanel", function() { return /* reexport */ plugin_document_setting_panel["a" /* default */]; }); 3403 __webpack_require__.d(__webpack_exports__, "PluginMoreMenuItem", function() { return /* reexport */ plugin_more_menu_item; }); 3404 __webpack_require__.d(__webpack_exports__, "PluginPostPublishPanel", function() { return /* reexport */ plugin_post_publish_panel; }); 3405 __webpack_require__.d(__webpack_exports__, "PluginPostStatusInfo", function() { return /* reexport */ plugin_post_status_info; }); 3406 __webpack_require__.d(__webpack_exports__, "PluginPrePublishPanel", function() { return /* reexport */ plugin_pre_publish_panel; }); 3407 __webpack_require__.d(__webpack_exports__, "PluginSidebar", function() { return /* reexport */ PluginSidebarEditPost; }); 3408 __webpack_require__.d(__webpack_exports__, "PluginSidebarMoreMenuItem", function() { return /* reexport */ PluginSidebarMoreMenuItem; }); 3409 __webpack_require__.d(__webpack_exports__, "__experimentalFullscreenModeClose", function() { return /* reexport */ fullscreen_mode_close; }); 3410 __webpack_require__.d(__webpack_exports__, "__experimentalMainDashboardButton", function() { return /* reexport */ main_dashboard_button; }); 3411 __webpack_require__.d(__webpack_exports__, "store", function() { return /* reexport */ store["a" /* store */]; }); 3412 3413 // EXTERNAL MODULE: external ["wp","element"] 3414 var external_wp_element_ = __webpack_require__("GRId"); 3415 3416 // EXTERNAL MODULE: external ["wp","coreData"] 3417 var external_wp_coreData_ = __webpack_require__("jZUy"); 3418 3419 // EXTERNAL MODULE: external ["wp","blockEditor"] 3420 var external_wp_blockEditor_ = __webpack_require__("axFQ"); 3421 3422 // EXTERNAL MODULE: external ["wp","editor"] 3423 var external_wp_editor_ = __webpack_require__("jSdM"); 3424 3425 // EXTERNAL MODULE: external ["wp","blockLibrary"] 3426 var external_wp_blockLibrary_ = __webpack_require__("QyPg"); 3427 3428 // EXTERNAL MODULE: external ["wp","hooks"] 3429 var external_wp_hooks_ = __webpack_require__("g56x"); 3430 3431 // EXTERNAL MODULE: external ["wp","mediaUtils"] 3432 var external_wp_mediaUtils_ = __webpack_require__("6aBm"); 3433 3434 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/hooks/components/index.js 3435 /** 3436 * WordPress dependencies 3437 */ 3438 3439 3440 3441 const replaceMediaUpload = () => external_wp_mediaUtils_["MediaUpload"]; 3442 3443 Object(external_wp_hooks_["addFilter"])('editor.MediaUpload', 'core/edit-post/replace-media-upload', replaceMediaUpload); 3444 3445 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js 3446 var esm_extends = __webpack_require__("wx14"); 3447 3448 // EXTERNAL MODULE: external "lodash" 3449 var external_lodash_ = __webpack_require__("YLtl"); 3450 3451 // EXTERNAL MODULE: external ["wp","blocks"] 3452 var external_wp_blocks_ = __webpack_require__("HSyU"); 3453 3454 // EXTERNAL MODULE: external ["wp","components"] 3455 var external_wp_components_ = __webpack_require__("tI+e"); 3456 3457 // EXTERNAL MODULE: external ["wp","data"] 3458 var external_wp_data_ = __webpack_require__("1ZqX"); 3459 3460 // EXTERNAL MODULE: external ["wp","i18n"] 3461 var external_wp_i18n_ = __webpack_require__("l3Sj"); 3462 3463 // EXTERNAL MODULE: external ["wp","compose"] 3464 var external_wp_compose_ = __webpack_require__("K9lf"); 3465 3466 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/hooks/validate-multiple-use/index.js 3467 3468 3469 3470 /** 3471 * External dependencies 3472 */ 3473 3474 /** 3475 * WordPress dependencies 3476 */ 3477 3478 3479 3480 3481 3482 3483 3484 3485 const enhance = Object(external_wp_compose_["compose"])( 3486 /** 3487 * For blocks whose block type doesn't support `multiple`, provides the 3488 * wrapped component with `originalBlockClientId` -- a reference to the 3489 * first block of the same type in the content -- if and only if that 3490 * "original" block is not the current one. Thus, an inexisting 3491 * `originalBlockClientId` prop signals that the block is valid. 3492 * 3493 * @param {WPComponent} WrappedBlockEdit A filtered BlockEdit instance. 3494 * 3495 * @return {WPComponent} Enhanced component with merged state data props. 3496 */ 3497 Object(external_wp_data_["withSelect"])((select, block) => { 3498 const multiple = Object(external_wp_blocks_["hasBlockSupport"])(block.name, 'multiple', true); // For block types with `multiple` support, there is no "original 3499 // block" to be found in the content, as the block itself is valid. 3500 3501 if (multiple) { 3502 return {}; 3503 } // Otherwise, only pass `originalBlockClientId` if it refers to a different 3504 // block from the current one. 3505 3506 3507 const blocks = select(external_wp_blockEditor_["store"]).getBlocks(); 3508 const firstOfSameType = Object(external_lodash_["find"])(blocks, ({ 3509 name 3510 }) => block.name === name); 3511 const isInvalid = firstOfSameType && firstOfSameType.clientId !== block.clientId; 3512 return { 3513 originalBlockClientId: isInvalid && firstOfSameType.clientId 3514 }; 3515 }), Object(external_wp_data_["withDispatch"])((dispatch, { 3516 originalBlockClientId 3517 }) => ({ 3518 selectFirst: () => dispatch(external_wp_blockEditor_["store"]).selectBlock(originalBlockClientId) 3519 }))); 3520 const withMultipleValidation = Object(external_wp_compose_["createHigherOrderComponent"])(BlockEdit => { 3521 return enhance(({ 3522 originalBlockClientId, 3523 selectFirst, 3524 ...props 3525 }) => { 3526 if (!originalBlockClientId) { 3527 return Object(external_wp_element_["createElement"])(BlockEdit, props); 3528 } 3529 3530 const blockType = Object(external_wp_blocks_["getBlockType"])(props.name); 3531 const outboundType = getOutboundType(props.name); 3532 return [Object(external_wp_element_["createElement"])("div", { 3533 key: "invalid-preview", 3534 style: { 3535 minHeight: '60px' 3536 } 3537 }, Object(external_wp_element_["createElement"])(BlockEdit, Object(esm_extends["a" /* default */])({ 3538 key: "block-edit" 3539 }, props))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], { 3540 key: "multiple-use-warning", 3541 actions: [Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 3542 key: "find-original", 3543 isSecondary: true, 3544 onClick: selectFirst 3545 }, Object(external_wp_i18n_["__"])('Find original')), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 3546 key: "remove", 3547 isSecondary: true, 3548 onClick: () => props.onReplace([]) 3549 }, Object(external_wp_i18n_["__"])('Remove')), outboundType && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 3550 key: "transform", 3551 isSecondary: true, 3552 onClick: () => props.onReplace(Object(external_wp_blocks_["createBlock"])(outboundType.name, props.attributes)) 3553 }, Object(external_wp_i18n_["__"])('Transform into:'), " ", outboundType.title)] 3554 }, Object(external_wp_element_["createElement"])("strong", null, blockType.title, ": "), Object(external_wp_i18n_["__"])('This block can only be used once.'))]; 3555 }); 3556 }, 'withMultipleValidation'); 3557 /** 3558 * Given a base block name, returns the default block type to which to offer 3559 * transforms. 3560 * 3561 * @param {string} blockName Base block name. 3562 * 3563 * @return {?Object} The chosen default block type. 3564 */ 3565 3566 function getOutboundType(blockName) { 3567 // Grab the first outbound transform 3568 const transform = Object(external_wp_blocks_["findTransform"])(Object(external_wp_blocks_["getBlockTransforms"])('to', blockName), ({ 3569 type, 3570 blocks 3571 }) => type === 'block' && blocks.length === 1 // What about when .length > 1? 3572 ); 3573 3574 if (!transform) { 3575 return null; 3576 } 3577 3578 return Object(external_wp_blocks_["getBlockType"])(transform.blocks[0]); 3579 } 3580 3581 Object(external_wp_hooks_["addFilter"])('editor.BlockEdit', 'core/edit-post/validate-multiple-use/with-multiple-validation', withMultipleValidation); 3582 3583 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/hooks/index.js 3584 /** 3585 * Internal dependencies 3586 */ 3587 3588 3589 3590 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js 3591 var external = __webpack_require__("K+tz"); 3592 3593 // EXTERNAL MODULE: external ["wp","plugins"] 3594 var external_wp_plugins_ = __webpack_require__("TvNi"); 3595 3596 // EXTERNAL MODULE: external ["wp","url"] 3597 var external_wp_url_ = __webpack_require__("Mmq9"); 3598 3599 // EXTERNAL MODULE: external ["wp","notices"] 3600 var external_wp_notices_ = __webpack_require__("onLe"); 3601 3602 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/plugins/copy-content-menu-item/index.js 3603 3604 3605 /** 3606 * WordPress dependencies 3607 */ 3608 3609 3610 3611 3612 3613 3614 function CopyContentMenuItem() { 3615 const { 3616 createNotice 3617 } = Object(external_wp_data_["useDispatch"])(external_wp_notices_["store"]); 3618 const getText = Object(external_wp_data_["useSelect"])(select => () => select(external_wp_editor_["store"]).getEditedPostAttribute('content'), []); 3619 3620 function onSuccess() { 3621 createNotice('info', Object(external_wp_i18n_["__"])('All content copied.'), { 3622 isDismissible: true, 3623 type: 'snackbar' 3624 }); 3625 } 3626 3627 const ref = Object(external_wp_compose_["useCopyToClipboard"])(getText, onSuccess); 3628 return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { 3629 ref: ref 3630 }, Object(external_wp_i18n_["__"])('Copy all content')); 3631 } 3632 3633 // EXTERNAL MODULE: ./node_modules/@wordpress/edit-post/build-module/store/index.js + 5 modules 3634 var store = __webpack_require__("T40v"); 3635 3636 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/plugins/manage-blocks-menu-item/index.js 3637 3638 3639 /** 3640 * WordPress dependencies 3641 */ 3642 3643 3644 3645 /** 3646 * Internal dependencies 3647 */ 3648 3649 3650 function ManageBlocksMenuItem({ 3651 openModal 3652 }) { 3653 return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { 3654 onClick: () => { 3655 openModal('edit-post/manage-blocks'); 3656 } 3657 }, Object(external_wp_i18n_["__"])('Block Manager')); 3658 } 3659 /* harmony default export */ var manage_blocks_menu_item = (Object(external_wp_data_["withDispatch"])(dispatch => { 3660 const { 3661 openModal 3662 } = dispatch(store["a" /* store */]); 3663 return { 3664 openModal 3665 }; 3666 })(ManageBlocksMenuItem)); 3667 3668 // EXTERNAL MODULE: external ["wp","keycodes"] 3669 var external_wp_keycodes_ = __webpack_require__("RxS6"); 3670 3671 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js 3672 3673 3674 /** 3675 * WordPress dependencies 3676 */ 3677 3678 3679 3680 3681 /** 3682 * Internal dependencies 3683 */ 3684 3685 3686 function KeyboardShortcutsHelpMenuItem({ 3687 openModal 3688 }) { 3689 return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { 3690 onClick: () => { 3691 openModal('edit-post/keyboard-shortcut-help'); 3692 }, 3693 shortcut: external_wp_keycodes_["displayShortcut"].access('h') 3694 }, Object(external_wp_i18n_["__"])('Keyboard shortcuts')); 3695 } 3696 /* harmony default export */ var keyboard_shortcuts_help_menu_item = (Object(external_wp_data_["withDispatch"])(dispatch => { 3697 const { 3698 openModal 3699 } = dispatch(store["a" /* store */]); 3700 return { 3701 openModal 3702 }; 3703 })(KeyboardShortcutsHelpMenuItem)); 3704 3705 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/tools-more-menu-group/index.js 3706 3707 3708 /** 3709 * External dependencies 3710 */ 3711 3712 /** 3713 * WordPress dependencies 3714 */ 3715 3716 3717 3718 const { 3719 Fill: ToolsMoreMenuGroup, 3720 Slot 3721 } = Object(external_wp_components_["createSlotFill"])('ToolsMoreMenuGroup'); 3722 3723 ToolsMoreMenuGroup.Slot = ({ 3724 fillProps 3725 }) => Object(external_wp_element_["createElement"])(Slot, { 3726 fillProps: fillProps 3727 }, fills => !Object(external_lodash_["isEmpty"])(fills) && Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], { 3728 label: Object(external_wp_i18n_["__"])('Tools') 3729 }, fills)); 3730 3731 /* harmony default export */ var tools_more_menu_group = (ToolsMoreMenuGroup); 3732 3733 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/plugins/welcome-guide-menu-item/index.js 3734 3735 3736 /** 3737 * WordPress dependencies 3738 */ 3739 3740 3741 3742 /** 3743 * Internal dependencies 3744 */ 3745 3746 3747 function WelcomeGuideMenuItem() { 3748 const isTemplateMode = Object(external_wp_data_["useSelect"])(select => select(store["a" /* store */]).isEditingTemplate(), []); 3749 const { 3750 toggleFeature 3751 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 3752 return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { 3753 onClick: () => toggleFeature(isTemplateMode ? 'welcomeGuideTemplate' : 'welcomeGuide') 3754 }, Object(external_wp_i18n_["__"])('Welcome Guide')); 3755 } 3756 3757 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/plugins/index.js 3758 3759 3760 /** 3761 * WordPress dependencies 3762 */ 3763 3764 3765 3766 3767 3768 /** 3769 * Internal dependencies 3770 */ 3771 3772 3773 3774 3775 3776 3777 Object(external_wp_plugins_["registerPlugin"])('edit-post', { 3778 render() { 3779 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(tools_more_menu_group, null, ({ 3780 onClose 3781 }) => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(manage_blocks_menu_item, { 3782 onSelect: onClose 3783 }), Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { 3784 role: "menuitem", 3785 href: Object(external_wp_url_["addQueryArgs"])('edit.php', { 3786 post_type: 'wp_block' 3787 }) 3788 }, Object(external_wp_i18n_["__"])('Manage Reusable blocks')), Object(external_wp_element_["createElement"])(keyboard_shortcuts_help_menu_item, { 3789 onSelect: onClose 3790 }), Object(external_wp_element_["createElement"])(WelcomeGuideMenuItem, null), Object(external_wp_element_["createElement"])(CopyContentMenuItem, null), Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { 3791 role: "menuitem", 3792 icon: external["a" /* default */], 3793 href: Object(external_wp_i18n_["__"])('https://wordpress.org/support/article/wordpress-editor/'), 3794 target: "_blank", 3795 rel: "noopener noreferrer" 3796 }, Object(external_wp_i18n_["__"])('Help'), Object(external_wp_element_["createElement"])(external_wp_components_["VisuallyHidden"], { 3797 as: "span" 3798 }, 3799 /* translators: accessibility text */ 3800 Object(external_wp_i18n_["__"])('(opens in a new tab)')))))); 3801 } 3802 3803 }); 3804 3805 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/prevent-event-discovery.js 3806 /* harmony default export */ var prevent_event_discovery = ({ 3807 't a l e s o f g u t e n b e r g': event => { 3808 const { 3809 ownerDocument 3810 } = event.target; 3811 3812 if (!ownerDocument.activeElement.classList.contains('edit-post-visual-editor') && ownerDocument.activeElement !== ownerDocument.body) { 3813 return; 3814 } 3815 3816 event.preventDefault(); 3817 window.wp.data.dispatch('core/block-editor').insertBlock(window.wp.blocks.createBlock('core/paragraph', { 3818 content: '🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️' 3819 })); 3820 } 3821 }); 3822 3823 // EXTERNAL MODULE: ./node_modules/classnames/index.js 3824 var classnames = __webpack_require__("TSYQ"); 3825 var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); 3826 3827 // EXTERNAL MODULE: ./node_modules/@wordpress/interface/build-module/index.js + 15 modules 3828 var build_module = __webpack_require__("U60i"); 3829 3830 // EXTERNAL MODULE: external ["wp","keyboardShortcuts"] 3831 var external_wp_keyboardShortcuts_ = __webpack_require__("hF7m"); 3832 3833 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/text-editor/index.js 3834 3835 3836 /** 3837 * WordPress dependencies 3838 */ 3839 3840 3841 3842 3843 3844 3845 /** 3846 * Internal dependencies 3847 */ 3848 3849 3850 3851 function TextEditor({ 3852 onExit, 3853 isRichEditingEnabled 3854 }) { 3855 return Object(external_wp_element_["createElement"])("div", { 3856 className: "edit-post-text-editor" 3857 }, isRichEditingEnabled && Object(external_wp_element_["createElement"])("div", { 3858 className: "edit-post-text-editor__toolbar" 3859 }, Object(external_wp_element_["createElement"])("h2", null, Object(external_wp_i18n_["__"])('Editing code')), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 3860 isTertiary: true, 3861 onClick: onExit, 3862 shortcut: external_wp_keycodes_["displayShortcut"].secondary('m') 3863 }, Object(external_wp_i18n_["__"])('Exit code editor')), Object(external_wp_element_["createElement"])(external_wp_editor_["TextEditorGlobalKeyboardShortcuts"], null)), Object(external_wp_element_["createElement"])("div", { 3864 className: "edit-post-text-editor__body" 3865 }, Object(external_wp_element_["createElement"])(external_wp_editor_["PostTitle"], null), Object(external_wp_element_["createElement"])(external_wp_editor_["PostTextEditor"], null))); 3866 } 3867 3868 /* harmony default export */ var text_editor = (Object(external_wp_compose_["compose"])(Object(external_wp_data_["withSelect"])(select => ({ 3869 isRichEditingEnabled: select('core/editor').getEditorSettings().richEditingEnabled 3870 })), Object(external_wp_data_["withDispatch"])(dispatch => { 3871 return { 3872 onExit() { 3873 dispatch(store["a" /* store */]).switchEditorMode('visual'); 3874 } 3875 3876 }; 3877 }))(TextEditor)); 3878 3879 // CONCATENATED MODULE: ./node_modules/framer-motion/node_modules/tslib/tslib.es6.js 3880 /*! ***************************************************************************** 3881 Copyright (c) Microsoft Corporation. 3882 3883 Permission to use, copy, modify, and/or distribute this software for any 3884 purpose with or without fee is hereby granted. 3885 3886 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 3887 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 3888 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 3889 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 3890 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 3891 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 3892 PERFORMANCE OF THIS SOFTWARE. 3893 ***************************************************************************** */ 3894 /* global Reflect, Promise */ 3895 3896 var extendStatics = function(d, b) { 3897 extendStatics = Object.setPrototypeOf || 3898 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 3899 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; 3900 return extendStatics(d, b); 3901 }; 3902 3903 function __extends(d, b) { 3904 if (typeof b !== "function" && b !== null) 3905 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); 3906 extendStatics(d, b); 3907 function __() { this.constructor = d; } 3908 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 3909 } 3910 3911 var __assign = function() { 3912 __assign = Object.assign || function __assign(t) { 3913 for (var s, i = 1, n = arguments.length; i < n; i++) { 3914 s = arguments[i]; 3915 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 3916 } 3917 return t; 3918 } 3919 return __assign.apply(this, arguments); 3920 } 3921 3922 function __rest(s, e) { 3923 var t = {}; 3924 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 3925 t[p] = s[p]; 3926 if (s != null && typeof Object.getOwnPropertySymbols === "function") 3927 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 3928 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 3929 t[p[i]] = s[p[i]]; 3930 } 3931 return t; 3932 } 3933 3934 function __decorate(decorators, target, key, desc) { 3935 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 3936 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 3937 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; 3938 return c > 3 && r && Object.defineProperty(target, key, r), r; 3939 } 3940 3941 function __param(paramIndex, decorator) { 3942 return function (target, key) { decorator(target, key, paramIndex); } 3943 } 3944 3945 function __metadata(metadataKey, metadataValue) { 3946 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); 3947 } 3948 3949 function __awaiter(thisArg, _arguments, P, generator) { 3950 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 3951 return new (P || (P = Promise))(function (resolve, reject) { 3952 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 3953 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 3954 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 3955 step((generator = generator.apply(thisArg, _arguments || [])).next()); 3956 }); 3957 } 3958 3959 function __generator(thisArg, body) { 3960 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 3961 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 3962 function verb(n) { return function (v) { return step([n, v]); }; } 3963 function step(op) { 3964 if (f) throw new TypeError("Generator is already executing."); 3965 while (_) try { 3966 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; 3967 if (y = 0, t) op = [op[0] & 2, t.value]; 3968 switch (op[0]) { 3969 case 0: case 1: t = op; break; 3970 case 4: _.label++; return { value: op[1], done: false }; 3971 case 5: _.label++; y = op[1]; op = [0]; continue; 3972 case 7: op = _.ops.pop(); _.trys.pop(); continue; 3973 default: 3974 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 3975 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 3976 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 3977 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 3978 if (t[2]) _.ops.pop(); 3979 _.trys.pop(); continue; 3980 } 3981 op = body.call(thisArg, _); 3982 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 3983 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 3984 } 3985 } 3986 3987 var __createBinding = Object.create ? (function(o, m, k, k2) { 3988 if (k2 === undefined) k2 = k; 3989 Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); 3990 }) : (function(o, m, k, k2) { 3991 if (k2 === undefined) k2 = k; 3992 o[k2] = m[k]; 3993 }); 3994 3995 function __exportStar(m, o) { 3996 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); 3997 } 3998 3999 function __values(o) { 4000 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; 4001 if (m) return m.call(o); 4002 if (o && typeof o.length === "number") return { 4003 next: function () { 4004 if (o && i >= o.length) o = void 0; 4005 return { value: o && o[i++], done: !o }; 4006 } 4007 }; 4008 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); 4009 } 4010 4011 function __read(o, n) { 4012 var m = typeof Symbol === "function" && o[Symbol.iterator]; 4013 if (!m) return o; 4014 var i = m.call(o), r, ar = [], e; 4015 try { 4016 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 4017 } 4018 catch (error) { e = { error: error }; } 4019 finally { 4020 try { 4021 if (r && !r.done && (m = i["return"])) m.call(i); 4022 } 4023 finally { if (e) throw e.error; } 4024 } 4025 return ar; 4026 } 4027 4028 /** @deprecated */ 4029 function __spread() { 4030 for (var ar = [], i = 0; i < arguments.length; i++) 4031 ar = ar.concat(__read(arguments[i])); 4032 return ar; 4033 } 4034 4035 /** @deprecated */ 4036 function __spreadArrays() { 4037 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 4038 for (var r = Array(s), k = 0, i = 0; i < il; i++) 4039 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 4040 r[k] = a[j]; 4041 return r; 4042 } 4043 4044 function __spreadArray(to, from, pack) { 4045 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { 4046 if (ar || !(i in from)) { 4047 if (!ar) ar = Array.prototype.slice.call(from, 0, i); 4048 ar[i] = from[i]; 4049 } 4050 } 4051 return to.concat(ar || Array.prototype.slice.call(from)); 4052 } 4053 4054 function __await(v) { 4055 return this instanceof __await ? (this.v = v, this) : new __await(v); 4056 } 4057 4058 function __asyncGenerator(thisArg, _arguments, generator) { 4059 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 4060 var g = generator.apply(thisArg, _arguments || []), i, q = []; 4061 return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; 4062 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); }); }; } 4063 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } 4064 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } 4065 function fulfill(value) { resume("next", value); } 4066 function reject(value) { resume("throw", value); } 4067 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } 4068 } 4069 4070 function __asyncDelegator(o) { 4071 var i, p; 4072 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 4073 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; } 4074 } 4075 4076 function __asyncValues(o) { 4077 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 4078 var m = o[Symbol.asyncIterator], i; 4079 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); 4080 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); }); }; } 4081 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } 4082 } 4083 4084 function __makeTemplateObject(cooked, raw) { 4085 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 4086 return cooked; 4087 }; 4088 4089 var __setModuleDefault = Object.create ? (function(o, v) { 4090 Object.defineProperty(o, "default", { enumerable: true, value: v }); 4091 }) : function(o, v) { 4092 o["default"] = v; 4093 }; 4094 4095 function __importStar(mod) { 4096 if (mod && mod.__esModule) return mod; 4097 var result = {}; 4098 if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); 4099 __setModuleDefault(result, mod); 4100 return result; 4101 } 4102 4103 function __importDefault(mod) { 4104 return (mod && mod.__esModule) ? mod : { default: mod }; 4105 } 4106 4107 function __classPrivateFieldGet(receiver, state, kind, f) { 4108 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); 4109 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); 4110 return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); 4111 } 4112 4113 function __classPrivateFieldSet(receiver, state, value, kind, f) { 4114 if (kind === "m") throw new TypeError("Private method is not writable"); 4115 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); 4116 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); 4117 return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; 4118 } 4119 4120 // EXTERNAL MODULE: external "React" 4121 var external_React_ = __webpack_require__("cDcd"); 4122 var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_); 4123 4124 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/definitions.js 4125 var createDefinition = function (propNames) { return ({ 4126 isEnabled: function (props) { return propNames.some(function (name) { return !!props[name]; }); }, 4127 }); }; 4128 var featureDefinitions = { 4129 measureLayout: createDefinition([ 4130 "layout", 4131 "layoutId", 4132 "drag", 4133 "_layoutResetTransform", 4134 ]), 4135 animation: createDefinition([ 4136 "animate", 4137 "exit", 4138 "variants", 4139 "whileHover", 4140 "whileTap", 4141 "whileFocus", 4142 "whileDrag", 4143 ]), 4144 exit: createDefinition(["exit"]), 4145 drag: createDefinition(["drag", "dragControls"]), 4146 focus: createDefinition(["whileFocus"]), 4147 hover: createDefinition(["whileHover", "onHoverStart", "onHoverEnd"]), 4148 tap: createDefinition(["whileTap", "onTap", "onTapStart", "onTapCancel"]), 4149 pan: createDefinition([ 4150 "onPan", 4151 "onPanStart", 4152 "onPanSessionStart", 4153 "onPanEnd", 4154 ]), 4155 layoutAnimation: createDefinition(["layout", "layoutId"]), 4156 }; 4157 function loadFeatures(features) { 4158 for (var key in features) { 4159 var Component = features[key]; 4160 if (Component !== null) 4161 featureDefinitions[key].Component = Component; 4162 } 4163 } 4164 4165 4166 4167 // CONCATENATED MODULE: ./node_modules/hey-listen/dist/hey-listen.es.js 4168 var warning = function () { }; 4169 var invariant = function () { }; 4170 if (false) {} 4171 4172 4173 4174 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/LazyContext.js 4175 4176 4177 var LazyContext = Object(external_React_["createContext"])({ strict: false }); 4178 4179 4180 4181 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/use-features.js 4182 4183 4184 4185 4186 4187 4188 4189 var featureNames = Object.keys(featureDefinitions); 4190 var numFeatures = featureNames.length; 4191 /** 4192 * Load features via renderless components based on the provided MotionProps. 4193 */ 4194 function useFeatures(props, visualElement, preloadedFeatures) { 4195 var features = []; 4196 var lazyContext = Object(external_React_["useContext"])(LazyContext); 4197 if (!visualElement) 4198 return null; 4199 /** 4200 * If we're in development mode, check to make sure we're not rendering a motion component 4201 * as a child of LazyMotion, as this will break the file-size benefits of using it. 4202 */ 4203 if (false) {} 4204 for (var i = 0; i < numFeatures; i++) { 4205 var name_1 = featureNames[i]; 4206 var _a = featureDefinitions[name_1], isEnabled = _a.isEnabled, Component = _a.Component; 4207 /** 4208 * It might be possible in the future to use this moment to 4209 * dynamically request functionality. In initial tests this 4210 * was producing a lot of duplication amongst bundles. 4211 */ 4212 if (isEnabled(props) && Component) { 4213 features.push(external_React_["createElement"](Component, __assign({ key: name_1 }, props, { visualElement: visualElement }))); 4214 } 4215 } 4216 return features; 4217 } 4218 4219 4220 4221 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionConfigContext.js 4222 4223 4224 /** 4225 * @public 4226 */ 4227 var MotionConfigContext = Object(external_React_["createContext"])({ 4228 transformPagePoint: function (p) { return p; }, 4229 isStatic: false, 4230 }); 4231 4232 4233 4234 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionContext/index.js 4235 4236 4237 var MotionContext = Object(external_React_["createContext"])({}); 4238 function useVisualElementContext() { 4239 return Object(external_React_["useContext"])(MotionContext).visualElement; 4240 } 4241 4242 4243 4244 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/PresenceContext.js 4245 4246 4247 /** 4248 * @public 4249 */ 4250 var PresenceContext = Object(external_React_["createContext"])(null); 4251 4252 4253 4254 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-constant.js 4255 4256 4257 /** 4258 * Creates a constant value over the lifecycle of a component. 4259 * 4260 * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer 4261 * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` 4262 * you can ensure that initialisers don't execute twice or more. 4263 */ 4264 function useConstant(init) { 4265 var ref = Object(external_React_["useRef"])(null); 4266 if (ref.current === null) { 4267 ref.current = init(); 4268 } 4269 return ref.current; 4270 } 4271 4272 4273 4274 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js 4275 4276 4277 4278 4279 /** 4280 * When a component is the child of `AnimatePresence`, it can use `usePresence` 4281 * to access information about whether it's still present in the React tree. 4282 * 4283 * ```jsx 4284 * import { usePresence } from "framer-motion" 4285 * 4286 * export const Component = () => { 4287 * const [isPresent, safeToRemove] = usePresence() 4288 * 4289 * useEffect(() => { 4290 * !isPresent && setTimeout(safeToRemove, 1000) 4291 * }, [isPresent]) 4292 * 4293 * return <div /> 4294 * } 4295 * ``` 4296 * 4297 * If `isPresent` is `false`, it means that a component has been removed the tree, but 4298 * `AnimatePresence` won't really remove it until `safeToRemove` has been called. 4299 * 4300 * @public 4301 */ 4302 function usePresence() { 4303 var context = Object(external_React_["useContext"])(PresenceContext); 4304 if (context === null) 4305 return [true, null]; 4306 var isPresent = context.isPresent, onExitComplete = context.onExitComplete, register = context.register; 4307 // It's safe to call the following hooks conditionally (after an early return) because the context will always 4308 // either be null or non-null for the lifespan of the component. 4309 // Replace with useOpaqueId when released in React 4310 var id = useUniqueId(); 4311 Object(external_React_["useEffect"])(function () { return register(id); }, []); 4312 var safeToRemove = function () { return onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(id); }; 4313 return !isPresent && onExitComplete ? [false, safeToRemove] : [true]; 4314 } 4315 /** 4316 * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present. 4317 * There is no `safeToRemove` function. 4318 * 4319 * ```jsx 4320 * import { useIsPresent } from "framer-motion" 4321 * 4322 * export const Component = () => { 4323 * const isPresent = useIsPresent() 4324 * 4325 * useEffect(() => { 4326 * !isPresent && console.log("I've been removed!") 4327 * }, [isPresent]) 4328 * 4329 * return <div /> 4330 * } 4331 * ``` 4332 * 4333 * @public 4334 */ 4335 function useIsPresent() { 4336 return use_presence_isPresent(Object(external_React_["useContext"])(PresenceContext)); 4337 } 4338 function use_presence_isPresent(context) { 4339 return context === null ? true : context.isPresent; 4340 } 4341 var counter = 0; 4342 var incrementId = function () { return counter++; }; 4343 var useUniqueId = function () { return useConstant(incrementId); }; 4344 4345 4346 4347 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/LayoutGroupContext.js 4348 4349 4350 /** 4351 * @internal 4352 */ 4353 var LayoutGroupContext = Object(external_React_["createContext"])(null); 4354 4355 4356 4357 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-browser.js 4358 var isBrowser = typeof window !== "undefined"; 4359 4360 4361 4362 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js 4363 4364 4365 4366 var useIsomorphicLayoutEffect = isBrowser ? external_React_["useLayoutEffect"] : external_React_["useEffect"]; 4367 4368 4369 4370 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 function useLayoutId(_a) { 4382 var layoutId = _a.layoutId; 4383 var layoutGroupId = Object(external_React_["useContext"])(LayoutGroupContext); 4384 return layoutGroupId && layoutId !== undefined 4385 ? layoutGroupId + "-" + layoutId 4386 : layoutId; 4387 } 4388 function useVisualElement(Component, visualState, props, createVisualElement) { 4389 var config = Object(external_React_["useContext"])(MotionConfigContext); 4390 var lazyContext = Object(external_React_["useContext"])(LazyContext); 4391 var parent = useVisualElementContext(); 4392 var presenceContext = Object(external_React_["useContext"])(PresenceContext); 4393 var layoutId = useLayoutId(props); 4394 var visualElementRef = Object(external_React_["useRef"])(undefined); 4395 /** 4396 * If we haven't preloaded a renderer, check to see if we have one lazy-loaded 4397 */ 4398 if (!createVisualElement) 4399 createVisualElement = lazyContext.renderer; 4400 if (!visualElementRef.current && createVisualElement) { 4401 visualElementRef.current = createVisualElement(Component, { 4402 visualState: visualState, 4403 parent: parent, 4404 props: __assign(__assign({}, props), { layoutId: layoutId }), 4405 presenceId: presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.id, 4406 blockInitialAnimation: (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.initial) === false, 4407 }); 4408 } 4409 var visualElement = visualElementRef.current; 4410 useIsomorphicLayoutEffect(function () { 4411 if (!visualElement) 4412 return; 4413 visualElement.setProps(__assign(__assign(__assign({}, config), props), { layoutId: layoutId })); 4414 visualElement.isPresent = use_presence_isPresent(presenceContext); 4415 visualElement.isPresenceRoot = 4416 !parent || parent.presenceId !== (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.id); 4417 /** 4418 * Fire a render to ensure the latest state is reflected on-screen. 4419 */ 4420 visualElement.syncRender(); 4421 }); 4422 Object(external_React_["useEffect"])(function () { 4423 var _a; 4424 if (!visualElement) 4425 return; 4426 /** 4427 * In a future refactor we can replace the features-as-components and 4428 * have this loop through them all firing "effect" listeners 4429 */ 4430 (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.animateChanges(); 4431 }); 4432 useIsomorphicLayoutEffect(function () { return function () { return visualElement === null || visualElement === void 0 ? void 0 : visualElement.notifyUnmount(); }; }, []); 4433 return visualElement; 4434 } 4435 4436 4437 4438 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-ref-object.js 4439 function isRefObject(ref) { 4440 return (typeof ref === "object" && 4441 Object.prototype.hasOwnProperty.call(ref, "current")); 4442 } 4443 4444 4445 4446 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js 4447 4448 4449 4450 /** 4451 * Creates a ref function that, when called, hydrates the provided 4452 * external ref and VisualElement. 4453 */ 4454 function useMotionRef(visualState, visualElement, externalRef) { 4455 return Object(external_React_["useCallback"])(function (instance) { 4456 var _a; 4457 instance && ((_a = visualState.mount) === null || _a === void 0 ? void 0 : _a.call(visualState, instance)); 4458 if (visualElement) { 4459 instance 4460 ? visualElement.mount(instance) 4461 : visualElement.unmount(); 4462 } 4463 if (externalRef) { 4464 if (typeof externalRef === "function") { 4465 externalRef(instance); 4466 } 4467 else if (isRefObject(externalRef)) { 4468 externalRef.current = instance; 4469 } 4470 } 4471 }, 4472 /** 4473 * Only pass a new ref callback to React if we've received a visual element 4474 * factory. Otherwise we'll be mounting/remounting every time externalRef 4475 * or other dependencies change. 4476 */ 4477 [visualElement]); 4478 } 4479 4480 4481 4482 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/variants.js 4483 /** 4484 * Decides if the supplied variable is an array of variant labels 4485 */ 4486 function isVariantLabels(v) { 4487 return Array.isArray(v); 4488 } 4489 /** 4490 * Decides if the supplied variable is variant label 4491 */ 4492 function isVariantLabel(v) { 4493 return typeof v === "string" || isVariantLabels(v); 4494 } 4495 /** 4496 * Creates an object containing the latest state of every MotionValue on a VisualElement 4497 */ 4498 function getCurrent(visualElement) { 4499 var current = {}; 4500 visualElement.forEachValue(function (value, key) { return (current[key] = value.get()); }); 4501 return current; 4502 } 4503 /** 4504 * Creates an object containing the latest velocity of every MotionValue on a VisualElement 4505 */ 4506 function getVelocity(visualElement) { 4507 var velocity = {}; 4508 visualElement.forEachValue(function (value, key) { return (velocity[key] = value.getVelocity()); }); 4509 return velocity; 4510 } 4511 function resolveVariantFromProps(props, definition, custom, currentValues, currentVelocity) { 4512 var _a; 4513 if (currentValues === void 0) { currentValues = {}; } 4514 if (currentVelocity === void 0) { currentVelocity = {}; } 4515 if (typeof definition === "string") { 4516 definition = (_a = props.variants) === null || _a === void 0 ? void 0 : _a[definition]; 4517 } 4518 return typeof definition === "function" 4519 ? definition(custom !== null && custom !== void 0 ? custom : props.custom, currentValues, currentVelocity) 4520 : definition; 4521 } 4522 function resolveVariant(visualElement, definition, custom) { 4523 var props = visualElement.getProps(); 4524 return resolveVariantFromProps(props, definition, custom !== null && custom !== void 0 ? custom : props.custom, getCurrent(visualElement), getVelocity(visualElement)); 4525 } 4526 function checkIfControllingVariants(props) { 4527 var _a; 4528 return (typeof ((_a = props.animate) === null || _a === void 0 ? void 0 : _a.start) === "function" || 4529 isVariantLabel(props.initial) || 4530 isVariantLabel(props.animate) || 4531 isVariantLabel(props.whileHover) || 4532 isVariantLabel(props.whileDrag) || 4533 isVariantLabel(props.whileTap) || 4534 isVariantLabel(props.whileFocus) || 4535 isVariantLabel(props.exit)); 4536 } 4537 function checkIfVariantNode(props) { 4538 return Boolean(checkIfControllingVariants(props) || props.variants); 4539 } 4540 4541 4542 4543 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionContext/utils.js 4544 4545 4546 function getCurrentTreeVariants(props, context) { 4547 if (checkIfControllingVariants(props)) { 4548 var initial = props.initial, animate = props.animate; 4549 return { 4550 initial: initial === false || isVariantLabel(initial) 4551 ? initial 4552 : undefined, 4553 animate: isVariantLabel(animate) ? animate : undefined, 4554 }; 4555 } 4556 return props.inherit !== false ? context : {}; 4557 } 4558 4559 4560 4561 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionContext/create.js 4562 4563 4564 4565 4566 function useCreateMotionContext(props, isStatic) { 4567 var _a = getCurrentTreeVariants(props, Object(external_React_["useContext"])(MotionContext)), initial = _a.initial, animate = _a.animate; 4568 return Object(external_React_["useMemo"])(function () { return ({ initial: initial, animate: animate }); }, 4569 /** 4570 * Only break memoisation in static mode 4571 */ 4572 isStatic 4573 ? [ 4574 variantLabelsAsDependency(initial), 4575 variantLabelsAsDependency(animate), 4576 ] 4577 : []); 4578 } 4579 function variantLabelsAsDependency(prop) { 4580 return Array.isArray(prop) ? prop.join(" ") : prop; 4581 } 4582 4583 4584 4585 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/index.js 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 /** 4598 * Create a `motion` component. 4599 * 4600 * This function accepts a Component argument, which can be either a string (ie "div" 4601 * for `motion.div`), or an actual React component. 4602 * 4603 * Alongside this is a config option which provides a way of rendering the provided 4604 * component "offline", or outside the React render cycle. 4605 * 4606 * @internal 4607 */ 4608 function createMotionComponent(_a) { 4609 var preloadedFeatures = _a.preloadedFeatures, createVisualElement = _a.createVisualElement, useRender = _a.useRender, useVisualState = _a.useVisualState, Component = _a.Component; 4610 preloadedFeatures && loadFeatures(preloadedFeatures); 4611 function MotionComponent(props, externalRef) { 4612 /** 4613 * If we're rendering in a static environment, we only visually update the component 4614 * as a result of a React-rerender rather than interactions or animations. This 4615 * means we don't need to load additional memory structures like VisualElement, 4616 * or any gesture/animation features. 4617 */ 4618 var isStatic = Object(external_React_["useContext"])(MotionConfigContext).isStatic; 4619 var features = null; 4620 /** 4621 * Create the tree context. This is memoized and will only trigger renders 4622 * when the current tree variant changes in static mode. 4623 */ 4624 var context = useCreateMotionContext(props, isStatic); 4625 /** 4626 * 4627 */ 4628 var visualState = useVisualState(props, isStatic); 4629 if (!isStatic && isBrowser) { 4630 /** 4631 * Create a VisualElement for this component. A VisualElement provides a common 4632 * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as 4633 * providing a way of rendering to these APIs outside of the React render loop 4634 * for more performant animations and interactions 4635 */ 4636 context.visualElement = useVisualElement(Component, visualState, props, createVisualElement); 4637 /** 4638 * Load Motion gesture and animation features. These are rendered as renderless 4639 * components so each feature can optionally make use of React lifecycle methods. 4640 * 4641 * TODO: The intention is to move these away from a React-centric to a 4642 * VisualElement-centric lifecycle scheme. 4643 */ 4644 features = useFeatures(props, context.visualElement, preloadedFeatures); 4645 } 4646 /** 4647 * The mount order and hierarchy is specific to ensure our element ref 4648 * is hydrated by the time features fire their effects. 4649 */ 4650 return (external_React_["createElement"](external_React_["Fragment"], null, 4651 external_React_["createElement"](MotionContext.Provider, { value: context }, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic)), 4652 features)); 4653 } 4654 return Object(external_React_["forwardRef"])(MotionComponent); 4655 } 4656 4657 4658 4659 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/motion-proxy.js 4660 4661 4662 /** 4663 * Convert any React component into a `motion` component. The provided component 4664 * **must** use `React.forwardRef` to the underlying DOM component you want to animate. 4665 * 4666 * ```jsx 4667 * const Component = React.forwardRef((props, ref) => { 4668 * return <div ref={ref} /> 4669 * }) 4670 * 4671 * const MotionComponent = motion(Component) 4672 * ``` 4673 * 4674 * @public 4675 */ 4676 function createMotionProxy(createConfig) { 4677 function custom(Component, customMotionComponentConfig) { 4678 if (customMotionComponentConfig === void 0) { customMotionComponentConfig = {}; } 4679 return createMotionComponent(createConfig(Component, customMotionComponentConfig)); 4680 } 4681 /** 4682 * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc. 4683 * Rather than generating them anew every render. 4684 */ 4685 var componentCache = new Map(); 4686 return new Proxy(custom, { 4687 /** 4688 * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc. 4689 * The prop name is passed through as `key` and we can use that to generate a `motion` 4690 * DOM component with that name. 4691 */ 4692 get: function (_target, key) { 4693 /** 4694 * If this element doesn't exist in the component cache, create it and cache. 4695 */ 4696 if (!componentCache.has(key)) { 4697 componentCache.set(key, custom(key)); 4698 } 4699 return componentCache.get(key); 4700 }, 4701 }); 4702 } 4703 4704 4705 4706 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js 4707 /** 4708 * We keep these listed seperately as we use the lowercase tag names as part 4709 * of the runtime bundle to detect SVG components 4710 */ 4711 var lowercaseSVGElements = [ 4712 "animate", 4713 "circle", 4714 "defs", 4715 "desc", 4716 "ellipse", 4717 "g", 4718 "image", 4719 "line", 4720 "filter", 4721 "marker", 4722 "mask", 4723 "metadata", 4724 "path", 4725 "pattern", 4726 "polygon", 4727 "polyline", 4728 "rect", 4729 "stop", 4730 "svg", 4731 "switch", 4732 "symbol", 4733 "text", 4734 "tspan", 4735 "use", 4736 "view", 4737 ]; 4738 4739 4740 4741 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js 4742 4743 4744 function isSVGComponent(Component) { 4745 if ( 4746 /** 4747 * If it's not a string, it's a custom React component. Currently we only support 4748 * HTML custom React components. 4749 */ 4750 typeof Component !== "string" || 4751 /** 4752 * If it contains a dash, the element is a custom HTML webcomponent. 4753 */ 4754 Component.includes("-")) { 4755 return false; 4756 } 4757 else if ( 4758 /** 4759 * If it's in our list of lowercase SVG tags, it's an SVG component 4760 */ 4761 lowercaseSVGElements.indexOf(Component) > -1 || 4762 /** 4763 * If it contains a capital letter, it's an SVG component 4764 */ 4765 /[A-Z]/.test(Component)) { 4766 return true; 4767 } 4768 return false; 4769 } 4770 4771 4772 4773 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/projection/scale-correction.js 4774 var valueScaleCorrection = {}; 4775 /** 4776 * @internal 4777 */ 4778 function addScaleCorrection(correctors) { 4779 for (var key in correctors) { 4780 valueScaleCorrection[key] = correctors[key]; 4781 } 4782 } 4783 4784 4785 4786 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/transform.js 4787 /** 4788 * A list of all transformable axes. We'll use this list to generated a version 4789 * of each axes for each transform. 4790 */ 4791 var transformAxes = ["", "X", "Y", "Z"]; 4792 /** 4793 * An ordered array of each transformable value. By default, transform values 4794 * will be sorted to this order. 4795 */ 4796 var transform_order = ["translate", "scale", "rotate", "skew"]; 4797 /** 4798 * Generate a list of every possible transform key. 4799 */ 4800 var transformProps = ["transformPerspective", "x", "y", "z"]; 4801 transform_order.forEach(function (operationKey) { 4802 return transformAxes.forEach(function (axesKey) { 4803 return transformProps.push(operationKey + axesKey); 4804 }); 4805 }); 4806 /** 4807 * A function to use with Array.sort to sort transform keys by their default order. 4808 */ 4809 function sortTransformProps(a, b) { 4810 return transformProps.indexOf(a) - transformProps.indexOf(b); 4811 } 4812 /** 4813 * A quick lookup for transform props. 4814 */ 4815 var transformPropSet = new Set(transformProps); 4816 function isTransformProp(key) { 4817 return transformPropSet.has(key); 4818 } 4819 /** 4820 * A quick lookup for transform origin props 4821 */ 4822 var transformOriginProps = new Set(["originX", "originY", "originZ"]); 4823 function isTransformOriginProp(key) { 4824 return transformOriginProps.has(key); 4825 } 4826 4827 4828 4829 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.js 4830 4831 4832 4833 function isForcedMotionValue(key, _a) { 4834 var layout = _a.layout, layoutId = _a.layoutId; 4835 return (isTransformProp(key) || 4836 isTransformOriginProp(key) || 4837 ((layout || layoutId !== undefined) && 4838 (!!valueScaleCorrection[key] || key === "opacity"))); 4839 } 4840 4841 4842 4843 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/utils/is-motion-value.js 4844 var isMotionValue = function (value) { 4845 return value !== null && typeof value === "object" && value.getVelocity; 4846 }; 4847 4848 4849 4850 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/build-transform.js 4851 4852 4853 var translateAlias = { 4854 x: "translateX", 4855 y: "translateY", 4856 z: "translateZ", 4857 transformPerspective: "perspective", 4858 }; 4859 /** 4860 * Build a CSS transform style from individual x/y/scale etc properties. 4861 * 4862 * This outputs with a default order of transforms/scales/rotations, this can be customised by 4863 * providing a transformTemplate function. 4864 */ 4865 function buildTransform(_a, _b, transformIsDefault, transformTemplate) { 4866 var transform = _a.transform, transformKeys = _a.transformKeys; 4867 var _c = _b.enableHardwareAcceleration, enableHardwareAcceleration = _c === void 0 ? true : _c, _d = _b.allowTransformNone, allowTransformNone = _d === void 0 ? true : _d; 4868 // The transform string we're going to build into. 4869 var transformString = ""; 4870 // Transform keys into their default order - this will determine the output order. 4871 transformKeys.sort(sortTransformProps); 4872 // Track whether the defined transform has a defined z so we don't add a 4873 // second to enable hardware acceleration 4874 var transformHasZ = false; 4875 // Loop over each transform and build them into transformString 4876 var numTransformKeys = transformKeys.length; 4877 for (var i = 0; i < numTransformKeys; i++) { 4878 var key = transformKeys[i]; 4879 transformString += (translateAlias[key] || key) + "(" + transform[key] + ") "; 4880 if (key === "z") 4881 transformHasZ = true; 4882 } 4883 if (!transformHasZ && enableHardwareAcceleration) { 4884 transformString += "translateZ(0)"; 4885 } 4886 else { 4887 transformString = transformString.trim(); 4888 } 4889 // If we have a custom `transform` template, pass our transform values and 4890 // generated transformString to that before returning 4891 if (transformTemplate) { 4892 transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); 4893 } 4894 else if (allowTransformNone && transformIsDefault) { 4895 transformString = "none"; 4896 } 4897 return transformString; 4898 } 4899 /** 4900 * Build a transformOrigin style. Uses the same defaults as the browser for 4901 * undefined origins. 4902 */ 4903 function buildTransformOrigin(_a) { 4904 var _b = _a.originX, originX = _b === void 0 ? "50%" : _b, _c = _a.originY, originY = _c === void 0 ? "50%" : _c, _d = _a.originZ, originZ = _d === void 0 ? 0 : _d; 4905 return originX + " " + originY + " " + originZ; 4906 } 4907 4908 4909 4910 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.js 4911 /** 4912 * Returns true if the provided key is a CSS variable 4913 */ 4914 function isCSSVariable(key) { 4915 return key.startsWith("--"); 4916 } 4917 4918 4919 4920 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.js 4921 /** 4922 * Provided a value and a ValueType, returns the value as that value type. 4923 */ 4924 var getValueAsType = function (value, type) { 4925 return type && typeof value === "number" 4926 ? type.transform(value) 4927 : value; 4928 }; 4929 4930 4931 4932 // CONCATENATED MODULE: ./node_modules/style-value-types/node_modules/tslib/tslib.es6.js 4933 /*! ***************************************************************************** 4934 Copyright (c) Microsoft Corporation. 4935 4936 Permission to use, copy, modify, and/or distribute this software for any 4937 purpose with or without fee is hereby granted. 4938 4939 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 4940 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 4941 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 4942 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 4943 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 4944 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 4945 PERFORMANCE OF THIS SOFTWARE. 4946 ***************************************************************************** */ 4947 /* global Reflect, Promise */ 4948 4949 var tslib_es6_extendStatics = function(d, b) { 4950 tslib_es6_extendStatics = Object.setPrototypeOf || 4951 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 4952 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; 4953 return tslib_es6_extendStatics(d, b); 4954 }; 4955 4956 function tslib_es6_extends(d, b) { 4957 if (typeof b !== "function" && b !== null) 4958 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); 4959 tslib_es6_extendStatics(d, b); 4960 function __() { this.constructor = d; } 4961 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 4962 } 4963 4964 var tslib_es6_assign = function() { 4965 tslib_es6_assign = Object.assign || function __assign(t) { 4966 for (var s, i = 1, n = arguments.length; i < n; i++) { 4967 s = arguments[i]; 4968 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 4969 } 4970 return t; 4971 } 4972 return tslib_es6_assign.apply(this, arguments); 4973 } 4974 4975 function tslib_es6_rest(s, e) { 4976 var t = {}; 4977 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 4978 t[p] = s[p]; 4979 if (s != null && typeof Object.getOwnPropertySymbols === "function") 4980 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 4981 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 4982 t[p[i]] = s[p[i]]; 4983 } 4984 return t; 4985 } 4986 4987 function tslib_es6_decorate(decorators, target, key, desc) { 4988 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 4989 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 4990 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; 4991 return c > 3 && r && Object.defineProperty(target, key, r), r; 4992 } 4993 4994 function tslib_es6_param(paramIndex, decorator) { 4995 return function (target, key) { decorator(target, key, paramIndex); } 4996 } 4997 4998 function tslib_es6_metadata(metadataKey, metadataValue) { 4999 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); 5000 } 5001 5002 function tslib_es6_awaiter(thisArg, _arguments, P, generator) { 5003 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 5004 return new (P || (P = Promise))(function (resolve, reject) { 5005 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 5006 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 5007 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 5008 step((generator = generator.apply(thisArg, _arguments || [])).next()); 5009 }); 5010 } 5011 5012 function tslib_es6_generator(thisArg, body) { 5013 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 5014 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 5015 function verb(n) { return function (v) { return step([n, v]); }; } 5016 function step(op) { 5017 if (f) throw new TypeError("Generator is already executing."); 5018 while (_) try { 5019 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; 5020 if (y = 0, t) op = [op[0] & 2, t.value]; 5021 switch (op[0]) { 5022 case 0: case 1: t = op; break; 5023 case 4: _.label++; return { value: op[1], done: false }; 5024 case 5: _.label++; y = op[1]; op = [0]; continue; 5025 case 7: op = _.ops.pop(); _.trys.pop(); continue; 5026 default: 5027 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 5028 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 5029 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 5030 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 5031 if (t[2]) _.ops.pop(); 5032 _.trys.pop(); continue; 5033 } 5034 op = body.call(thisArg, _); 5035 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 5036 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 5037 } 5038 } 5039 5040 var tslib_es6_createBinding = Object.create ? (function(o, m, k, k2) { 5041 if (k2 === undefined) k2 = k; 5042 Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); 5043 }) : (function(o, m, k, k2) { 5044 if (k2 === undefined) k2 = k; 5045 o[k2] = m[k]; 5046 }); 5047 5048 function tslib_es6_exportStar(m, o) { 5049 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) tslib_es6_createBinding(o, m, p); 5050 } 5051 5052 function tslib_es6_values(o) { 5053 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; 5054 if (m) return m.call(o); 5055 if (o && typeof o.length === "number") return { 5056 next: function () { 5057 if (o && i >= o.length) o = void 0; 5058 return { value: o && o[i++], done: !o }; 5059 } 5060 }; 5061 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); 5062 } 5063 5064 function tslib_es6_read(o, n) { 5065 var m = typeof Symbol === "function" && o[Symbol.iterator]; 5066 if (!m) return o; 5067 var i = m.call(o), r, ar = [], e; 5068 try { 5069 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 5070 } 5071 catch (error) { e = { error: error }; } 5072 finally { 5073 try { 5074 if (r && !r.done && (m = i["return"])) m.call(i); 5075 } 5076 finally { if (e) throw e.error; } 5077 } 5078 return ar; 5079 } 5080 5081 /** @deprecated */ 5082 function tslib_es6_spread() { 5083 for (var ar = [], i = 0; i < arguments.length; i++) 5084 ar = ar.concat(tslib_es6_read(arguments[i])); 5085 return ar; 5086 } 5087 5088 /** @deprecated */ 5089 function tslib_es6_spreadArrays() { 5090 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 5091 for (var r = Array(s), k = 0, i = 0; i < il; i++) 5092 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 5093 r[k] = a[j]; 5094 return r; 5095 } 5096 5097 function tslib_es6_spreadArray(to, from, pack) { 5098 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { 5099 if (ar || !(i in from)) { 5100 if (!ar) ar = Array.prototype.slice.call(from, 0, i); 5101 ar[i] = from[i]; 5102 } 5103 } 5104 return to.concat(ar || Array.prototype.slice.call(from)); 5105 } 5106 5107 function tslib_es6_await(v) { 5108 return this instanceof tslib_es6_await ? (this.v = v, this) : new tslib_es6_await(v); 5109 } 5110 5111 function tslib_es6_asyncGenerator(thisArg, _arguments, generator) { 5112 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 5113 var g = generator.apply(thisArg, _arguments || []), i, q = []; 5114 return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; 5115 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); }); }; } 5116 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } 5117 function step(r) { r.value instanceof tslib_es6_await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } 5118 function fulfill(value) { resume("next", value); } 5119 function reject(value) { resume("throw", value); } 5120 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } 5121 } 5122 5123 function tslib_es6_asyncDelegator(o) { 5124 var i, p; 5125 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 5126 function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: tslib_es6_await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } 5127 } 5128 5129 function tslib_es6_asyncValues(o) { 5130 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 5131 var m = o[Symbol.asyncIterator], i; 5132 return m ? m.call(o) : (o = typeof tslib_es6_values === "function" ? tslib_es6_values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); 5133 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); }); }; } 5134 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } 5135 } 5136 5137 function tslib_es6_makeTemplateObject(cooked, raw) { 5138 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 5139 return cooked; 5140 }; 5141 5142 var tslib_es6_setModuleDefault = Object.create ? (function(o, v) { 5143 Object.defineProperty(o, "default", { enumerable: true, value: v }); 5144 }) : function(o, v) { 5145 o["default"] = v; 5146 }; 5147 5148 function tslib_es6_importStar(mod) { 5149 if (mod && mod.__esModule) return mod; 5150 var result = {}; 5151 if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) tslib_es6_createBinding(result, mod, k); 5152 tslib_es6_setModuleDefault(result, mod); 5153 return result; 5154 } 5155 5156 function tslib_es6_importDefault(mod) { 5157 return (mod && mod.__esModule) ? mod : { default: mod }; 5158 } 5159 5160 function tslib_es6_classPrivateFieldGet(receiver, state, kind, f) { 5161 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); 5162 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); 5163 return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); 5164 } 5165 5166 function tslib_es6_classPrivateFieldSet(receiver, state, value, kind, f) { 5167 if (kind === "m") throw new TypeError("Private method is not writable"); 5168 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); 5169 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); 5170 return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; 5171 } 5172 5173 // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/utils.js 5174 var clamp = function (min, max) { return function (v) { 5175 return Math.max(Math.min(v, max), min); 5176 }; }; 5177 var sanitize = function (v) { return (v % 1 ? Number(v.toFixed(5)) : v); }; 5178 var floatRegex = /(-)?([\d]*\.?[\d])+/g; 5179 var colorRegex = /(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi; 5180 var singleColorRegex = /^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i; 5181 function isString(v) { 5182 return typeof v === 'string'; 5183 } 5184 5185 5186 5187 // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/numbers/units.js 5188 5189 5190 5191 var createUnitType = function (unit) { return ({ 5192 test: function (v) { 5193 return isString(v) && v.endsWith(unit) && v.split(' ').length === 1; 5194 }, 5195 parse: parseFloat, 5196 transform: function (v) { return "" + v + unit; }, 5197 }); }; 5198 var degrees = createUnitType('deg'); 5199 var percent = createUnitType('%'); 5200 var px = createUnitType('px'); 5201 var vh = createUnitType('vh'); 5202 var vw = createUnitType('vw'); 5203 var progressPercentage = tslib_es6_assign(tslib_es6_assign({}, percent), { parse: function (v) { return percent.parse(v) / 100; }, transform: function (v) { return percent.transform(v * 100); } }); 5204 5205 5206 5207 // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/numbers/index.js 5208 5209 5210 5211 var numbers_number = { 5212 test: function (v) { return typeof v === 'number'; }, 5213 parse: parseFloat, 5214 transform: function (v) { return v; }, 5215 }; 5216 var numbers_alpha = tslib_es6_assign(tslib_es6_assign({}, numbers_number), { transform: clamp(0, 1) }); 5217 var numbers_scale = tslib_es6_assign(tslib_es6_assign({}, numbers_number), { default: 1 }); 5218 5219 5220 5221 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/type-int.js 5222 5223 5224 5225 var type_int_int = __assign(__assign({}, numbers_number), { transform: Math.round }); 5226 5227 5228 5229 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/number.js 5230 5231 5232 5233 var numberValueTypes = { 5234 // Border props 5235 borderWidth: px, 5236 borderTopWidth: px, 5237 borderRightWidth: px, 5238 borderBottomWidth: px, 5239 borderLeftWidth: px, 5240 borderRadius: px, 5241 radius: px, 5242 borderTopLeftRadius: px, 5243 borderTopRightRadius: px, 5244 borderBottomRightRadius: px, 5245 borderBottomLeftRadius: px, 5246 // Positioning props 5247 width: px, 5248 maxWidth: px, 5249 height: px, 5250 maxHeight: px, 5251 size: px, 5252 top: px, 5253 right: px, 5254 bottom: px, 5255 left: px, 5256 // Spacing props 5257 padding: px, 5258 paddingTop: px, 5259 paddingRight: px, 5260 paddingBottom: px, 5261 paddingLeft: px, 5262 margin: px, 5263 marginTop: px, 5264 marginRight: px, 5265 marginBottom: px, 5266 marginLeft: px, 5267 // Transform props 5268 rotate: degrees, 5269 rotateX: degrees, 5270 rotateY: degrees, 5271 rotateZ: degrees, 5272 scale: numbers_scale, 5273 scaleX: numbers_scale, 5274 scaleY: numbers_scale, 5275 scaleZ: numbers_scale, 5276 skew: degrees, 5277 skewX: degrees, 5278 skewY: degrees, 5279 distance: px, 5280 translateX: px, 5281 translateY: px, 5282 translateZ: px, 5283 x: px, 5284 y: px, 5285 z: px, 5286 perspective: px, 5287 transformPerspective: px, 5288 opacity: numbers_alpha, 5289 originX: progressPercentage, 5290 originY: progressPercentage, 5291 originZ: px, 5292 // Misc 5293 zIndex: type_int_int, 5294 // SVG 5295 fillOpacity: numbers_alpha, 5296 strokeOpacity: numbers_alpha, 5297 numOctaves: type_int_int, 5298 }; 5299 5300 5301 5302 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/build-styles.js 5303 5304 5305 5306 5307 5308 5309 5310 function buildHTMLStyles(state, latestValues, projection, layoutState, options, transformTemplate, buildProjectionTransform, buildProjectionTransformOrigin) { 5311 var _a; 5312 var style = state.style, vars = state.vars, transform = state.transform, transformKeys = state.transformKeys, transformOrigin = state.transformOrigin; 5313 // Empty the transformKeys array. As we're throwing out refs to its items 5314 // this might not be as cheap as suspected. Maybe using the array as a buffer 5315 // with a manual incrementation would be better. 5316 transformKeys.length = 0; 5317 // Track whether we encounter any transform or transformOrigin values. 5318 var hasTransform = false; 5319 var hasTransformOrigin = false; 5320 // Does the calculated transform essentially equal "none"? 5321 var transformIsNone = true; 5322 /** 5323 * Loop over all our latest animated values and decide whether to handle them 5324 * as a style or CSS variable. 5325 * 5326 * Transforms and transform origins are kept seperately for further processing. 5327 */ 5328 for (var key in latestValues) { 5329 var value = latestValues[key]; 5330 /** 5331 * If this is a CSS variable we don't do any further processing. 5332 */ 5333 if (isCSSVariable(key)) { 5334 vars[key] = value; 5335 continue; 5336 } 5337 // Convert the value to its default value type, ie 0 -> "0px" 5338 var valueType = numberValueTypes[key]; 5339 var valueAsType = getValueAsType(value, valueType); 5340 if (isTransformProp(key)) { 5341 // If this is a transform, flag to enable further transform processing 5342 hasTransform = true; 5343 transform[key] = valueAsType; 5344 transformKeys.push(key); 5345 // If we already know we have a non-default transform, early return 5346 if (!transformIsNone) 5347 continue; 5348 // Otherwise check to see if this is a default transform 5349 if (value !== ((_a = valueType.default) !== null && _a !== void 0 ? _a : 0)) 5350 transformIsNone = false; 5351 } 5352 else if (isTransformOriginProp(key)) { 5353 transformOrigin[key] = valueAsType; 5354 // If this is a transform origin, flag and enable further transform-origin processing 5355 hasTransformOrigin = true; 5356 } 5357 else { 5358 /** 5359 * If layout projection is on, and we need to perform scale correction for this 5360 * value type, perform it. 5361 */ 5362 if ((projection === null || projection === void 0 ? void 0 : projection.isHydrated) && 5363 (layoutState === null || layoutState === void 0 ? void 0 : layoutState.isHydrated) && 5364 valueScaleCorrection[key]) { 5365 var correctedValue = valueScaleCorrection[key].process(value, layoutState, projection); 5366 /** 5367 * Scale-correctable values can define a number of other values to break 5368 * down into. For instance borderRadius needs applying to borderBottomLeftRadius etc 5369 */ 5370 var applyTo = valueScaleCorrection[key].applyTo; 5371 if (applyTo) { 5372 var num = applyTo.length; 5373 for (var i = 0; i < num; i++) { 5374 style[applyTo[i]] = correctedValue; 5375 } 5376 } 5377 else { 5378 style[key] = correctedValue; 5379 } 5380 } 5381 else { 5382 style[key] = valueAsType; 5383 } 5384 } 5385 } 5386 if (layoutState && 5387 projection && 5388 buildProjectionTransform && 5389 buildProjectionTransformOrigin) { 5390 style.transform = buildProjectionTransform(layoutState.deltaFinal, layoutState.treeScale, hasTransform ? transform : undefined); 5391 if (transformTemplate) { 5392 style.transform = transformTemplate(transform, style.transform); 5393 } 5394 style.transformOrigin = buildProjectionTransformOrigin(layoutState); 5395 } 5396 else { 5397 if (hasTransform) { 5398 style.transform = buildTransform(state, options, transformIsNone, transformTemplate); 5399 } 5400 if (hasTransformOrigin) { 5401 style.transformOrigin = buildTransformOrigin(transformOrigin); 5402 } 5403 } 5404 } 5405 5406 5407 5408 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js 5409 var createHtmlRenderState = function () { return ({ 5410 style: {}, 5411 transform: {}, 5412 transformKeys: [], 5413 transformOrigin: {}, 5414 vars: {}, 5415 }); }; 5416 5417 5418 5419 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/use-props.js 5420 5421 5422 5423 5424 5425 5426 5427 function copyRawValuesOnly(target, source, props) { 5428 for (var key in source) { 5429 if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) { 5430 target[key] = source[key]; 5431 } 5432 } 5433 } 5434 function useInitialMotionValues(_a, visualState, isStatic) { 5435 var transformTemplate = _a.transformTemplate; 5436 return Object(external_React_["useMemo"])(function () { 5437 var state = createHtmlRenderState(); 5438 buildHTMLStyles(state, visualState, undefined, undefined, { enableHardwareAcceleration: !isStatic }, transformTemplate); 5439 var vars = state.vars, style = state.style; 5440 return __assign(__assign({}, vars), style); 5441 }, [visualState]); 5442 } 5443 function useStyle(props, visualState, isStatic) { 5444 var styleProp = props.style || {}; 5445 var style = {}; 5446 /** 5447 * Copy non-Motion Values straight into style 5448 */ 5449 copyRawValuesOnly(style, styleProp, props); 5450 Object.assign(style, useInitialMotionValues(props, visualState, isStatic)); 5451 if (props.transformValues) { 5452 style = props.transformValues(style); 5453 } 5454 return style; 5455 } 5456 function useHTMLProps(props, visualState, isStatic) { 5457 // The `any` isn't ideal but it is the type of createElement props argument 5458 var htmlProps = {}; 5459 var style = useStyle(props, visualState, isStatic); 5460 if (Boolean(props.drag)) { 5461 // Disable the ghost element when a user drags 5462 htmlProps.draggable = false; 5463 // Disable text selection 5464 style.userSelect = style.WebkitUserSelect = style.WebkitTouchCallout = 5465 "none"; 5466 // Disable scrolling on the draggable direction 5467 style.touchAction = 5468 props.drag === true 5469 ? "none" 5470 : "pan-" + (props.drag === "x" ? "y" : "x"); 5471 } 5472 htmlProps.style = style; 5473 return htmlProps; 5474 } 5475 5476 5477 5478 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/valid-prop.js 5479 /** 5480 * A list of all valid MotionProps. 5481 * 5482 * @internalremarks 5483 * This doesn't throw if a `MotionProp` name is missing - it should. 5484 */ 5485 var validMotionProps = new Set([ 5486 "initial", 5487 "animate", 5488 "exit", 5489 "style", 5490 "variants", 5491 "transition", 5492 "transformTemplate", 5493 "transformValues", 5494 "custom", 5495 "inherit", 5496 "layout", 5497 "layoutId", 5498 "_layoutResetTransform", 5499 "onLayoutAnimationComplete", 5500 "onViewportBoxUpdate", 5501 "onLayoutMeasure", 5502 "onBeforeLayoutMeasure", 5503 "onAnimationStart", 5504 "onAnimationComplete", 5505 "onUpdate", 5506 "onDragStart", 5507 "onDrag", 5508 "onDragEnd", 5509 "onMeasureDragConstraints", 5510 "onDirectionLock", 5511 "onDragTransitionEnd", 5512 "drag", 5513 "dragControls", 5514 "dragListener", 5515 "dragConstraints", 5516 "dragDirectionLock", 5517 "_dragX", 5518 "_dragY", 5519 "dragElastic", 5520 "dragMomentum", 5521 "dragPropagation", 5522 "dragTransition", 5523 "whileDrag", 5524 "onPan", 5525 "onPanStart", 5526 "onPanEnd", 5527 "onPanSessionStart", 5528 "onTap", 5529 "onTapStart", 5530 "onTapCancel", 5531 "onHoverStart", 5532 "onHoverEnd", 5533 "whileFocus", 5534 "whileTap", 5535 "whileHover", 5536 ]); 5537 /** 5538 * Check whether a prop name is a valid `MotionProp` key. 5539 * 5540 * @param key - Name of the property to check 5541 * @returns `true` is key is a valid `MotionProp`. 5542 * 5543 * @public 5544 */ 5545 function isValidMotionProp(key) { 5546 return validMotionProps.has(key); 5547 } 5548 5549 5550 5551 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js 5552 5553 5554 var shouldForward = function (key) { return !isValidMotionProp(key); }; 5555 /** 5556 * Emotion and Styled Components both allow users to pass through arbitrary props to their components 5557 * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which 5558 * of these should be passed to the underlying DOM node. 5559 * 5560 * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props 5561 * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props 5562 * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of 5563 * `@emotion/is-prop-valid`, however to fix this problem we need to use it. 5564 * 5565 * By making it an optionalDependency we can offer this functionality only in the situations where it's 5566 * actually required. 5567 */ 5568 try { 5569 var emotionIsPropValid_1 = __webpack_require__("9uj6").default; 5570 shouldForward = function (key) { 5571 // Handle events explicitly as Emotion validates them all as true 5572 if (key.startsWith("on")) { 5573 return !isValidMotionProp(key); 5574 } 5575 else { 5576 return emotionIsPropValid_1(key); 5577 } 5578 }; 5579 } 5580 catch (_a) { 5581 // We don't need to actually do anything here - the fallback is the existing `isPropValid`. 5582 } 5583 function filterProps(props, isDom, forwardMotionProps) { 5584 var filteredProps = {}; 5585 for (var key in props) { 5586 if (shouldForward(key) || 5587 (forwardMotionProps === true && isValidMotionProp(key)) || 5588 (!isDom && !isValidMotionProp(key))) { 5589 filteredProps[key] = props[key]; 5590 } 5591 } 5592 return filteredProps; 5593 } 5594 5595 5596 5597 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.js 5598 5599 5600 function calcOrigin(origin, offset, size) { 5601 return typeof origin === "string" 5602 ? origin 5603 : px.transform(offset + size * origin); 5604 } 5605 /** 5606 * The SVG transform origin defaults are different to CSS and is less intuitive, 5607 * so we use the measured dimensions of the SVG to reconcile these. 5608 */ 5609 function calcSVGTransformOrigin(dimensions, originX, originY) { 5610 var pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width); 5611 var pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height); 5612 return pxOriginX + " " + pxOriginY; 5613 } 5614 5615 5616 5617 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/path.js 5618 5619 5620 // Convert a progress 0-1 to a pixels value based on the provided length 5621 var progressToPixels = function (progress, length) { 5622 return px.transform(progress * length); 5623 }; 5624 var dashKeys = { 5625 offset: "stroke-dashoffset", 5626 array: "stroke-dasharray", 5627 }; 5628 var camelKeys = { 5629 offset: "strokeDashoffset", 5630 array: "strokeDasharray", 5631 }; 5632 /** 5633 * Build SVG path properties. Uses the path's measured length to convert 5634 * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset 5635 * and stroke-dasharray attributes. 5636 * 5637 * This function is mutative to reduce per-frame GC. 5638 */ 5639 function buildSVGPath(attrs, totalLength, length, spacing, offset, useDashCase) { 5640 if (spacing === void 0) { spacing = 1; } 5641 if (offset === void 0) { offset = 0; } 5642 if (useDashCase === void 0) { useDashCase = true; } 5643 // We use dash case when setting attributes directly to the DOM node and camel case 5644 // when defining props on a React component. 5645 var keys = useDashCase ? dashKeys : camelKeys; 5646 // Build the dash offset 5647 attrs[keys.offset] = progressToPixels(-offset, totalLength); 5648 // Build the dash array 5649 var pathLength = progressToPixels(length, totalLength); 5650 var pathSpacing = progressToPixels(spacing, totalLength); 5651 attrs[keys.array] = pathLength + " " + pathSpacing; 5652 } 5653 5654 5655 5656 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.js 5657 5658 5659 5660 5661 5662 /** 5663 * Build SVG visual attrbutes, like cx and style.transform 5664 */ 5665 function buildSVGAttrs(state, _a, projection, layoutState, options, transformTemplate, buildProjectionTransform, buildProjectionTransformOrigin) { 5666 var attrX = _a.attrX, attrY = _a.attrY, originX = _a.originX, originY = _a.originY, pathLength = _a.pathLength, _b = _a.pathSpacing, pathSpacing = _b === void 0 ? 1 : _b, _c = _a.pathOffset, pathOffset = _c === void 0 ? 0 : _c, 5667 // This is object creation, which we try to avoid per-frame. 5668 latest = __rest(_a, ["attrX", "attrY", "originX", "originY", "pathLength", "pathSpacing", "pathOffset"]); 5669 buildHTMLStyles(state, latest, projection, layoutState, options, transformTemplate, buildProjectionTransform, buildProjectionTransformOrigin); 5670 state.attrs = state.style; 5671 state.style = {}; 5672 var attrs = state.attrs, style = state.style, dimensions = state.dimensions, totalPathLength = state.totalPathLength; 5673 /** 5674 * However, we apply transforms as CSS transforms. So if we detect a transform we take it from attrs 5675 * and copy it into style. 5676 */ 5677 if (attrs.transform) { 5678 if (dimensions) 5679 style.transform = attrs.transform; 5680 delete attrs.transform; 5681 } 5682 // Parse transformOrigin 5683 if (dimensions && 5684 (originX !== undefined || originY !== undefined || style.transform)) { 5685 style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== undefined ? originX : 0.5, originY !== undefined ? originY : 0.5); 5686 } 5687 // Treat x/y not as shortcuts but as actual attributes 5688 if (attrX !== undefined) 5689 attrs.x = attrX; 5690 if (attrY !== undefined) 5691 attrs.y = attrY; 5692 // Build SVG path if one has been measured 5693 if (totalPathLength !== undefined && pathLength !== undefined) { 5694 buildSVGPath(attrs, totalPathLength, pathLength, pathSpacing, pathOffset, false); 5695 } 5696 } 5697 5698 5699 5700 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js 5701 5702 5703 5704 var createSvgRenderState = function () { return (__assign(__assign({}, createHtmlRenderState()), { attrs: {} })); }; 5705 5706 5707 5708 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/use-props.js 5709 5710 5711 5712 5713 5714 5715 function useSVGProps(props, visualState) { 5716 var visualProps = Object(external_React_["useMemo"])(function () { 5717 var state = createSvgRenderState(); 5718 buildSVGAttrs(state, visualState, undefined, undefined, { enableHardwareAcceleration: false }, props.transformTemplate); 5719 return __assign(__assign({}, state.attrs), { style: __assign({}, state.style) }); 5720 }, [visualState]); 5721 if (props.style) { 5722 var rawStyles = {}; 5723 copyRawValuesOnly(rawStyles, props.style, props); 5724 visualProps.style = __assign(__assign({}, rawStyles), visualProps.style); 5725 } 5726 return visualProps; 5727 } 5728 5729 5730 5731 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/use-render.js 5732 5733 5734 5735 5736 5737 5738 5739 function createUseRender(forwardMotionProps) { 5740 if (forwardMotionProps === void 0) { forwardMotionProps = false; } 5741 var useRender = function (Component, props, ref, _a, isStatic) { 5742 var latestValues = _a.latestValues; 5743 var useVisualProps = isSVGComponent(Component) 5744 ? useSVGProps 5745 : useHTMLProps; 5746 var visualProps = useVisualProps(props, latestValues, isStatic); 5747 var filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps); 5748 var elementProps = __assign(__assign(__assign({}, filteredProps), visualProps), { ref: ref }); 5749 return Object(external_React_["createElement"])(Component, elementProps); 5750 }; 5751 return useRender; 5752 } 5753 5754 5755 5756 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.js 5757 var CAMEL_CASE_PATTERN = /([a-z])([A-Z])/g; 5758 var REPLACE_TEMPLATE = "$1-$2"; 5759 /** 5760 * Convert camelCase to dash-case properties. 5761 */ 5762 var camelToDash = function (str) { 5763 return str.replace(CAMEL_CASE_PATTERN, REPLACE_TEMPLATE).toLowerCase(); 5764 }; 5765 5766 5767 5768 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/render.js 5769 function renderHTML(element, _a) { 5770 var style = _a.style, vars = _a.vars; 5771 // Directly assign style into the Element's style prop. In tests Object.assign is the 5772 // fastest way to assign styles. 5773 Object.assign(element.style, style); 5774 // Loop over any CSS variables and assign those. 5775 for (var key in vars) { 5776 element.style.setProperty(key, vars[key]); 5777 } 5778 } 5779 5780 5781 5782 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.js 5783 /** 5784 * A set of attribute names that are always read/written as camel case. 5785 */ 5786 var camelCaseAttributes = new Set([ 5787 "baseFrequency", 5788 "diffuseConstant", 5789 "kernelMatrix", 5790 "kernelUnitLength", 5791 "keySplines", 5792 "keyTimes", 5793 "limitingConeAngle", 5794 "markerHeight", 5795 "markerWidth", 5796 "numOctaves", 5797 "targetX", 5798 "targetY", 5799 "surfaceScale", 5800 "specularConstant", 5801 "specularExponent", 5802 "stdDeviation", 5803 "tableValues", 5804 "viewBox", 5805 "gradientTransform", 5806 ]); 5807 5808 5809 5810 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/render.js 5811 5812 5813 5814 5815 function renderSVG(element, renderState) { 5816 renderHTML(element, renderState); 5817 for (var key in renderState.attrs) { 5818 element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); 5819 } 5820 } 5821 5822 5823 5824 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.js 5825 5826 5827 5828 function scrape_motion_values_scrapeMotionValuesFromProps(props) { 5829 var style = props.style; 5830 var newValues = {}; 5831 for (var key in style) { 5832 if (isMotionValue(style[key]) || isForcedMotionValue(key, props)) { 5833 newValues[key] = style[key]; 5834 } 5835 } 5836 return newValues; 5837 } 5838 5839 5840 5841 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.js 5842 5843 5844 5845 function utils_scrape_motion_values_scrapeMotionValuesFromProps(props) { 5846 var newValues = scrape_motion_values_scrapeMotionValuesFromProps(props); 5847 for (var key in props) { 5848 if (isMotionValue(props[key])) { 5849 var targetKey = key === "x" || key === "y" ? "attr" + key.toUpperCase() : key; 5850 newValues[targetKey] = props[key]; 5851 } 5852 } 5853 return newValues; 5854 } 5855 5856 5857 5858 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.js 5859 function isAnimationControls(v) { 5860 return typeof v === "object" && typeof v.start === "function"; 5861 } 5862 5863 5864 5865 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.js 5866 var isKeyframesTarget = function (v) { 5867 return Array.isArray(v); 5868 }; 5869 5870 5871 5872 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/resolve-value.js 5873 5874 5875 var isCustomValue = function (v) { 5876 return Boolean(v && typeof v === "object" && v.mix && v.toValue); 5877 }; 5878 var resolveFinalValueInKeyframes = function (v) { 5879 // TODO maybe throw if v.length - 1 is placeholder token? 5880 return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; 5881 }; 5882 5883 5884 5885 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.js 5886 5887 5888 5889 /** 5890 * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself 5891 * 5892 * TODO: Remove and move to library 5893 * 5894 * @internal 5895 */ 5896 function resolveMotionValue(value) { 5897 var unwrappedValue = isMotionValue(value) ? value.get() : value; 5898 return isCustomValue(unwrappedValue) 5899 ? unwrappedValue.toValue() 5900 : unwrappedValue; 5901 } 5902 5903 5904 5905 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 function makeState(_a, props, context, presenceContext) { 5916 var scrapeMotionValuesFromProps = _a.scrapeMotionValuesFromProps, createRenderState = _a.createRenderState, onMount = _a.onMount; 5917 var state = { 5918 latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps), 5919 renderState: createRenderState(), 5920 }; 5921 if (onMount) { 5922 state.mount = function (instance) { return onMount(props, instance, state); }; 5923 } 5924 return state; 5925 } 5926 var makeUseVisualState = function (config) { return function (props, isStatic) { 5927 var context = Object(external_React_["useContext"])(MotionContext); 5928 var presenceContext = Object(external_React_["useContext"])(PresenceContext); 5929 return isStatic 5930 ? makeState(config, props, context, presenceContext) 5931 : useConstant(function () { return makeState(config, props, context, presenceContext); }); 5932 }; }; 5933 function makeLatestValues(props, context, presenceContext, scrapeMotionValues) { 5934 var values = {}; 5935 var blockInitialAnimation = (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.initial) === false; 5936 var motionValues = scrapeMotionValues(props); 5937 for (var key in motionValues) { 5938 values[key] = resolveMotionValue(motionValues[key]); 5939 } 5940 var initial = props.initial, animate = props.animate; 5941 var isControllingVariants = checkIfControllingVariants(props); 5942 var isVariantNode = checkIfVariantNode(props); 5943 if (context && 5944 isVariantNode && 5945 !isControllingVariants && 5946 props.inherit !== false) { 5947 initial !== null && initial !== void 0 ? initial : (initial = context.initial); 5948 animate !== null && animate !== void 0 ? animate : (animate = context.animate); 5949 } 5950 var variantToSet = blockInitialAnimation || initial === false ? animate : initial; 5951 if (variantToSet && 5952 typeof variantToSet !== "boolean" && 5953 !isAnimationControls(variantToSet)) { 5954 var list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; 5955 list.forEach(function (definition) { 5956 var resolved = resolveVariantFromProps(props, definition); 5957 if (!resolved) 5958 return; 5959 var transitionEnd = resolved.transitionEnd; resolved.transition; var target = __rest(resolved, ["transitionEnd", "transition"]); 5960 for (var key in target) 5961 values[key] = target[key]; 5962 for (var key in transitionEnd) 5963 values[key] = transitionEnd[key]; 5964 }); 5965 } 5966 return values; 5967 } 5968 5969 5970 5971 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/config-motion.js 5972 5973 5974 5975 5976 5977 5978 var svgMotionConfig = { 5979 useVisualState: makeUseVisualState({ 5980 scrapeMotionValuesFromProps: utils_scrape_motion_values_scrapeMotionValuesFromProps, 5981 createRenderState: createSvgRenderState, 5982 onMount: function (props, instance, _a) { 5983 var renderState = _a.renderState, latestValues = _a.latestValues; 5984 try { 5985 renderState.dimensions = 5986 typeof instance.getBBox === 5987 "function" 5988 ? instance.getBBox() 5989 : instance.getBoundingClientRect(); 5990 } 5991 catch (e) { 5992 // Most likely trying to measure an unrendered element under Firefox 5993 renderState.dimensions = { 5994 x: 0, 5995 y: 0, 5996 width: 0, 5997 height: 0, 5998 }; 5999 } 6000 if (isPath(instance)) { 6001 renderState.totalPathLength = instance.getTotalLength(); 6002 } 6003 buildSVGAttrs(renderState, latestValues, undefined, undefined, { enableHardwareAcceleration: false }, props.transformTemplate); 6004 // TODO: Replace with direct assignment 6005 renderSVG(instance, renderState); 6006 }, 6007 }), 6008 }; 6009 function isPath(element) { 6010 return element.tagName === "path"; 6011 } 6012 6013 6014 6015 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/config-motion.js 6016 6017 6018 6019 6020 var htmlMotionConfig = { 6021 useVisualState: makeUseVisualState({ 6022 scrapeMotionValuesFromProps: scrape_motion_values_scrapeMotionValuesFromProps, 6023 createRenderState: createHtmlRenderState, 6024 }), 6025 }; 6026 6027 6028 6029 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/create-config.js 6030 6031 6032 6033 6034 6035 6036 function createDomMotionConfig(Component, _a, preloadedFeatures, createVisualElement) { 6037 var _b = _a.forwardMotionProps, forwardMotionProps = _b === void 0 ? false : _b; 6038 var baseConfig = isSVGComponent(Component) 6039 ? svgMotionConfig 6040 : htmlMotionConfig; 6041 return __assign(__assign({}, baseConfig), { preloadedFeatures: preloadedFeatures, useRender: createUseRender(forwardMotionProps), createVisualElement: createVisualElement, 6042 Component: Component }); 6043 } 6044 6045 6046 6047 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/types.js 6048 var AnimationType; 6049 (function (AnimationType) { 6050 AnimationType["Animate"] = "animate"; 6051 AnimationType["Hover"] = "whileHover"; 6052 AnimationType["Tap"] = "whileTap"; 6053 AnimationType["Drag"] = "whileDrag"; 6054 AnimationType["Focus"] = "whileFocus"; 6055 AnimationType["Exit"] = "exit"; 6056 })(AnimationType || (AnimationType = {})); 6057 6058 6059 6060 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/use-dom-event.js 6061 6062 6063 function addDomEvent(target, eventName, handler, options) { 6064 target.addEventListener(eventName, handler, options); 6065 return function () { return target.removeEventListener(eventName, handler, options); }; 6066 } 6067 /** 6068 * Attaches an event listener directly to the provided DOM element. 6069 * 6070 * Bypassing React's event system can be desirable, for instance when attaching non-passive 6071 * event handlers. 6072 * 6073 * ```jsx 6074 * const ref = useRef(null) 6075 * 6076 * useDomEvent(ref, 'wheel', onWheel, { passive: false }) 6077 * 6078 * return <div ref={ref} /> 6079 * ``` 6080 * 6081 * @param ref - React.RefObject that's been provided to the element you want to bind the listener to. 6082 * @param eventName - Name of the event you want listen for. 6083 * @param handler - Function to fire when receiving the event. 6084 * @param options - Options to pass to `Event.addEventListener`. 6085 * 6086 * @public 6087 */ 6088 function useDomEvent(ref, eventName, handler, options) { 6089 Object(external_React_["useEffect"])(function () { 6090 var element = ref.current; 6091 if (handler && element) { 6092 return addDomEvent(element, eventName, handler, options); 6093 } 6094 }, [ref, eventName, handler, options]); 6095 } 6096 6097 6098 6099 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-focus-gesture.js 6100 6101 6102 6103 /** 6104 * 6105 * @param props 6106 * @param ref 6107 * @internal 6108 */ 6109 function useFocusGesture(_a) { 6110 var whileFocus = _a.whileFocus, visualElement = _a.visualElement; 6111 var onFocus = function () { 6112 var _a; 6113 (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Focus, true); 6114 }; 6115 var onBlur = function () { 6116 var _a; 6117 (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Focus, false); 6118 }; 6119 useDomEvent(visualElement, "focus", whileFocus ? onFocus : undefined); 6120 useDomEvent(visualElement, "blur", whileFocus ? onBlur : undefined); 6121 } 6122 6123 6124 6125 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/utils/event-type.js 6126 function isMouseEvent(event) { 6127 // PointerEvent inherits from MouseEvent so we can't use a straight instanceof check. 6128 if (typeof PointerEvent !== "undefined" && event instanceof PointerEvent) { 6129 return !!(event.pointerType === "mouse"); 6130 } 6131 return event instanceof MouseEvent; 6132 } 6133 function isTouchEvent(event) { 6134 var hasTouches = !!event.touches; 6135 return hasTouches; 6136 } 6137 6138 6139 6140 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/event-info.js 6141 6142 6143 /** 6144 * Filters out events not attached to the primary pointer (currently left mouse button) 6145 * @param eventHandler 6146 */ 6147 function filterPrimaryPointer(eventHandler) { 6148 return function (event) { 6149 var isMouseEvent = event instanceof MouseEvent; 6150 var isPrimaryPointer = !isMouseEvent || 6151 (isMouseEvent && event.button === 0); 6152 if (isPrimaryPointer) { 6153 eventHandler(event); 6154 } 6155 }; 6156 } 6157 var defaultPagePoint = { pageX: 0, pageY: 0 }; 6158 function pointFromTouch(e, pointType) { 6159 if (pointType === void 0) { pointType = "page"; } 6160 var primaryTouch = e.touches[0] || e.changedTouches[0]; 6161 var point = primaryTouch || defaultPagePoint; 6162 return { 6163 x: point[pointType + "X"], 6164 y: point[pointType + "Y"], 6165 }; 6166 } 6167 function pointFromMouse(point, pointType) { 6168 if (pointType === void 0) { pointType = "page"; } 6169 return { 6170 x: point[pointType + "X"], 6171 y: point[pointType + "Y"], 6172 }; 6173 } 6174 function extractEventInfo(event, pointType) { 6175 if (pointType === void 0) { pointType = "page"; } 6176 return { 6177 point: isTouchEvent(event) 6178 ? pointFromTouch(event, pointType) 6179 : pointFromMouse(event, pointType), 6180 }; 6181 } 6182 function getViewportPointFromEvent(event) { 6183 return extractEventInfo(event, "client"); 6184 } 6185 var wrapHandler = function (handler, shouldFilterPrimaryPointer) { 6186 if (shouldFilterPrimaryPointer === void 0) { shouldFilterPrimaryPointer = false; } 6187 var listener = function (event) { 6188 return handler(event, extractEventInfo(event)); 6189 }; 6190 return shouldFilterPrimaryPointer 6191 ? filterPrimaryPointer(listener) 6192 : listener; 6193 }; 6194 6195 6196 6197 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/utils.js 6198 6199 6200 // We check for event support via functions in case they've been mocked by a testing suite. 6201 var supportsPointerEvents = function () { 6202 return isBrowser && window.onpointerdown === null; 6203 }; 6204 var supportsTouchEvents = function () { 6205 return isBrowser && window.ontouchstart === null; 6206 }; 6207 var supportsMouseEvents = function () { 6208 return isBrowser && window.onmousedown === null; 6209 }; 6210 6211 6212 6213 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/use-pointer-event.js 6214 6215 6216 6217 6218 var mouseEventNames = { 6219 pointerdown: "mousedown", 6220 pointermove: "mousemove", 6221 pointerup: "mouseup", 6222 pointercancel: "mousecancel", 6223 pointerover: "mouseover", 6224 pointerout: "mouseout", 6225 pointerenter: "mouseenter", 6226 pointerleave: "mouseleave", 6227 }; 6228 var touchEventNames = { 6229 pointerdown: "touchstart", 6230 pointermove: "touchmove", 6231 pointerup: "touchend", 6232 pointercancel: "touchcancel", 6233 }; 6234 function getPointerEventName(name) { 6235 if (supportsPointerEvents()) { 6236 return name; 6237 } 6238 else if (supportsTouchEvents()) { 6239 return touchEventNames[name]; 6240 } 6241 else if (supportsMouseEvents()) { 6242 return mouseEventNames[name]; 6243 } 6244 return name; 6245 } 6246 function addPointerEvent(target, eventName, handler, options) { 6247 return addDomEvent(target, getPointerEventName(eventName), wrapHandler(handler, eventName === "pointerdown"), options); 6248 } 6249 function usePointerEvent(ref, eventName, handler, options) { 6250 return useDomEvent(ref, getPointerEventName(eventName), handler && wrapHandler(handler, eventName === "pointerdown"), options); 6251 } 6252 6253 6254 6255 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/utils/lock.js 6256 function createLock(name) { 6257 var lock = null; 6258 return function () { 6259 var openLock = function () { 6260 lock = null; 6261 }; 6262 if (lock === null) { 6263 lock = name; 6264 return openLock; 6265 } 6266 return false; 6267 }; 6268 } 6269 var globalHorizontalLock = createLock("dragHorizontal"); 6270 var globalVerticalLock = createLock("dragVertical"); 6271 function getGlobalLock(drag) { 6272 var lock = false; 6273 if (drag === "y") { 6274 lock = globalVerticalLock(); 6275 } 6276 else if (drag === "x") { 6277 lock = globalHorizontalLock(); 6278 } 6279 else { 6280 var openHorizontal_1 = globalHorizontalLock(); 6281 var openVertical_1 = globalVerticalLock(); 6282 if (openHorizontal_1 && openVertical_1) { 6283 lock = function () { 6284 openHorizontal_1(); 6285 openVertical_1(); 6286 }; 6287 } 6288 else { 6289 // Release the locks because we don't use them 6290 if (openHorizontal_1) 6291 openHorizontal_1(); 6292 if (openVertical_1) 6293 openVertical_1(); 6294 } 6295 } 6296 return lock; 6297 } 6298 function isDragActive() { 6299 // Check the gesture lock - if we get it, it means no drag gesture is active 6300 // and we can safely fire the tap gesture. 6301 var openGestureLock = getGlobalLock(true); 6302 if (!openGestureLock) 6303 return true; 6304 openGestureLock(); 6305 return false; 6306 } 6307 6308 6309 6310 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-hover-gesture.js 6311 6312 6313 6314 6315 6316 function createHoverEvent(visualElement, isActive, callback) { 6317 return function (event, info) { 6318 var _a; 6319 if (!isMouseEvent(event) || isDragActive()) 6320 return; 6321 callback === null || callback === void 0 ? void 0 : callback(event, info); 6322 (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Hover, isActive); 6323 }; 6324 } 6325 function useHoverGesture(_a) { 6326 var onHoverStart = _a.onHoverStart, onHoverEnd = _a.onHoverEnd, whileHover = _a.whileHover, visualElement = _a.visualElement; 6327 usePointerEvent(visualElement, "pointerenter", onHoverStart || whileHover 6328 ? createHoverEvent(visualElement, true, onHoverStart) 6329 : undefined); 6330 usePointerEvent(visualElement, "pointerleave", onHoverEnd || whileHover 6331 ? createHoverEvent(visualElement, false, onHoverEnd) 6332 : undefined); 6333 } 6334 6335 6336 6337 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/utils/is-node-or-child.js 6338 /** 6339 * Recursively traverse up the tree to check whether the provided child node 6340 * is the parent or a descendant of it. 6341 * 6342 * @param parent - Element to find 6343 * @param child - Element to test against parent 6344 */ 6345 var isNodeOrChild = function (parent, child) { 6346 if (!child) { 6347 return false; 6348 } 6349 else if (parent === child) { 6350 return true; 6351 } 6352 else { 6353 return isNodeOrChild(parent, child.parentElement); 6354 } 6355 }; 6356 6357 6358 6359 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-unmount-effect.js 6360 6361 6362 function useUnmountEffect(callback) { 6363 return Object(external_React_["useEffect"])(function () { return function () { return callback(); }; }, []); 6364 } 6365 6366 6367 6368 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/pipe.js 6369 var combineFunctions = function (a, b) { return function (v) { return b(a(v)); }; }; 6370 var pipe = function () { 6371 var transformers = []; 6372 for (var _i = 0; _i < arguments.length; _i++) { 6373 transformers[_i] = arguments[_i]; 6374 } 6375 return transformers.reduce(combineFunctions); 6376 }; 6377 6378 6379 6380 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-tap-gesture.js 6381 6382 6383 6384 6385 6386 6387 6388 6389 /** 6390 * @param handlers - 6391 * @internal 6392 */ 6393 function useTapGesture(_a) { 6394 var onTap = _a.onTap, onTapStart = _a.onTapStart, onTapCancel = _a.onTapCancel, whileTap = _a.whileTap, visualElement = _a.visualElement; 6395 var hasPressListeners = onTap || onTapStart || onTapCancel || whileTap; 6396 var isPressing = Object(external_React_["useRef"])(false); 6397 var cancelPointerEndListeners = Object(external_React_["useRef"])(null); 6398 function removePointerEndListener() { 6399 var _a; 6400 (_a = cancelPointerEndListeners.current) === null || _a === void 0 ? void 0 : _a.call(cancelPointerEndListeners); 6401 cancelPointerEndListeners.current = null; 6402 } 6403 function checkPointerEnd() { 6404 var _a; 6405 removePointerEndListener(); 6406 isPressing.current = false; 6407 (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Tap, false); 6408 return !isDragActive(); 6409 } 6410 function onPointerUp(event, info) { 6411 if (!checkPointerEnd()) 6412 return; 6413 /** 6414 * We only count this as a tap gesture if the event.target is the same 6415 * as, or a child of, this component's element 6416 */ 6417 !isNodeOrChild(visualElement.getInstance(), event.target) 6418 ? onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info) 6419 : onTap === null || onTap === void 0 ? void 0 : onTap(event, info); 6420 } 6421 function onPointerCancel(event, info) { 6422 if (!checkPointerEnd()) 6423 return; 6424 onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info); 6425 } 6426 function onPointerDown(event, info) { 6427 var _a; 6428 removePointerEndListener(); 6429 if (isPressing.current) 6430 return; 6431 isPressing.current = true; 6432 cancelPointerEndListeners.current = pipe(addPointerEvent(window, "pointerup", onPointerUp), addPointerEvent(window, "pointercancel", onPointerCancel)); 6433 onTapStart === null || onTapStart === void 0 ? void 0 : onTapStart(event, info); 6434 (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Tap, true); 6435 } 6436 usePointerEvent(visualElement, "pointerdown", hasPressListeners ? onPointerDown : undefined); 6437 useUnmountEffect(removePointerEndListener); 6438 } 6439 6440 6441 6442 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/make-renderless-component.js 6443 var makeRenderlessComponent = function (hook) { return function (props) { 6444 hook(props); 6445 return null; 6446 }; }; 6447 6448 6449 6450 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/gestures.js 6451 6452 6453 6454 6455 6456 var gestureAnimations = { 6457 tap: makeRenderlessComponent(useTapGesture), 6458 focus: makeRenderlessComponent(useFocusGesture), 6459 hover: makeRenderlessComponent(useHoverGesture), 6460 }; 6461 6462 6463 6464 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/shallow-compare.js 6465 function shallowCompare(next, prev) { 6466 if (!Array.isArray(prev)) 6467 return false; 6468 var prevLength = prev.length; 6469 if (prevLength !== next.length) 6470 return false; 6471 for (var i = 0; i < prevLength; i++) { 6472 if (prev[i] !== next[i]) 6473 return false; 6474 } 6475 return true; 6476 } 6477 6478 6479 6480 // CONCATENATED MODULE: ./node_modules/popmotion/node_modules/tslib/tslib.es6.js 6481 /*! ***************************************************************************** 6482 Copyright (c) Microsoft Corporation. 6483 6484 Permission to use, copy, modify, and/or distribute this software for any 6485 purpose with or without fee is hereby granted. 6486 6487 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 6488 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 6489 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 6490 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 6491 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 6492 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 6493 PERFORMANCE OF THIS SOFTWARE. 6494 ***************************************************************************** */ 6495 /* global Reflect, Promise */ 6496 6497 var tslib_tslib_es6_extendStatics = function(d, b) { 6498 tslib_tslib_es6_extendStatics = Object.setPrototypeOf || 6499 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 6500 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; 6501 return tslib_tslib_es6_extendStatics(d, b); 6502 }; 6503 6504 function tslib_tslib_es6_extends(d, b) { 6505 if (typeof b !== "function" && b !== null) 6506 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); 6507 tslib_tslib_es6_extendStatics(d, b); 6508 function __() { this.constructor = d; } 6509 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 6510 } 6511 6512 var tslib_tslib_es6_assign = function() { 6513 tslib_tslib_es6_assign = Object.assign || function __assign(t) { 6514 for (var s, i = 1, n = arguments.length; i < n; i++) { 6515 s = arguments[i]; 6516 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 6517 } 6518 return t; 6519 } 6520 return tslib_tslib_es6_assign.apply(this, arguments); 6521 } 6522 6523 function tslib_tslib_es6_rest(s, e) { 6524 var t = {}; 6525 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 6526 t[p] = s[p]; 6527 if (s != null && typeof Object.getOwnPropertySymbols === "function") 6528 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 6529 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 6530 t[p[i]] = s[p[i]]; 6531 } 6532 return t; 6533 } 6534 6535 function tslib_tslib_es6_decorate(decorators, target, key, desc) { 6536 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 6537 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 6538 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; 6539 return c > 3 && r && Object.defineProperty(target, key, r), r; 6540 } 6541 6542 function tslib_tslib_es6_param(paramIndex, decorator) { 6543 return function (target, key) { decorator(target, key, paramIndex); } 6544 } 6545 6546 function tslib_tslib_es6_metadata(metadataKey, metadataValue) { 6547 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); 6548 } 6549 6550 function tslib_tslib_es6_awaiter(thisArg, _arguments, P, generator) { 6551 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 6552 return new (P || (P = Promise))(function (resolve, reject) { 6553 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6554 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 6555 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 6556 step((generator = generator.apply(thisArg, _arguments || [])).next()); 6557 }); 6558 } 6559 6560 function tslib_tslib_es6_generator(thisArg, body) { 6561 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 6562 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 6563 function verb(n) { return function (v) { return step([n, v]); }; } 6564 function step(op) { 6565 if (f) throw new TypeError("Generator is already executing."); 6566 while (_) try { 6567 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; 6568 if (y = 0, t) op = [op[0] & 2, t.value]; 6569 switch (op[0]) { 6570 case 0: case 1: t = op; break; 6571 case 4: _.label++; return { value: op[1], done: false }; 6572 case 5: _.label++; y = op[1]; op = [0]; continue; 6573 case 7: op = _.ops.pop(); _.trys.pop(); continue; 6574 default: 6575 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 6576 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 6577 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 6578 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 6579 if (t[2]) _.ops.pop(); 6580 _.trys.pop(); continue; 6581 } 6582 op = body.call(thisArg, _); 6583 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 6584 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 6585 } 6586 } 6587 6588 var tslib_tslib_es6_createBinding = Object.create ? (function(o, m, k, k2) { 6589 if (k2 === undefined) k2 = k; 6590 Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); 6591 }) : (function(o, m, k, k2) { 6592 if (k2 === undefined) k2 = k; 6593 o[k2] = m[k]; 6594 }); 6595 6596 function tslib_tslib_es6_exportStar(m, o) { 6597 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) tslib_tslib_es6_createBinding(o, m, p); 6598 } 6599 6600 function tslib_tslib_es6_values(o) { 6601 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; 6602 if (m) return m.call(o); 6603 if (o && typeof o.length === "number") return { 6604 next: function () { 6605 if (o && i >= o.length) o = void 0; 6606 return { value: o && o[i++], done: !o }; 6607 } 6608 }; 6609 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); 6610 } 6611 6612 function tslib_tslib_es6_read(o, n) { 6613 var m = typeof Symbol === "function" && o[Symbol.iterator]; 6614 if (!m) return o; 6615 var i = m.call(o), r, ar = [], e; 6616 try { 6617 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 6618 } 6619 catch (error) { e = { error: error }; } 6620 finally { 6621 try { 6622 if (r && !r.done && (m = i["return"])) m.call(i); 6623 } 6624 finally { if (e) throw e.error; } 6625 } 6626 return ar; 6627 } 6628 6629 /** @deprecated */ 6630 function tslib_tslib_es6_spread() { 6631 for (var ar = [], i = 0; i < arguments.length; i++) 6632 ar = ar.concat(tslib_tslib_es6_read(arguments[i])); 6633 return ar; 6634 } 6635 6636 /** @deprecated */ 6637 function tslib_tslib_es6_spreadArrays() { 6638 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 6639 for (var r = Array(s), k = 0, i = 0; i < il; i++) 6640 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 6641 r[k] = a[j]; 6642 return r; 6643 } 6644 6645 function tslib_tslib_es6_spreadArray(to, from, pack) { 6646 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { 6647 if (ar || !(i in from)) { 6648 if (!ar) ar = Array.prototype.slice.call(from, 0, i); 6649 ar[i] = from[i]; 6650 } 6651 } 6652 return to.concat(ar || Array.prototype.slice.call(from)); 6653 } 6654 6655 function tslib_tslib_es6_await(v) { 6656 return this instanceof tslib_tslib_es6_await ? (this.v = v, this) : new tslib_tslib_es6_await(v); 6657 } 6658 6659 function tslib_tslib_es6_asyncGenerator(thisArg, _arguments, generator) { 6660 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 6661 var g = generator.apply(thisArg, _arguments || []), i, q = []; 6662 return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; 6663 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); }); }; } 6664 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } 6665 function step(r) { r.value instanceof tslib_tslib_es6_await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } 6666 function fulfill(value) { resume("next", value); } 6667 function reject(value) { resume("throw", value); } 6668 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } 6669 } 6670 6671 function tslib_tslib_es6_asyncDelegator(o) { 6672 var i, p; 6673 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 6674 function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: tslib_tslib_es6_await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } 6675 } 6676 6677 function tslib_tslib_es6_asyncValues(o) { 6678 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 6679 var m = o[Symbol.asyncIterator], i; 6680 return m ? m.call(o) : (o = typeof tslib_tslib_es6_values === "function" ? tslib_tslib_es6_values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); 6681 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); }); }; } 6682 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } 6683 } 6684 6685 function tslib_tslib_es6_makeTemplateObject(cooked, raw) { 6686 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 6687 return cooked; 6688 }; 6689 6690 var tslib_tslib_es6_setModuleDefault = Object.create ? (function(o, v) { 6691 Object.defineProperty(o, "default", { enumerable: true, value: v }); 6692 }) : function(o, v) { 6693 o["default"] = v; 6694 }; 6695 6696 function tslib_tslib_es6_importStar(mod) { 6697 if (mod && mod.__esModule) return mod; 6698 var result = {}; 6699 if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) tslib_tslib_es6_createBinding(result, mod, k); 6700 tslib_tslib_es6_setModuleDefault(result, mod); 6701 return result; 6702 } 6703 6704 function tslib_tslib_es6_importDefault(mod) { 6705 return (mod && mod.__esModule) ? mod : { default: mod }; 6706 } 6707 6708 function tslib_tslib_es6_classPrivateFieldGet(receiver, state, kind, f) { 6709 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); 6710 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); 6711 return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); 6712 } 6713 6714 function tslib_tslib_es6_classPrivateFieldSet(receiver, state, value, kind, f) { 6715 if (kind === "m") throw new TypeError("Private method is not writable"); 6716 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); 6717 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); 6718 return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; 6719 } 6720 6721 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/clamp.js 6722 var clamp_clamp = function (min, max, v) { 6723 return Math.min(Math.max(v, min), max); 6724 }; 6725 6726 6727 6728 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/utils/find-spring.js 6729 6730 6731 6732 var safeMin = 0.001; 6733 var minDuration = 0.01; 6734 var maxDuration = 10.0; 6735 var minDamping = 0.05; 6736 var maxDamping = 1; 6737 function findSpring(_a) { 6738 var _b = _a.duration, duration = _b === void 0 ? 800 : _b, _c = _a.bounce, bounce = _c === void 0 ? 0.25 : _c, _d = _a.velocity, velocity = _d === void 0 ? 0 : _d, _e = _a.mass, mass = _e === void 0 ? 1 : _e; 6739 var envelope; 6740 var derivative; 6741 warning(duration <= maxDuration * 1000, "Spring duration must be 10 seconds or less"); 6742 var dampingRatio = 1 - bounce; 6743 dampingRatio = clamp_clamp(minDamping, maxDamping, dampingRatio); 6744 duration = clamp_clamp(minDuration, maxDuration, duration / 1000); 6745 if (dampingRatio < 1) { 6746 envelope = function (undampedFreq) { 6747 var exponentialDecay = undampedFreq * dampingRatio; 6748 var delta = exponentialDecay * duration; 6749 var a = exponentialDecay - velocity; 6750 var b = calcAngularFreq(undampedFreq, dampingRatio); 6751 var c = Math.exp(-delta); 6752 return safeMin - (a / b) * c; 6753 }; 6754 derivative = function (undampedFreq) { 6755 var exponentialDecay = undampedFreq * dampingRatio; 6756 var delta = exponentialDecay * duration; 6757 var d = delta * velocity + velocity; 6758 var e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; 6759 var f = Math.exp(-delta); 6760 var g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); 6761 var factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; 6762 return (factor * ((d - e) * f)) / g; 6763 }; 6764 } 6765 else { 6766 envelope = function (undampedFreq) { 6767 var a = Math.exp(-undampedFreq * duration); 6768 var b = (undampedFreq - velocity) * duration + 1; 6769 return -safeMin + a * b; 6770 }; 6771 derivative = function (undampedFreq) { 6772 var a = Math.exp(-undampedFreq * duration); 6773 var b = (velocity - undampedFreq) * (duration * duration); 6774 return a * b; 6775 }; 6776 } 6777 var initialGuess = 5 / duration; 6778 var undampedFreq = approximateRoot(envelope, derivative, initialGuess); 6779 duration = duration * 1000; 6780 if (isNaN(undampedFreq)) { 6781 return { 6782 stiffness: 100, 6783 damping: 10, 6784 duration: duration, 6785 }; 6786 } 6787 else { 6788 var stiffness = Math.pow(undampedFreq, 2) * mass; 6789 return { 6790 stiffness: stiffness, 6791 damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), 6792 duration: duration, 6793 }; 6794 } 6795 } 6796 var rootIterations = 12; 6797 function approximateRoot(envelope, derivative, initialGuess) { 6798 var result = initialGuess; 6799 for (var i = 1; i < rootIterations; i++) { 6800 result = result - envelope(result) / derivative(result); 6801 } 6802 return result; 6803 } 6804 function calcAngularFreq(undampedFreq, dampingRatio) { 6805 return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); 6806 } 6807 6808 6809 6810 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/generators/spring.js 6811 6812 6813 6814 var durationKeys = ["duration", "bounce"]; 6815 var physicsKeys = ["stiffness", "damping", "mass"]; 6816 function isSpringType(options, keys) { 6817 return keys.some(function (key) { return options[key] !== undefined; }); 6818 } 6819 function getSpringOptions(options) { 6820 var springOptions = tslib_tslib_es6_assign({ velocity: 0.0, stiffness: 100, damping: 10, mass: 1.0, isResolvedFromDuration: false }, options); 6821 if (!isSpringType(options, physicsKeys) && 6822 isSpringType(options, durationKeys)) { 6823 var derived = findSpring(options); 6824 springOptions = tslib_tslib_es6_assign(tslib_tslib_es6_assign(tslib_tslib_es6_assign({}, springOptions), derived), { velocity: 0.0, mass: 1.0 }); 6825 springOptions.isResolvedFromDuration = true; 6826 } 6827 return springOptions; 6828 } 6829 function spring(_a) { 6830 var _b = _a.from, from = _b === void 0 ? 0.0 : _b, _c = _a.to, to = _c === void 0 ? 1.0 : _c, _d = _a.restSpeed, restSpeed = _d === void 0 ? 2 : _d, restDelta = _a.restDelta, options = tslib_tslib_es6_rest(_a, ["from", "to", "restSpeed", "restDelta"]); 6831 var state = { done: false, value: from }; 6832 var _e = getSpringOptions(options), stiffness = _e.stiffness, damping = _e.damping, mass = _e.mass, velocity = _e.velocity, duration = _e.duration, isResolvedFromDuration = _e.isResolvedFromDuration; 6833 var resolveSpring = zero; 6834 var resolveVelocity = zero; 6835 function createSpring() { 6836 var initialVelocity = velocity ? -(velocity / 1000) : 0.0; 6837 var initialDelta = to - from; 6838 var dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); 6839 var undampedAngularFreq = Math.sqrt(stiffness / mass) / 1000; 6840 restDelta !== null && restDelta !== void 0 ? restDelta : (restDelta = Math.abs(to - from) <= 1 ? 0.01 : 0.4); 6841 if (dampingRatio < 1) { 6842 var angularFreq_1 = calcAngularFreq(undampedAngularFreq, dampingRatio); 6843 resolveSpring = function (t) { 6844 var envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); 6845 return (to - 6846 envelope * 6847 (((initialVelocity + 6848 dampingRatio * undampedAngularFreq * initialDelta) / 6849 angularFreq_1) * 6850 Math.sin(angularFreq_1 * t) + 6851 initialDelta * Math.cos(angularFreq_1 * t))); 6852 }; 6853 resolveVelocity = function (t) { 6854 var envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); 6855 return (dampingRatio * 6856 undampedAngularFreq * 6857 envelope * 6858 ((Math.sin(angularFreq_1 * t) * 6859 (initialVelocity + 6860 dampingRatio * 6861 undampedAngularFreq * 6862 initialDelta)) / 6863 angularFreq_1 + 6864 initialDelta * Math.cos(angularFreq_1 * t)) - 6865 envelope * 6866 (Math.cos(angularFreq_1 * t) * 6867 (initialVelocity + 6868 dampingRatio * 6869 undampedAngularFreq * 6870 initialDelta) - 6871 angularFreq_1 * 6872 initialDelta * 6873 Math.sin(angularFreq_1 * t))); 6874 }; 6875 } 6876 else if (dampingRatio === 1) { 6877 resolveSpring = function (t) { 6878 return to - 6879 Math.exp(-undampedAngularFreq * t) * 6880 (initialDelta + 6881 (initialVelocity + undampedAngularFreq * initialDelta) * 6882 t); 6883 }; 6884 } 6885 else { 6886 var dampedAngularFreq_1 = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); 6887 resolveSpring = function (t) { 6888 var envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); 6889 var freqForT = Math.min(dampedAngularFreq_1 * t, 300); 6890 return (to - 6891 (envelope * 6892 ((initialVelocity + 6893 dampingRatio * undampedAngularFreq * initialDelta) * 6894 Math.sinh(freqForT) + 6895 dampedAngularFreq_1 * 6896 initialDelta * 6897 Math.cosh(freqForT))) / 6898 dampedAngularFreq_1); 6899 }; 6900 } 6901 } 6902 createSpring(); 6903 return { 6904 next: function (t) { 6905 var current = resolveSpring(t); 6906 if (!isResolvedFromDuration) { 6907 var currentVelocity = resolveVelocity(t) * 1000; 6908 var isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed; 6909 var isBelowDisplacementThreshold = Math.abs(to - current) <= restDelta; 6910 state.done = 6911 isBelowVelocityThreshold && isBelowDisplacementThreshold; 6912 } 6913 else { 6914 state.done = t >= duration; 6915 } 6916 state.value = state.done ? to : current; 6917 return state; 6918 }, 6919 flipTarget: function () { 6920 var _a; 6921 velocity = -velocity; 6922 _a = [to, from], from = _a[0], to = _a[1]; 6923 createSpring(); 6924 }, 6925 }; 6926 } 6927 spring.needsInterpolation = function (a, b) { 6928 return typeof a === "string" || typeof b === "string"; 6929 }; 6930 var zero = function (_t) { return 0; }; 6931 6932 6933 6934 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/progress.js 6935 var progress_progress = function (from, to, value) { 6936 var toFromDifference = to - from; 6937 return toFromDifference === 0 ? 1 : (value - from) / toFromDifference; 6938 }; 6939 6940 6941 6942 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/mix.js 6943 var mix = function (from, to, progress) { 6944 return -progress * from + progress * to + from; 6945 }; 6946 6947 6948 6949 // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/utils.js 6950 6951 6952 var isColorString = function (type, testProp) { return function (v) { 6953 return Boolean((isString(v) && singleColorRegex.test(v) && v.startsWith(type)) || 6954 (testProp && Object.prototype.hasOwnProperty.call(v, testProp))); 6955 }; }; 6956 var splitColor = function (aName, bName, cName) { return function (v) { 6957 var _a; 6958 if (!isString(v)) 6959 return v; 6960 var _b = v.match(floatRegex), a = _b[0], b = _b[1], c = _b[2], alpha = _b[3]; 6961 return _a = {}, 6962 _a[aName] = parseFloat(a), 6963 _a[bName] = parseFloat(b), 6964 _a[cName] = parseFloat(c), 6965 _a.alpha = alpha !== undefined ? parseFloat(alpha) : 1, 6966 _a; 6967 }; }; 6968 6969 6970 6971 // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/rgba.js 6972 6973 6974 6975 6976 6977 var clampRgbUnit = clamp(0, 255); 6978 var rgbUnit = tslib_es6_assign(tslib_es6_assign({}, numbers_number), { transform: function (v) { return Math.round(clampRgbUnit(v)); } }); 6979 var rgba = { 6980 test: isColorString('rgb', 'red'), 6981 parse: splitColor('red', 'green', 'blue'), 6982 transform: function (_a) { 6983 var red = _a.red, green = _a.green, blue = _a.blue, _b = _a.alpha, alpha$1 = _b === void 0 ? 1 : _b; 6984 return 'rgba(' + 6985 rgbUnit.transform(red) + 6986 ', ' + 6987 rgbUnit.transform(green) + 6988 ', ' + 6989 rgbUnit.transform(blue) + 6990 ', ' + 6991 sanitize(numbers_alpha.transform(alpha$1)) + 6992 ')'; 6993 }, 6994 }; 6995 6996 6997 6998 // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/hex.js 6999 7000 7001 7002 function parseHex(v) { 7003 var r = ''; 7004 var g = ''; 7005 var b = ''; 7006 var a = ''; 7007 if (v.length > 5) { 7008 r = v.substr(1, 2); 7009 g = v.substr(3, 2); 7010 b = v.substr(5, 2); 7011 a = v.substr(7, 2); 7012 } 7013 else { 7014 r = v.substr(1, 1); 7015 g = v.substr(2, 1); 7016 b = v.substr(3, 1); 7017 a = v.substr(4, 1); 7018 r += r; 7019 g += g; 7020 b += b; 7021 a += a; 7022 } 7023 return { 7024 red: parseInt(r, 16), 7025 green: parseInt(g, 16), 7026 blue: parseInt(b, 16), 7027 alpha: a ? parseInt(a, 16) / 255 : 1, 7028 }; 7029 } 7030 var hex = { 7031 test: isColorString('#'), 7032 parse: parseHex, 7033 transform: rgba.transform, 7034 }; 7035 7036 7037 7038 // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/hsla.js 7039 7040 7041 7042 7043 7044 var hsla = { 7045 test: isColorString('hsl', 'hue'), 7046 parse: splitColor('hue', 'saturation', 'lightness'), 7047 transform: function (_a) { 7048 var hue = _a.hue, saturation = _a.saturation, lightness = _a.lightness, _b = _a.alpha, alpha$1 = _b === void 0 ? 1 : _b; 7049 return ('hsla(' + 7050 Math.round(hue) + 7051 ', ' + 7052 percent.transform(sanitize(saturation)) + 7053 ', ' + 7054 percent.transform(sanitize(lightness)) + 7055 ', ' + 7056 sanitize(numbers_alpha.transform(alpha$1)) + 7057 ')'); 7058 }, 7059 }; 7060 7061 7062 7063 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/mix-color.js 7064 7065 7066 7067 7068 7069 var mixLinearColor = function (from, to, v) { 7070 var fromExpo = from * from; 7071 var toExpo = to * to; 7072 return Math.sqrt(Math.max(0, v * (toExpo - fromExpo) + fromExpo)); 7073 }; 7074 var colorTypes = [hex, rgba, hsla]; 7075 var getColorType = function (v) { 7076 return colorTypes.find(function (type) { return type.test(v); }); 7077 }; 7078 var notAnimatable = function (color) { 7079 return "'" + color + "' is not an animatable color. Use the equivalent color code instead."; 7080 }; 7081 var mixColor = function (from, to) { 7082 var fromColorType = getColorType(from); 7083 var toColorType = getColorType(to); 7084 invariant(!!fromColorType, notAnimatable(from)); 7085 invariant(!!toColorType, notAnimatable(to)); 7086 invariant(fromColorType.transform === toColorType.transform, "Both colors must be hex/RGBA, OR both must be HSLA."); 7087 var fromColor = fromColorType.parse(from); 7088 var toColor = toColorType.parse(to); 7089 var blended = tslib_tslib_es6_assign({}, fromColor); 7090 var mixFunc = fromColorType === hsla ? mix : mixLinearColor; 7091 return function (v) { 7092 for (var key in blended) { 7093 if (key !== "alpha") { 7094 blended[key] = mixFunc(fromColor[key], toColor[key], v); 7095 } 7096 } 7097 blended.alpha = mix(fromColor.alpha, toColor.alpha, v); 7098 return fromColorType.transform(blended); 7099 }; 7100 }; 7101 7102 7103 7104 // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/index.js 7105 7106 7107 7108 7109 7110 var color = { 7111 test: function (v) { return rgba.test(v) || hex.test(v) || hsla.test(v); }, 7112 parse: function (v) { 7113 if (rgba.test(v)) { 7114 return rgba.parse(v); 7115 } 7116 else if (hsla.test(v)) { 7117 return hsla.parse(v); 7118 } 7119 else { 7120 return hex.parse(v); 7121 } 7122 }, 7123 transform: function (v) { 7124 return isString(v) 7125 ? v 7126 : v.hasOwnProperty('red') 7127 ? rgba.transform(v) 7128 : hsla.transform(v); 7129 }, 7130 }; 7131 7132 7133 7134 // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/complex/index.js 7135 7136 7137 7138 7139 var colorToken = '${c}'; 7140 var numberToken = '${n}'; 7141 function test(v) { 7142 var _a, _b, _c, _d; 7143 return (isNaN(v) && 7144 isString(v) && 7145 ((_b = (_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) + ((_d = (_c = v.match(colorRegex)) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0); 7146 } 7147 function analyse(v) { 7148 var values = []; 7149 var numColors = 0; 7150 var colors = v.match(colorRegex); 7151 if (colors) { 7152 numColors = colors.length; 7153 v = v.replace(colorRegex, colorToken); 7154 values.push.apply(values, colors.map(color.parse)); 7155 } 7156 var numbers = v.match(floatRegex); 7157 if (numbers) { 7158 v = v.replace(floatRegex, numberToken); 7159 values.push.apply(values, numbers.map(numbers_number.parse)); 7160 } 7161 return { values: values, numColors: numColors, tokenised: v }; 7162 } 7163 function parse(v) { 7164 return analyse(v).values; 7165 } 7166 function createTransformer(v) { 7167 var _a = analyse(v), values = _a.values, numColors = _a.numColors, tokenised = _a.tokenised; 7168 var numValues = values.length; 7169 return function (v) { 7170 var output = tokenised; 7171 for (var i = 0; i < numValues; i++) { 7172 output = output.replace(i < numColors ? colorToken : numberToken, i < numColors ? color.transform(v[i]) : sanitize(v[i])); 7173 } 7174 return output; 7175 }; 7176 } 7177 var convertNumbersToZero = function (v) { 7178 return typeof v === 'number' ? 0 : v; 7179 }; 7180 function getAnimatableNone(v) { 7181 var parsed = parse(v); 7182 var transformer = createTransformer(v); 7183 return transformer(parsed.map(convertNumbersToZero)); 7184 } 7185 var complex = { test: test, parse: parse, createTransformer: createTransformer, getAnimatableNone: getAnimatableNone }; 7186 7187 7188 7189 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/inc.js 7190 var zeroPoint = { 7191 x: 0, 7192 y: 0, 7193 z: 0 7194 }; 7195 var isNum = function (v) { return typeof v === 'number'; }; 7196 7197 7198 7199 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/mix-complex.js 7200 7201 7202 7203 7204 7205 7206 7207 7208 function getMixer(origin, target) { 7209 if (isNum(origin)) { 7210 return function (v) { return mix(origin, target, v); }; 7211 } 7212 else if (color.test(origin)) { 7213 return mixColor(origin, target); 7214 } 7215 else { 7216 return mixComplex(origin, target); 7217 } 7218 } 7219 var mixArray = function (from, to) { 7220 var output = tslib_tslib_es6_spreadArray([], from); 7221 var numValues = output.length; 7222 var blendValue = from.map(function (fromThis, i) { return getMixer(fromThis, to[i]); }); 7223 return function (v) { 7224 for (var i = 0; i < numValues; i++) { 7225 output[i] = blendValue[i](v); 7226 } 7227 return output; 7228 }; 7229 }; 7230 var mixObject = function (origin, target) { 7231 var output = tslib_tslib_es6_assign(tslib_tslib_es6_assign({}, origin), target); 7232 var blendValue = {}; 7233 for (var key in output) { 7234 if (origin[key] !== undefined && target[key] !== undefined) { 7235 blendValue[key] = getMixer(origin[key], target[key]); 7236 } 7237 } 7238 return function (v) { 7239 for (var key in blendValue) { 7240 output[key] = blendValue[key](v); 7241 } 7242 return output; 7243 }; 7244 }; 7245 function mix_complex_analyse(value) { 7246 var parsed = complex.parse(value); 7247 var numValues = parsed.length; 7248 var numNumbers = 0; 7249 var numRGB = 0; 7250 var numHSL = 0; 7251 for (var i = 0; i < numValues; i++) { 7252 if (numNumbers || typeof parsed[i] === "number") { 7253 numNumbers++; 7254 } 7255 else { 7256 if (parsed[i].hue !== undefined) { 7257 numHSL++; 7258 } 7259 else { 7260 numRGB++; 7261 } 7262 } 7263 } 7264 return { parsed: parsed, numNumbers: numNumbers, numRGB: numRGB, numHSL: numHSL }; 7265 } 7266 var mixComplex = function (origin, target) { 7267 var template = complex.createTransformer(target); 7268 var originStats = mix_complex_analyse(origin); 7269 var targetStats = mix_complex_analyse(target); 7270 invariant(originStats.numHSL === targetStats.numHSL && 7271 originStats.numRGB === targetStats.numRGB && 7272 originStats.numNumbers >= targetStats.numNumbers, "Complex values '" + origin + "' and '" + target + "' too different to mix. Ensure all colors are of the same type."); 7273 return pipe(mixArray(originStats.parsed, targetStats.parsed), template); 7274 }; 7275 7276 7277 7278 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/interpolate.js 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 var mixNumber = function (from, to) { return function (p) { return mix(from, to, p); }; }; 7289 function detectMixerFactory(v) { 7290 if (typeof v === 'number') { 7291 return mixNumber; 7292 } 7293 else if (typeof v === 'string') { 7294 if (color.test(v)) { 7295 return mixColor; 7296 } 7297 else { 7298 return mixComplex; 7299 } 7300 } 7301 else if (Array.isArray(v)) { 7302 return mixArray; 7303 } 7304 else if (typeof v === 'object') { 7305 return mixObject; 7306 } 7307 } 7308 function createMixers(output, ease, customMixer) { 7309 var mixers = []; 7310 var mixerFactory = customMixer || detectMixerFactory(output[0]); 7311 var numMixers = output.length - 1; 7312 for (var i = 0; i < numMixers; i++) { 7313 var mixer = mixerFactory(output[i], output[i + 1]); 7314 if (ease) { 7315 var easingFunction = Array.isArray(ease) ? ease[i] : ease; 7316 mixer = pipe(easingFunction, mixer); 7317 } 7318 mixers.push(mixer); 7319 } 7320 return mixers; 7321 } 7322 function fastInterpolate(_a, _b) { 7323 var from = _a[0], to = _a[1]; 7324 var mixer = _b[0]; 7325 return function (v) { return mixer(progress_progress(from, to, v)); }; 7326 } 7327 function slowInterpolate(input, mixers) { 7328 var inputLength = input.length; 7329 var lastInputIndex = inputLength - 1; 7330 return function (v) { 7331 var mixerIndex = 0; 7332 var foundMixerIndex = false; 7333 if (v <= input[0]) { 7334 foundMixerIndex = true; 7335 } 7336 else if (v >= input[lastInputIndex]) { 7337 mixerIndex = lastInputIndex - 1; 7338 foundMixerIndex = true; 7339 } 7340 if (!foundMixerIndex) { 7341 var i = 1; 7342 for (; i < inputLength; i++) { 7343 if (input[i] > v || i === lastInputIndex) { 7344 break; 7345 } 7346 } 7347 mixerIndex = i - 1; 7348 } 7349 var progressInRange = progress_progress(input[mixerIndex], input[mixerIndex + 1], v); 7350 return mixers[mixerIndex](progressInRange); 7351 }; 7352 } 7353 function interpolate(input, output, _a) { 7354 var _b = _a === void 0 ? {} : _a, _c = _b.clamp, isClamp = _c === void 0 ? true : _c, ease = _b.ease, mixer = _b.mixer; 7355 var inputLength = input.length; 7356 invariant(inputLength === output.length, 'Both input and output ranges must be the same length'); 7357 invariant(!ease || !Array.isArray(ease) || ease.length === inputLength - 1, 'Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values.'); 7358 if (input[0] > input[inputLength - 1]) { 7359 input = [].concat(input); 7360 output = [].concat(output); 7361 input.reverse(); 7362 output.reverse(); 7363 } 7364 var mixers = createMixers(output, ease, mixer); 7365 var interpolator = inputLength === 2 7366 ? fastInterpolate(input, mixers) 7367 : slowInterpolate(input, mixers); 7368 return isClamp 7369 ? function (v) { return interpolator(clamp_clamp(input[0], input[inputLength - 1], v)); } 7370 : interpolator; 7371 } 7372 7373 7374 7375 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/easing/utils.js 7376 var reverseEasing = function (easing) { return function (p) { return 1 - easing(1 - p); }; }; 7377 var mirrorEasing = function (easing) { return function (p) { 7378 return p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; 7379 }; }; 7380 var createExpoIn = function (power) { return function (p) { return Math.pow(p, power); }; }; 7381 var createBackIn = function (power) { return function (p) { 7382 return p * p * ((power + 1) * p - power); 7383 }; }; 7384 var createAnticipate = function (power) { 7385 var backEasing = createBackIn(power); 7386 return function (p) { 7387 return (p *= 2) < 1 7388 ? 0.5 * backEasing(p) 7389 : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); 7390 }; 7391 }; 7392 7393 7394 7395 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/easing/index.js 7396 7397 7398 var DEFAULT_OVERSHOOT_STRENGTH = 1.525; 7399 var BOUNCE_FIRST_THRESHOLD = 4.0 / 11.0; 7400 var BOUNCE_SECOND_THRESHOLD = 8.0 / 11.0; 7401 var BOUNCE_THIRD_THRESHOLD = 9.0 / 10.0; 7402 var linear = function (p) { return p; }; 7403 var easeIn = createExpoIn(2); 7404 var easeOut = reverseEasing(easeIn); 7405 var easeInOut = mirrorEasing(easeIn); 7406 var circIn = function (p) { return 1 - Math.sin(Math.acos(p)); }; 7407 var circOut = reverseEasing(circIn); 7408 var circInOut = mirrorEasing(circOut); 7409 var backIn = createBackIn(DEFAULT_OVERSHOOT_STRENGTH); 7410 var backOut = reverseEasing(backIn); 7411 var backInOut = mirrorEasing(backIn); 7412 var anticipate = createAnticipate(DEFAULT_OVERSHOOT_STRENGTH); 7413 var ca = 4356.0 / 361.0; 7414 var cb = 35442.0 / 1805.0; 7415 var cc = 16061.0 / 1805.0; 7416 var bounceOut = function (p) { 7417 if (p === 1 || p === 0) 7418 return p; 7419 var p2 = p * p; 7420 return p < BOUNCE_FIRST_THRESHOLD 7421 ? 7.5625 * p2 7422 : p < BOUNCE_SECOND_THRESHOLD 7423 ? 9.075 * p2 - 9.9 * p + 3.4 7424 : p < BOUNCE_THIRD_THRESHOLD 7425 ? ca * p2 - cb * p + cc 7426 : 10.8 * p * p - 20.52 * p + 10.72; 7427 }; 7428 var bounceIn = reverseEasing(bounceOut); 7429 var bounceInOut = function (p) { 7430 return p < 0.5 7431 ? 0.5 * (1.0 - bounceOut(1.0 - p * 2.0)) 7432 : 0.5 * bounceOut(p * 2.0 - 1.0) + 0.5; 7433 }; 7434 7435 7436 7437 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/generators/keyframes.js 7438 7439 7440 7441 function defaultEasing(values, easing) { 7442 return values.map(function () { return easing || easeInOut; }).splice(0, values.length - 1); 7443 } 7444 function defaultOffset(values) { 7445 var numValues = values.length; 7446 return values.map(function (_value, i) { 7447 return i !== 0 ? i / (numValues - 1) : 0; 7448 }); 7449 } 7450 function convertOffsetToTimes(offset, duration) { 7451 return offset.map(function (o) { return o * duration; }); 7452 } 7453 function keyframes(_a) { 7454 var _b = _a.from, from = _b === void 0 ? 0 : _b, _c = _a.to, to = _c === void 0 ? 1 : _c, ease = _a.ease, offset = _a.offset, _d = _a.duration, duration = _d === void 0 ? 300 : _d; 7455 var state = { done: false, value: from }; 7456 var values = Array.isArray(to) ? to : [from, to]; 7457 var times = convertOffsetToTimes(offset && offset.length === values.length 7458 ? offset 7459 : defaultOffset(values), duration); 7460 function createInterpolator() { 7461 return interpolate(times, values, { 7462 ease: Array.isArray(ease) ? ease : defaultEasing(values, ease), 7463 }); 7464 } 7465 var interpolator = createInterpolator(); 7466 return { 7467 next: function (t) { 7468 state.value = interpolator(t); 7469 state.done = t >= duration; 7470 return state; 7471 }, 7472 flipTarget: function () { 7473 values.reverse(); 7474 interpolator = createInterpolator(); 7475 }, 7476 }; 7477 } 7478 7479 7480 7481 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/generators/decay.js 7482 function decay(_a) { 7483 var _b = _a.velocity, velocity = _b === void 0 ? 0 : _b, _c = _a.from, from = _c === void 0 ? 0 : _c, _d = _a.power, power = _d === void 0 ? 0.8 : _d, _e = _a.timeConstant, timeConstant = _e === void 0 ? 350 : _e, _f = _a.restDelta, restDelta = _f === void 0 ? 0.5 : _f, modifyTarget = _a.modifyTarget; 7484 var state = { done: false, value: from }; 7485 var amplitude = power * velocity; 7486 var ideal = from + amplitude; 7487 var target = modifyTarget === undefined ? ideal : modifyTarget(ideal); 7488 if (target !== ideal) 7489 amplitude = target - from; 7490 return { 7491 next: function (t) { 7492 var delta = -amplitude * Math.exp(-t / timeConstant); 7493 state.done = !(delta > restDelta || delta < -restDelta); 7494 state.value = state.done ? target : target + delta; 7495 return state; 7496 }, 7497 flipTarget: function () { }, 7498 }; 7499 } 7500 7501 7502 7503 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/utils/detect-animation-from-options.js 7504 7505 7506 7507 7508 var types = { keyframes: keyframes, spring: spring, decay: decay }; 7509 function detectAnimationFromOptions(config) { 7510 if (Array.isArray(config.to)) { 7511 return keyframes; 7512 } 7513 else if (types[config.type]) { 7514 return types[config.type]; 7515 } 7516 var keys = new Set(Object.keys(config)); 7517 if (keys.has("ease") || 7518 (keys.has("duration") && !keys.has("dampingRatio"))) { 7519 return keyframes; 7520 } 7521 else if (keys.has("dampingRatio") || 7522 keys.has("stiffness") || 7523 keys.has("mass") || 7524 keys.has("damping") || 7525 keys.has("restSpeed") || 7526 keys.has("restDelta")) { 7527 return spring; 7528 } 7529 return keyframes; 7530 } 7531 7532 7533 7534 // CONCATENATED MODULE: ./node_modules/framesync/dist/es/on-next-frame.js 7535 var defaultTimestep = (1 / 60) * 1000; 7536 var getCurrentTime = typeof performance !== "undefined" 7537 ? function () { return performance.now(); } 7538 : function () { return Date.now(); }; 7539 var onNextFrame = typeof window !== "undefined" 7540 ? function (callback) { 7541 return window.requestAnimationFrame(callback); 7542 } 7543 : function (callback) { 7544 return setTimeout(function () { return callback(getCurrentTime()); }, defaultTimestep); 7545 }; 7546 7547 7548 7549 // CONCATENATED MODULE: ./node_modules/framesync/dist/es/create-render-step.js 7550 function createRenderStep(runNextFrame) { 7551 var toRun = []; 7552 var toRunNextFrame = []; 7553 var numToRun = 0; 7554 var isProcessing = false; 7555 var toKeepAlive = new WeakSet(); 7556 var step = { 7557 schedule: function (callback, keepAlive, immediate) { 7558 if (keepAlive === void 0) { keepAlive = false; } 7559 if (immediate === void 0) { immediate = false; } 7560 var addToCurrentFrame = immediate && isProcessing; 7561 var buffer = addToCurrentFrame ? toRun : toRunNextFrame; 7562 if (keepAlive) 7563 toKeepAlive.add(callback); 7564 if (buffer.indexOf(callback) === -1) { 7565 buffer.push(callback); 7566 if (addToCurrentFrame && isProcessing) 7567 numToRun = toRun.length; 7568 } 7569 return callback; 7570 }, 7571 cancel: function (callback) { 7572 var index = toRunNextFrame.indexOf(callback); 7573 if (index !== -1) 7574 toRunNextFrame.splice(index, 1); 7575 toKeepAlive.delete(callback); 7576 }, 7577 process: function (frameData) { 7578 var _a; 7579 isProcessing = true; 7580 _a = [toRunNextFrame, toRun], toRun = _a[0], toRunNextFrame = _a[1]; 7581 toRunNextFrame.length = 0; 7582 numToRun = toRun.length; 7583 if (numToRun) { 7584 for (var i = 0; i < numToRun; i++) { 7585 var callback = toRun[i]; 7586 callback(frameData); 7587 if (toKeepAlive.has(callback)) { 7588 step.schedule(callback); 7589 runNextFrame(); 7590 } 7591 } 7592 } 7593 isProcessing = false; 7594 }, 7595 }; 7596 return step; 7597 } 7598 7599 7600 7601 // CONCATENATED MODULE: ./node_modules/framesync/dist/es/index.js 7602 7603 7604 7605 var maxElapsed = 40; 7606 var useDefaultElapsed = true; 7607 var runNextFrame = false; 7608 var isProcessing = false; 7609 var es_frame = { 7610 delta: 0, 7611 timestamp: 0 7612 }; 7613 var stepsOrder = ["read", "update", "preRender", "render", "postRender"]; 7614 var steps = /*#__PURE__*/stepsOrder.reduce(function (acc, key) { 7615 acc[key] = createRenderStep(function () { 7616 return runNextFrame = true; 7617 }); 7618 return acc; 7619 }, {}); 7620 var sync = /*#__PURE__*/stepsOrder.reduce(function (acc, key) { 7621 var step = steps[key]; 7622 acc[key] = function (process, keepAlive, immediate) { 7623 if (keepAlive === void 0) { 7624 keepAlive = false; 7625 } 7626 if (immediate === void 0) { 7627 immediate = false; 7628 } 7629 if (!runNextFrame) startLoop(); 7630 return step.schedule(process, keepAlive, immediate); 7631 }; 7632 return acc; 7633 }, {}); 7634 var cancelSync = /*#__PURE__*/stepsOrder.reduce(function (acc, key) { 7635 acc[key] = steps[key].cancel; 7636 return acc; 7637 }, {}); 7638 var flushSync = /*#__PURE__*/stepsOrder.reduce(function (acc, key) { 7639 acc[key] = function () { 7640 return steps[key].process(es_frame); 7641 }; 7642 return acc; 7643 }, {}); 7644 var processStep = function (stepId) { 7645 return steps[stepId].process(es_frame); 7646 }; 7647 var processFrame = function (timestamp) { 7648 runNextFrame = false; 7649 es_frame.delta = useDefaultElapsed ? defaultTimestep : Math.max(Math.min(timestamp - es_frame.timestamp, maxElapsed), 1); 7650 es_frame.timestamp = timestamp; 7651 isProcessing = true; 7652 stepsOrder.forEach(processStep); 7653 isProcessing = false; 7654 if (runNextFrame) { 7655 useDefaultElapsed = false; 7656 onNextFrame(processFrame); 7657 } 7658 }; 7659 var startLoop = function () { 7660 runNextFrame = true; 7661 useDefaultElapsed = true; 7662 if (!isProcessing) onNextFrame(processFrame); 7663 }; 7664 var getFrameData = function () { 7665 return es_frame; 7666 }; 7667 7668 /* harmony default export */ var es = (sync); 7669 7670 7671 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/utils/elapsed.js 7672 function loopElapsed(elapsed, duration, delay) { 7673 if (delay === void 0) { delay = 0; } 7674 return elapsed - duration - delay; 7675 } 7676 function reverseElapsed(elapsed, duration, delay, isForwardPlayback) { 7677 if (delay === void 0) { delay = 0; } 7678 if (isForwardPlayback === void 0) { isForwardPlayback = true; } 7679 return isForwardPlayback 7680 ? loopElapsed(duration + -elapsed, duration, delay) 7681 : duration - (elapsed - duration) + delay; 7682 } 7683 function hasRepeatDelayElapsed(elapsed, duration, delay, isForwardPlayback) { 7684 return isForwardPlayback ? elapsed >= duration + delay : elapsed <= -delay; 7685 } 7686 7687 7688 7689 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/index.js 7690 7691 7692 7693 7694 7695 7696 var framesync = function (update) { 7697 var passTimestamp = function (_a) { 7698 var delta = _a.delta; 7699 return update(delta); 7700 }; 7701 return { 7702 start: function () { return es.update(passTimestamp, true); }, 7703 stop: function () { return cancelSync.update(passTimestamp); }, 7704 }; 7705 }; 7706 function animations_animate(_a) { 7707 var _b, _c; 7708 var from = _a.from, _d = _a.autoplay, autoplay = _d === void 0 ? true : _d, _e = _a.driver, driver = _e === void 0 ? framesync : _e, _f = _a.elapsed, elapsed = _f === void 0 ? 0 : _f, _g = _a.repeat, repeatMax = _g === void 0 ? 0 : _g, _h = _a.repeatType, repeatType = _h === void 0 ? "loop" : _h, _j = _a.repeatDelay, repeatDelay = _j === void 0 ? 0 : _j, onPlay = _a.onPlay, onStop = _a.onStop, onComplete = _a.onComplete, onRepeat = _a.onRepeat, onUpdate = _a.onUpdate, options = tslib_tslib_es6_rest(_a, ["from", "autoplay", "driver", "elapsed", "repeat", "repeatType", "repeatDelay", "onPlay", "onStop", "onComplete", "onRepeat", "onUpdate"]); 7709 var to = options.to; 7710 var driverControls; 7711 var repeatCount = 0; 7712 var computedDuration = options.duration; 7713 var latest; 7714 var isComplete = false; 7715 var isForwardPlayback = true; 7716 var interpolateFromNumber; 7717 var animator = detectAnimationFromOptions(options); 7718 if ((_c = (_b = animator).needsInterpolation) === null || _c === void 0 ? void 0 : _c.call(_b, from, to)) { 7719 interpolateFromNumber = interpolate([0, 100], [from, to], { 7720 clamp: false, 7721 }); 7722 from = 0; 7723 to = 100; 7724 } 7725 var animation = animator(tslib_tslib_es6_assign(tslib_tslib_es6_assign({}, options), { from: from, to: to })); 7726 function repeat() { 7727 repeatCount++; 7728 if (repeatType === "reverse") { 7729 isForwardPlayback = repeatCount % 2 === 0; 7730 elapsed = reverseElapsed(elapsed, computedDuration, repeatDelay, isForwardPlayback); 7731 } 7732 else { 7733 elapsed = loopElapsed(elapsed, computedDuration, repeatDelay); 7734 if (repeatType === "mirror") 7735 animation.flipTarget(); 7736 } 7737 isComplete = false; 7738 onRepeat && onRepeat(); 7739 } 7740 function complete() { 7741 driverControls.stop(); 7742 onComplete && onComplete(); 7743 } 7744 function update(delta) { 7745 if (!isForwardPlayback) 7746 delta = -delta; 7747 elapsed += delta; 7748 if (!isComplete) { 7749 var state = animation.next(Math.max(0, elapsed)); 7750 latest = state.value; 7751 if (interpolateFromNumber) 7752 latest = interpolateFromNumber(latest); 7753 isComplete = isForwardPlayback ? state.done : elapsed <= 0; 7754 } 7755 onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(latest); 7756 if (isComplete) { 7757 if (repeatCount === 0) 7758 computedDuration !== null && computedDuration !== void 0 ? computedDuration : (computedDuration = elapsed); 7759 if (repeatCount < repeatMax) { 7760 hasRepeatDelayElapsed(elapsed, computedDuration, repeatDelay, isForwardPlayback) && repeat(); 7761 } 7762 else { 7763 complete(); 7764 } 7765 } 7766 } 7767 function play() { 7768 onPlay === null || onPlay === void 0 ? void 0 : onPlay(); 7769 driverControls = driver(update); 7770 driverControls.start(); 7771 } 7772 autoplay && play(); 7773 return { 7774 stop: function () { 7775 onStop === null || onStop === void 0 ? void 0 : onStop(); 7776 driverControls.stop(); 7777 }, 7778 }; 7779 } 7780 7781 7782 7783 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/velocity-per-second.js 7784 function velocityPerSecond(velocity, frameDuration) { 7785 return frameDuration ? velocity * (1000 / frameDuration) : 0; 7786 } 7787 7788 7789 7790 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/inertia.js 7791 7792 7793 7794 7795 7796 function inertia_inertia(_a) { 7797 var _b = _a.from, from = _b === void 0 ? 0 : _b, _c = _a.velocity, velocity = _c === void 0 ? 0 : _c, min = _a.min, max = _a.max, _d = _a.power, power = _d === void 0 ? 0.8 : _d, _e = _a.timeConstant, timeConstant = _e === void 0 ? 750 : _e, _f = _a.bounceStiffness, bounceStiffness = _f === void 0 ? 500 : _f, _g = _a.bounceDamping, bounceDamping = _g === void 0 ? 10 : _g, _h = _a.restDelta, restDelta = _h === void 0 ? 1 : _h, modifyTarget = _a.modifyTarget, driver = _a.driver, onUpdate = _a.onUpdate, onComplete = _a.onComplete; 7798 var currentAnimation; 7799 function isOutOfBounds(v) { 7800 return (min !== undefined && v < min) || (max !== undefined && v > max); 7801 } 7802 function boundaryNearest(v) { 7803 if (min === undefined) 7804 return max; 7805 if (max === undefined) 7806 return min; 7807 return Math.abs(min - v) < Math.abs(max - v) ? min : max; 7808 } 7809 function startAnimation(options) { 7810 currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.stop(); 7811 currentAnimation = animations_animate(tslib_tslib_es6_assign(tslib_tslib_es6_assign({}, options), { driver: driver, onUpdate: function (v) { 7812 var _a; 7813 onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(v); 7814 (_a = options.onUpdate) === null || _a === void 0 ? void 0 : _a.call(options, v); 7815 }, onComplete: onComplete })); 7816 } 7817 function startSpring(options) { 7818 startAnimation(tslib_tslib_es6_assign({ type: "spring", stiffness: bounceStiffness, damping: bounceDamping, restDelta: restDelta }, options)); 7819 } 7820 if (isOutOfBounds(from)) { 7821 startSpring({ from: from, velocity: velocity, to: boundaryNearest(from) }); 7822 } 7823 else { 7824 var target = power * velocity + from; 7825 if (typeof modifyTarget !== "undefined") 7826 target = modifyTarget(target); 7827 var boundary_1 = boundaryNearest(target); 7828 var heading_1 = boundary_1 === min ? -1 : 1; 7829 var prev_1; 7830 var current_1; 7831 var checkBoundary = function (v) { 7832 prev_1 = current_1; 7833 current_1 = v; 7834 velocity = velocityPerSecond(v - prev_1, getFrameData().delta); 7835 if ((heading_1 === 1 && v > boundary_1) || 7836 (heading_1 === -1 && v < boundary_1)) { 7837 startSpring({ from: v, to: boundary_1, velocity: velocity }); 7838 } 7839 }; 7840 startAnimation({ 7841 type: "decay", 7842 from: from, 7843 velocity: velocity, 7844 timeConstant: timeConstant, 7845 power: power, 7846 restDelta: restDelta, 7847 modifyTarget: modifyTarget, 7848 onUpdate: isOutOfBounds(target) ? checkBoundary : undefined, 7849 }); 7850 } 7851 return { 7852 stop: function () { return currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.stop(); }, 7853 }; 7854 } 7855 7856 7857 7858 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/time-conversion.js 7859 /** 7860 * Converts seconds to milliseconds 7861 * 7862 * @param seconds - Time in seconds. 7863 * @return milliseconds - Converted time in milliseconds. 7864 */ 7865 var secondsToMilliseconds = function (seconds) { return seconds * 1000; }; 7866 7867 7868 7869 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/easing/cubic-bezier.js 7870 7871 7872 var cubic_bezier_a = function (a1, a2) { return 1.0 - 3.0 * a2 + 3.0 * a1; }; 7873 var cubic_bezier_b = function (a1, a2) { return 3.0 * a2 - 6.0 * a1; }; 7874 var cubic_bezier_c = function (a1) { return 3.0 * a1; }; 7875 var calcBezier = function (t, a1, a2) { 7876 return ((cubic_bezier_a(a1, a2) * t + cubic_bezier_b(a1, a2)) * t + cubic_bezier_c(a1)) * t; 7877 }; 7878 var getSlope = function (t, a1, a2) { 7879 return 3.0 * cubic_bezier_a(a1, a2) * t * t + 2.0 * cubic_bezier_b(a1, a2) * t + cubic_bezier_c(a1); 7880 }; 7881 var subdivisionPrecision = 0.0000001; 7882 var subdivisionMaxIterations = 10; 7883 function binarySubdivide(aX, aA, aB, mX1, mX2) { 7884 var currentX; 7885 var currentT; 7886 var i = 0; 7887 do { 7888 currentT = aA + (aB - aA) / 2.0; 7889 currentX = calcBezier(currentT, mX1, mX2) - aX; 7890 if (currentX > 0.0) { 7891 aB = currentT; 7892 } 7893 else { 7894 aA = currentT; 7895 } 7896 } while (Math.abs(currentX) > subdivisionPrecision && 7897 ++i < subdivisionMaxIterations); 7898 return currentT; 7899 } 7900 var newtonIterations = 8; 7901 var newtonMinSlope = 0.001; 7902 function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) { 7903 for (var i = 0; i < newtonIterations; ++i) { 7904 var currentSlope = getSlope(aGuessT, mX1, mX2); 7905 if (currentSlope === 0.0) { 7906 return aGuessT; 7907 } 7908 var currentX = calcBezier(aGuessT, mX1, mX2) - aX; 7909 aGuessT -= currentX / currentSlope; 7910 } 7911 return aGuessT; 7912 } 7913 var kSplineTableSize = 11; 7914 var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0); 7915 function cubicBezier(mX1, mY1, mX2, mY2) { 7916 if (mX1 === mY1 && mX2 === mY2) 7917 return linear; 7918 var sampleValues = new Float32Array(kSplineTableSize); 7919 for (var i = 0; i < kSplineTableSize; ++i) { 7920 sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); 7921 } 7922 function getTForX(aX) { 7923 var intervalStart = 0.0; 7924 var currentSample = 1; 7925 var lastSample = kSplineTableSize - 1; 7926 for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) { 7927 intervalStart += kSampleStepSize; 7928 } 7929 --currentSample; 7930 var dist = (aX - sampleValues[currentSample]) / 7931 (sampleValues[currentSample + 1] - sampleValues[currentSample]); 7932 var guessForT = intervalStart + dist * kSampleStepSize; 7933 var initialSlope = getSlope(guessForT, mX1, mX2); 7934 if (initialSlope >= newtonMinSlope) { 7935 return newtonRaphsonIterate(aX, guessForT, mX1, mX2); 7936 } 7937 else if (initialSlope === 0.0) { 7938 return guessForT; 7939 } 7940 else { 7941 return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2); 7942 } 7943 } 7944 return function (t) { 7945 return t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); 7946 }; 7947 } 7948 7949 7950 7951 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/easing.js 7952 7953 7954 7955 7956 var easingLookup = { 7957 linear: linear, 7958 easeIn: easeIn, 7959 easeInOut: easeInOut, 7960 easeOut: easeOut, 7961 circIn: circIn, 7962 circInOut: circInOut, 7963 circOut: circOut, 7964 backIn: backIn, 7965 backInOut: backInOut, 7966 backOut: backOut, 7967 anticipate: anticipate, 7968 bounceIn: bounceIn, 7969 bounceInOut: bounceInOut, 7970 bounceOut: bounceOut, 7971 }; 7972 var easingDefinitionToFunction = function (definition) { 7973 if (Array.isArray(definition)) { 7974 // If cubic bezier definition, create bezier curve 7975 invariant(definition.length === 4, "Cubic bezier arrays must contain four numerical values."); 7976 var _a = __read(definition, 4), x1 = _a[0], y1 = _a[1], x2 = _a[2], y2 = _a[3]; 7977 return cubicBezier(x1, y1, x2, y2); 7978 } 7979 else if (typeof definition === "string") { 7980 // Else lookup from table 7981 invariant(easingLookup[definition] !== undefined, "Invalid easing type '" + definition + "'"); 7982 return easingLookup[definition]; 7983 } 7984 return definition; 7985 }; 7986 var isEasingArray = function (ease) { 7987 return Array.isArray(ease) && typeof ease[0] !== "number"; 7988 }; 7989 7990 7991 7992 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-animatable.js 7993 7994 7995 /** 7996 * Check if a value is animatable. Examples: 7997 * 7998 * ✅: 100, "100px", "#fff" 7999 * ❌: "block", "url(2.jpg)" 8000 * @param value 8001 * 8002 * @internal 8003 */ 8004 var isAnimatable = function (key, value) { 8005 // If the list of keys tat might be non-animatable grows, replace with Set 8006 if (key === "zIndex") 8007 return false; 8008 // If it's a number or a keyframes array, we can animate it. We might at some point 8009 // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, 8010 // but for now lets leave it like this for performance reasons 8011 if (typeof value === "number" || Array.isArray(value)) 8012 return true; 8013 if (typeof value === "string" && // It's animatable if we have a string 8014 complex.test(value) && // And it contains numbers and/or colors 8015 !value.startsWith("url(") // Unless it starts with "url(" 8016 ) { 8017 return true; 8018 } 8019 return false; 8020 }; 8021 8022 8023 8024 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/default-transitions.js 8025 8026 8027 8028 var underDampedSpring = function () { return ({ 8029 type: "spring", 8030 stiffness: 500, 8031 damping: 25, 8032 restDelta: 0.5, 8033 restSpeed: 10, 8034 }); }; 8035 var criticallyDampedSpring = function (to) { return ({ 8036 type: "spring", 8037 stiffness: 550, 8038 damping: to === 0 ? 2 * Math.sqrt(550) : 30, 8039 restDelta: 0.01, 8040 restSpeed: 10, 8041 }); }; 8042 var linearTween = function () { return ({ 8043 type: "keyframes", 8044 ease: "linear", 8045 duration: 0.3, 8046 }); }; 8047 var default_transitions_keyframes = function (values) { return ({ 8048 type: "keyframes", 8049 duration: 0.8, 8050 values: values, 8051 }); }; 8052 var defaultTransitions = { 8053 x: underDampedSpring, 8054 y: underDampedSpring, 8055 z: underDampedSpring, 8056 rotate: underDampedSpring, 8057 rotateX: underDampedSpring, 8058 rotateY: underDampedSpring, 8059 rotateZ: underDampedSpring, 8060 scaleX: criticallyDampedSpring, 8061 scaleY: criticallyDampedSpring, 8062 scale: criticallyDampedSpring, 8063 opacity: linearTween, 8064 backgroundColor: linearTween, 8065 color: linearTween, 8066 default: criticallyDampedSpring, 8067 }; 8068 var getDefaultTransition = function (valueKey, to) { 8069 var transitionFactory; 8070 if (isKeyframesTarget(to)) { 8071 transitionFactory = default_transitions_keyframes; 8072 } 8073 else { 8074 transitionFactory = 8075 defaultTransitions[valueKey] || defaultTransitions.default; 8076 } 8077 return __assign({ to: to }, transitionFactory(to)); 8078 }; 8079 8080 8081 8082 // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/complex/filter.js 8083 8084 8085 8086 8087 var maxDefaults = new Set(['brightness', 'contrast', 'saturate', 'opacity']); 8088 function applyDefaultFilter(v) { 8089 var _a = v.slice(0, -1).split('('), name = _a[0], value = _a[1]; 8090 if (name === 'drop-shadow') 8091 return v; 8092 var number = (value.match(floatRegex) || [])[0]; 8093 if (!number) 8094 return v; 8095 var unit = value.replace(number, ''); 8096 var defaultValue = maxDefaults.has(name) ? 1 : 0; 8097 if (number !== value) 8098 defaultValue *= 100; 8099 return name + '(' + defaultValue + unit + ')'; 8100 } 8101 var functionRegex = /([a-z-]*)\(.*?\)/g; 8102 var filter = tslib_es6_assign(tslib_es6_assign({}, complex), { getAnimatableNone: function (v) { 8103 var functions = v.match(functionRegex); 8104 return functions ? functions.map(applyDefaultFilter).join(' ') : v; 8105 } }); 8106 8107 8108 8109 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/defaults.js 8110 8111 8112 8113 8114 /** 8115 * A map of default value types for common values 8116 */ 8117 var defaultValueTypes = __assign(__assign({}, numberValueTypes), { 8118 // Color props 8119 color: color, backgroundColor: color, outlineColor: color, fill: color, stroke: color, 8120 // Border props 8121 borderColor: color, borderTopColor: color, borderRightColor: color, borderBottomColor: color, borderLeftColor: color, filter: filter, WebkitFilter: filter }); 8122 /** 8123 * Gets the default ValueType for the provided value key 8124 */ 8125 var getDefaultValueType = function (key) { return defaultValueTypes[key]; }; 8126 8127 8128 8129 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.js 8130 8131 8132 8133 function animatable_none_getAnimatableNone(key, value) { 8134 var _a; 8135 var defaultValueType = getDefaultValueType(key); 8136 if (defaultValueType !== filter) 8137 defaultValueType = complex; 8138 // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target 8139 return (_a = defaultValueType.getAnimatableNone) === null || _a === void 0 ? void 0 : _a.call(defaultValueType, value); 8140 } 8141 8142 8143 8144 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/transitions.js 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 /** 8155 * Decide whether a transition is defined on a given Transition. 8156 * This filters out orchestration options and returns true 8157 * if any options are left. 8158 */ 8159 function isTransitionDefined(_a) { 8160 _a.when; _a.delay; _a.delayChildren; _a.staggerChildren; _a.staggerDirection; _a.repeat; _a.repeatType; _a.repeatDelay; _a.from; var transition = __rest(_a, ["when", "delay", "delayChildren", "staggerChildren", "staggerDirection", "repeat", "repeatType", "repeatDelay", "from"]); 8161 return !!Object.keys(transition).length; 8162 } 8163 var legacyRepeatWarning = false; 8164 /** 8165 * Convert Framer Motion's Transition type into Popmotion-compatible options. 8166 */ 8167 function convertTransitionToAnimationOptions(_a) { 8168 var ease = _a.ease, times = _a.times, yoyo = _a.yoyo, flip = _a.flip, loop = _a.loop, transition = __rest(_a, ["ease", "times", "yoyo", "flip", "loop"]); 8169 var options = __assign({}, transition); 8170 if (times) 8171 options["offset"] = times; 8172 /** 8173 * Convert any existing durations from seconds to milliseconds 8174 */ 8175 if (transition.duration) 8176 options["duration"] = secondsToMilliseconds(transition.duration); 8177 if (transition.repeatDelay) 8178 options.repeatDelay = secondsToMilliseconds(transition.repeatDelay); 8179 /** 8180 * Map easing names to Popmotion's easing functions 8181 */ 8182 if (ease) { 8183 options["ease"] = isEasingArray(ease) 8184 ? ease.map(easingDefinitionToFunction) 8185 : easingDefinitionToFunction(ease); 8186 } 8187 /** 8188 * Support legacy transition API 8189 */ 8190 if (transition.type === "tween") 8191 options.type = "keyframes"; 8192 /** 8193 * TODO: These options are officially removed from the API. 8194 */ 8195 if (yoyo || loop || flip) { 8196 warning(!legacyRepeatWarning, "yoyo, loop and flip have been removed from the API. Replace with repeat and repeatType options."); 8197 legacyRepeatWarning = true; 8198 if (yoyo) { 8199 options.repeatType = "reverse"; 8200 } 8201 else if (loop) { 8202 options.repeatType = "loop"; 8203 } 8204 else if (flip) { 8205 options.repeatType = "mirror"; 8206 } 8207 options.repeat = loop || yoyo || flip || transition.repeat; 8208 } 8209 /** 8210 * TODO: Popmotion 9 has the ability to automatically detect whether to use 8211 * a keyframes or spring animation, but does so by detecting velocity and other spring options. 8212 * It'd be good to introduce a similar thing here. 8213 */ 8214 if (transition.type !== "spring") 8215 options.type = "keyframes"; 8216 return options; 8217 } 8218 /** 8219 * Get the delay for a value by checking Transition with decreasing specificity. 8220 */ 8221 function getDelayFromTransition(transition, key) { 8222 var _a; 8223 var valueTransition = getValueTransition(transition, key) || {}; 8224 return (_a = valueTransition.delay) !== null && _a !== void 0 ? _a : 0; 8225 } 8226 function hydrateKeyframes(options) { 8227 if (Array.isArray(options.to) && options.to[0] === null) { 8228 options.to = __spreadArray([], __read(options.to)); 8229 options.to[0] = options.from; 8230 } 8231 return options; 8232 } 8233 function getPopmotionAnimationOptions(transition, options, key) { 8234 var _a; 8235 if (Array.isArray(options.to)) { 8236 (_a = transition.duration) !== null && _a !== void 0 ? _a : (transition.duration = 0.8); 8237 } 8238 hydrateKeyframes(options); 8239 /** 8240 * Get a default transition if none is determined to be defined. 8241 */ 8242 if (!isTransitionDefined(transition)) { 8243 transition = __assign(__assign({}, transition), getDefaultTransition(key, options.to)); 8244 } 8245 return __assign(__assign({}, options), convertTransitionToAnimationOptions(transition)); 8246 } 8247 /** 8248 * 8249 */ 8250 function transitions_getAnimation(key, value, target, transition, onComplete) { 8251 var _a; 8252 var valueTransition = getValueTransition(transition, key); 8253 var origin = (_a = valueTransition.from) !== null && _a !== void 0 ? _a : value.get(); 8254 var isTargetAnimatable = isAnimatable(key, target); 8255 if (origin === "none" && isTargetAnimatable && typeof target === "string") { 8256 /** 8257 * If we're trying to animate from "none", try and get an animatable version 8258 * of the target. This could be improved to work both ways. 8259 */ 8260 origin = animatable_none_getAnimatableNone(key, target); 8261 } 8262 else if (isZero(origin) && typeof target === "string") { 8263 origin = getZeroUnit(target); 8264 } 8265 else if (!Array.isArray(target) && 8266 isZero(target) && 8267 typeof origin === "string") { 8268 target = getZeroUnit(origin); 8269 } 8270 var isOriginAnimatable = isAnimatable(key, origin); 8271 warning(isOriginAnimatable === isTargetAnimatable, "You are trying to animate " + key + " from \"" + origin + "\" to \"" + target + "\". " + origin + " is not an animatable value - to enable this animation set " + origin + " to a value animatable to " + target + " via the `style` property."); 8272 function start() { 8273 var options = { 8274 from: origin, 8275 to: target, 8276 velocity: value.getVelocity(), 8277 onComplete: onComplete, 8278 onUpdate: function (v) { return value.set(v); }, 8279 }; 8280 return valueTransition.type === "inertia" || 8281 valueTransition.type === "decay" 8282 ? inertia_inertia(__assign(__assign({}, options), valueTransition)) 8283 : animations_animate(__assign(__assign({}, getPopmotionAnimationOptions(valueTransition, options, key)), { onUpdate: function (v) { 8284 var _a; 8285 options.onUpdate(v); 8286 (_a = valueTransition.onUpdate) === null || _a === void 0 ? void 0 : _a.call(valueTransition, v); 8287 }, onComplete: function () { 8288 var _a; 8289 options.onComplete(); 8290 (_a = valueTransition.onComplete) === null || _a === void 0 ? void 0 : _a.call(valueTransition); 8291 } })); 8292 } 8293 function set() { 8294 var _a; 8295 value.set(target); 8296 onComplete(); 8297 (_a = valueTransition === null || valueTransition === void 0 ? void 0 : valueTransition.onComplete) === null || _a === void 0 ? void 0 : _a.call(valueTransition); 8298 return { stop: function () { } }; 8299 } 8300 return !isOriginAnimatable || 8301 !isTargetAnimatable || 8302 valueTransition.type === false 8303 ? set 8304 : start; 8305 } 8306 function isZero(value) { 8307 return (value === 0 || 8308 (typeof value === "string" && 8309 parseFloat(value) === 0 && 8310 value.indexOf(" ") === -1)); 8311 } 8312 function getZeroUnit(potentialUnitType) { 8313 return typeof potentialUnitType === "number" 8314 ? 0 8315 : animatable_none_getAnimatableNone("", potentialUnitType); 8316 } 8317 function getValueTransition(transition, key) { 8318 return transition[key] || transition["default"] || transition; 8319 } 8320 /** 8321 * Start animation on a MotionValue. This function is an interface between 8322 * Framer Motion and Popmotion 8323 * 8324 * @internal 8325 */ 8326 function transitions_startAnimation(key, value, target, transition) { 8327 if (transition === void 0) { transition = {}; } 8328 return value.start(function (onComplete) { 8329 var delayTimer; 8330 var controls; 8331 var animation = transitions_getAnimation(key, value, target, transition, onComplete); 8332 var delay = getDelayFromTransition(transition, key); 8333 var start = function () { return (controls = animation()); }; 8334 if (delay) { 8335 delayTimer = setTimeout(start, secondsToMilliseconds(delay)); 8336 } 8337 else { 8338 start(); 8339 } 8340 return function () { 8341 clearTimeout(delayTimer); 8342 controls === null || controls === void 0 ? void 0 : controls.stop(); 8343 }; 8344 }); 8345 } 8346 8347 8348 8349 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-numerical-string.js 8350 /** 8351 * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" 8352 */ 8353 var isNumericalString = function (v) { return /^\-?\d*\.?\d+$/.test(v); }; 8354 8355 8356 8357 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/array.js 8358 function addUniqueItem(arr, item) { 8359 arr.indexOf(item) === -1 && arr.push(item); 8360 } 8361 function removeItem(arr, item) { 8362 var index = arr.indexOf(item); 8363 index > -1 && arr.splice(index, 1); 8364 } 8365 8366 8367 8368 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/subscription-manager.js 8369 8370 8371 var subscription_manager_SubscriptionManager = /** @class */ (function () { 8372 function SubscriptionManager() { 8373 this.subscriptions = []; 8374 } 8375 SubscriptionManager.prototype.add = function (handler) { 8376 var _this = this; 8377 addUniqueItem(this.subscriptions, handler); 8378 return function () { return removeItem(_this.subscriptions, handler); }; 8379 }; 8380 SubscriptionManager.prototype.notify = function (a, b, c) { 8381 var numSubscriptions = this.subscriptions.length; 8382 if (!numSubscriptions) 8383 return; 8384 if (numSubscriptions === 1) { 8385 /** 8386 * If there's only a single handler we can just call it without invoking a loop. 8387 */ 8388 this.subscriptions[0](a, b, c); 8389 } 8390 else { 8391 for (var i = 0; i < numSubscriptions; i++) { 8392 /** 8393 * Check whether the handler exists before firing as it's possible 8394 * the subscriptions were modified during this loop running. 8395 */ 8396 var handler = this.subscriptions[i]; 8397 handler && handler(a, b, c); 8398 } 8399 } 8400 }; 8401 SubscriptionManager.prototype.getSize = function () { 8402 return this.subscriptions.length; 8403 }; 8404 SubscriptionManager.prototype.clear = function () { 8405 this.subscriptions.length = 0; 8406 }; 8407 return SubscriptionManager; 8408 }()); 8409 8410 8411 8412 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/index.js 8413 8414 8415 8416 8417 var isFloat = function (value) { 8418 return !isNaN(parseFloat(value)); 8419 }; 8420 /** 8421 * `MotionValue` is used to track the state and velocity of motion values. 8422 * 8423 * @public 8424 */ 8425 var value_MotionValue = /** @class */ (function () { 8426 /** 8427 * @param init - The initiating value 8428 * @param config - Optional configuration options 8429 * 8430 * - `transformer`: A function to transform incoming values with. 8431 * 8432 * @internal 8433 */ 8434 function MotionValue(init) { 8435 var _this = this; 8436 /** 8437 * Duration, in milliseconds, since last updating frame. 8438 * 8439 * @internal 8440 */ 8441 this.timeDelta = 0; 8442 /** 8443 * Timestamp of the last time this `MotionValue` was updated. 8444 * 8445 * @internal 8446 */ 8447 this.lastUpdated = 0; 8448 /** 8449 * Functions to notify when the `MotionValue` updates. 8450 * 8451 * @internal 8452 */ 8453 this.updateSubscribers = new subscription_manager_SubscriptionManager(); 8454 /** 8455 * Functions to notify when the velocity updates. 8456 * 8457 * @internal 8458 */ 8459 this.velocityUpdateSubscribers = new subscription_manager_SubscriptionManager(); 8460 /** 8461 * Functions to notify when the `MotionValue` updates and `render` is set to `true`. 8462 * 8463 * @internal 8464 */ 8465 this.renderSubscribers = new subscription_manager_SubscriptionManager(); 8466 /** 8467 * Tracks whether this value can output a velocity. Currently this is only true 8468 * if the value is numerical, but we might be able to widen the scope here and support 8469 * other value types. 8470 * 8471 * @internal 8472 */ 8473 this.canTrackVelocity = false; 8474 this.updateAndNotify = function (v, render) { 8475 if (render === void 0) { render = true; } 8476 _this.prev = _this.current; 8477 _this.current = v; 8478 // Update timestamp 8479 var _a = getFrameData(), delta = _a.delta, timestamp = _a.timestamp; 8480 if (_this.lastUpdated !== timestamp) { 8481 _this.timeDelta = delta; 8482 _this.lastUpdated = timestamp; 8483 es.postRender(_this.scheduleVelocityCheck); 8484 } 8485 // Update update subscribers 8486 if (_this.prev !== _this.current) { 8487 _this.updateSubscribers.notify(_this.current); 8488 } 8489 // Update velocity subscribers 8490 if (_this.velocityUpdateSubscribers.getSize()) { 8491 _this.velocityUpdateSubscribers.notify(_this.getVelocity()); 8492 } 8493 // Update render subscribers 8494 if (render) { 8495 _this.renderSubscribers.notify(_this.current); 8496 } 8497 }; 8498 /** 8499 * Schedule a velocity check for the next frame. 8500 * 8501 * This is an instanced and bound function to prevent generating a new 8502 * function once per frame. 8503 * 8504 * @internal 8505 */ 8506 this.scheduleVelocityCheck = function () { return es.postRender(_this.velocityCheck); }; 8507 /** 8508 * Updates `prev` with `current` if the value hasn't been updated this frame. 8509 * This ensures velocity calculations return `0`. 8510 * 8511 * This is an instanced and bound function to prevent generating a new 8512 * function once per frame. 8513 * 8514 * @internal 8515 */ 8516 this.velocityCheck = function (_a) { 8517 var timestamp = _a.timestamp; 8518 if (timestamp !== _this.lastUpdated) { 8519 _this.prev = _this.current; 8520 _this.velocityUpdateSubscribers.notify(_this.getVelocity()); 8521 } 8522 }; 8523 this.hasAnimated = false; 8524 this.prev = this.current = init; 8525 this.canTrackVelocity = isFloat(this.current); 8526 } 8527 /** 8528 * Adds a function that will be notified when the `MotionValue` is updated. 8529 * 8530 * It returns a function that, when called, will cancel the subscription. 8531 * 8532 * When calling `onChange` inside a React component, it should be wrapped with the 8533 * `useEffect` hook. As it returns an unsubscribe function, this should be returned 8534 * from the `useEffect` function to ensure you don't add duplicate subscribers.. 8535 * 8536 * @library 8537 * 8538 * ```jsx 8539 * function MyComponent() { 8540 * const x = useMotionValue(0) 8541 * const y = useMotionValue(0) 8542 * const opacity = useMotionValue(1) 8543 * 8544 * useEffect(() => { 8545 * function updateOpacity() { 8546 * const maxXY = Math.max(x.get(), y.get()) 8547 * const newOpacity = transform(maxXY, [0, 100], [1, 0]) 8548 * opacity.set(newOpacity) 8549 * } 8550 * 8551 * const unsubscribeX = x.onChange(updateOpacity) 8552 * const unsubscribeY = y.onChange(updateOpacity) 8553 * 8554 * return () => { 8555 * unsubscribeX() 8556 * unsubscribeY() 8557 * } 8558 * }, []) 8559 * 8560 * return <Frame x={x} /> 8561 * } 8562 * ``` 8563 * 8564 * @motion 8565 * 8566 * ```jsx 8567 * export const MyComponent = () => { 8568 * const x = useMotionValue(0) 8569 * const y = useMotionValue(0) 8570 * const opacity = useMotionValue(1) 8571 * 8572 * useEffect(() => { 8573 * function updateOpacity() { 8574 * const maxXY = Math.max(x.get(), y.get()) 8575 * const newOpacity = transform(maxXY, [0, 100], [1, 0]) 8576 * opacity.set(newOpacity) 8577 * } 8578 * 8579 * const unsubscribeX = x.onChange(updateOpacity) 8580 * const unsubscribeY = y.onChange(updateOpacity) 8581 * 8582 * return () => { 8583 * unsubscribeX() 8584 * unsubscribeY() 8585 * } 8586 * }, []) 8587 * 8588 * return <motion.div style={{ x }} /> 8589 * } 8590 * ``` 8591 * 8592 * @internalremarks 8593 * 8594 * We could look into a `useOnChange` hook if the above lifecycle management proves confusing. 8595 * 8596 * ```jsx 8597 * useOnChange(x, () => {}) 8598 * ``` 8599 * 8600 * @param subscriber - A function that receives the latest value. 8601 * @returns A function that, when called, will cancel this subscription. 8602 * 8603 * @public 8604 */ 8605 MotionValue.prototype.onChange = function (subscription) { 8606 return this.updateSubscribers.add(subscription); 8607 }; 8608 MotionValue.prototype.clearListeners = function () { 8609 this.updateSubscribers.clear(); 8610 }; 8611 /** 8612 * Adds a function that will be notified when the `MotionValue` requests a render. 8613 * 8614 * @param subscriber - A function that's provided the latest value. 8615 * @returns A function that, when called, will cancel this subscription. 8616 * 8617 * @internal 8618 */ 8619 MotionValue.prototype.onRenderRequest = function (subscription) { 8620 // Render immediately 8621 subscription(this.get()); 8622 return this.renderSubscribers.add(subscription); 8623 }; 8624 /** 8625 * Attaches a passive effect to the `MotionValue`. 8626 * 8627 * @internal 8628 */ 8629 MotionValue.prototype.attach = function (passiveEffect) { 8630 this.passiveEffect = passiveEffect; 8631 }; 8632 /** 8633 * Sets the state of the `MotionValue`. 8634 * 8635 * @remarks 8636 * 8637 * ```jsx 8638 * const x = useMotionValue(0) 8639 * x.set(10) 8640 * ``` 8641 * 8642 * @param latest - Latest value to set. 8643 * @param render - Whether to notify render subscribers. Defaults to `true` 8644 * 8645 * @public 8646 */ 8647 MotionValue.prototype.set = function (v, render) { 8648 if (render === void 0) { render = true; } 8649 if (!render || !this.passiveEffect) { 8650 this.updateAndNotify(v, render); 8651 } 8652 else { 8653 this.passiveEffect(v, this.updateAndNotify); 8654 } 8655 }; 8656 /** 8657 * Returns the latest state of `MotionValue` 8658 * 8659 * @returns - The latest state of `MotionValue` 8660 * 8661 * @public 8662 */ 8663 MotionValue.prototype.get = function () { 8664 return this.current; 8665 }; 8666 /** 8667 * @public 8668 */ 8669 MotionValue.prototype.getPrevious = function () { 8670 return this.prev; 8671 }; 8672 /** 8673 * Returns the latest velocity of `MotionValue` 8674 * 8675 * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. 8676 * 8677 * @public 8678 */ 8679 MotionValue.prototype.getVelocity = function () { 8680 // This could be isFloat(this.prev) && isFloat(this.current), but that would be wasteful 8681 return this.canTrackVelocity 8682 ? // These casts could be avoided if parseFloat would be typed better 8683 velocityPerSecond(parseFloat(this.current) - 8684 parseFloat(this.prev), this.timeDelta) 8685 : 0; 8686 }; 8687 /** 8688 * Registers a new animation to control this `MotionValue`. Only one 8689 * animation can drive a `MotionValue` at one time. 8690 * 8691 * ```jsx 8692 * value.start() 8693 * ``` 8694 * 8695 * @param animation - A function that starts the provided animation 8696 * 8697 * @internal 8698 */ 8699 MotionValue.prototype.start = function (animation) { 8700 var _this = this; 8701 this.stop(); 8702 return new Promise(function (resolve) { 8703 _this.hasAnimated = true; 8704 _this.stopAnimation = animation(resolve); 8705 }).then(function () { return _this.clearAnimation(); }); 8706 }; 8707 /** 8708 * Stop the currently active animation. 8709 * 8710 * @public 8711 */ 8712 MotionValue.prototype.stop = function () { 8713 if (this.stopAnimation) 8714 this.stopAnimation(); 8715 this.clearAnimation(); 8716 }; 8717 /** 8718 * Returns `true` if this value is currently animating. 8719 * 8720 * @public 8721 */ 8722 MotionValue.prototype.isAnimating = function () { 8723 return !!this.stopAnimation; 8724 }; 8725 MotionValue.prototype.clearAnimation = function () { 8726 this.stopAnimation = null; 8727 }; 8728 /** 8729 * Destroy and clean up subscribers to this `MotionValue`. 8730 * 8731 * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically 8732 * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually 8733 * created a `MotionValue` via the `motionValue` function. 8734 * 8735 * @public 8736 */ 8737 MotionValue.prototype.destroy = function () { 8738 this.updateSubscribers.clear(); 8739 this.renderSubscribers.clear(); 8740 this.stop(); 8741 }; 8742 return MotionValue; 8743 }()); 8744 /** 8745 * @internal 8746 */ 8747 function motionValue(init) { 8748 return new value_MotionValue(init); 8749 } 8750 8751 8752 8753 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/test.js 8754 /** 8755 * Tests a provided value against a ValueType 8756 */ 8757 var testValueType = function (v) { return function (type) { return type.test(v); }; }; 8758 8759 8760 8761 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.js 8762 /** 8763 * ValueType for "auto" 8764 */ 8765 var auto = { 8766 test: function (v) { return v === "auto"; }, 8767 parse: function (v) { return v; }, 8768 }; 8769 8770 8771 8772 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.js 8773 8774 8775 8776 8777 /** 8778 * A list of value types commonly used for dimensions 8779 */ 8780 var dimensionValueTypes = [numbers_number, px, percent, degrees, vw, vh, auto]; 8781 /** 8782 * Tests a dimensional value against the list of dimension ValueTypes 8783 */ 8784 var findDimensionValueType = function (v) { 8785 return dimensionValueTypes.find(testValueType(v)); 8786 }; 8787 8788 8789 8790 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/find.js 8791 8792 8793 8794 8795 8796 /** 8797 * A list of all ValueTypes 8798 */ 8799 var valueTypes = __spreadArray(__spreadArray([], __read(dimensionValueTypes)), [color, complex]); 8800 /** 8801 * Tests a value against the list of ValueTypes 8802 */ 8803 var findValueType = function (v) { return valueTypes.find(testValueType(v)); }; 8804 8805 8806 8807 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/setters.js 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 /** 8818 * Set VisualElement's MotionValue, creating a new MotionValue for it if 8819 * it doesn't exist. 8820 */ 8821 function setMotionValue(visualElement, key, value) { 8822 if (visualElement.hasValue(key)) { 8823 visualElement.getValue(key).set(value); 8824 } 8825 else { 8826 visualElement.addValue(key, motionValue(value)); 8827 } 8828 } 8829 function setTarget(visualElement, definition) { 8830 var resolved = resolveVariant(visualElement, definition); 8831 var _a = resolved 8832 ? visualElement.makeTargetAnimatable(resolved, false) 8833 : {}, _b = _a.transitionEnd, transitionEnd = _b === void 0 ? {} : _b; _a.transition; var target = __rest(_a, ["transitionEnd", "transition"]); 8834 target = __assign(__assign({}, target), transitionEnd); 8835 for (var key in target) { 8836 var value = resolveFinalValueInKeyframes(target[key]); 8837 setMotionValue(visualElement, key, value); 8838 } 8839 } 8840 function setVariants(visualElement, variantLabels) { 8841 var reversedLabels = __spreadArray([], __read(variantLabels)).reverse(); 8842 reversedLabels.forEach(function (key) { 8843 var _a; 8844 var variant = visualElement.getVariant(key); 8845 variant && setTarget(visualElement, variant); 8846 (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { 8847 setVariants(child, variantLabels); 8848 }); 8849 }); 8850 } 8851 function setValues(visualElement, definition) { 8852 if (Array.isArray(definition)) { 8853 return setVariants(visualElement, definition); 8854 } 8855 else if (typeof definition === "string") { 8856 return setVariants(visualElement, [definition]); 8857 } 8858 else { 8859 setTarget(visualElement, definition); 8860 } 8861 } 8862 function checkTargetForNewValues(visualElement, target, origin) { 8863 var _a, _b, _c; 8864 var _d; 8865 var newValueKeys = Object.keys(target).filter(function (key) { return !visualElement.hasValue(key); }); 8866 var numNewValues = newValueKeys.length; 8867 if (!numNewValues) 8868 return; 8869 for (var i = 0; i < numNewValues; i++) { 8870 var key = newValueKeys[i]; 8871 var targetValue = target[key]; 8872 var value = null; 8873 /** 8874 * If the target is a series of keyframes, we can use the first value 8875 * in the array. If this first value is null, we'll still need to read from the DOM. 8876 */ 8877 if (Array.isArray(targetValue)) { 8878 value = targetValue[0]; 8879 } 8880 /** 8881 * If the target isn't keyframes, or the first keyframe was null, we need to 8882 * first check if an origin value was explicitly defined in the transition as "from", 8883 * if not read the value from the DOM. As an absolute fallback, take the defined target value. 8884 */ 8885 if (value === null) { 8886 value = (_b = (_a = origin[key]) !== null && _a !== void 0 ? _a : visualElement.readValue(key)) !== null && _b !== void 0 ? _b : target[key]; 8887 } 8888 /** 8889 * If value is still undefined or null, ignore it. Preferably this would throw, 8890 * but this was causing issues in Framer. 8891 */ 8892 if (value === undefined || value === null) 8893 continue; 8894 if (typeof value === "string" && isNumericalString(value)) { 8895 // If this is a number read as a string, ie "0" or "200", convert it to a number 8896 value = parseFloat(value); 8897 } 8898 else if (!findValueType(value) && complex.test(targetValue)) { 8899 value = animatable_none_getAnimatableNone(key, targetValue); 8900 } 8901 visualElement.addValue(key, motionValue(value)); 8902 (_c = (_d = origin)[key]) !== null && _c !== void 0 ? _c : (_d[key] = value); 8903 visualElement.setBaseTarget(key, value); 8904 } 8905 } 8906 function getOriginFromTransition(key, transition) { 8907 if (!transition) 8908 return; 8909 var valueTransition = transition[key] || transition["default"] || transition; 8910 return valueTransition.from; 8911 } 8912 function getOrigin(target, transition, visualElement) { 8913 var _a, _b; 8914 var origin = {}; 8915 for (var key in target) { 8916 origin[key] = 8917 (_a = getOriginFromTransition(key, transition)) !== null && _a !== void 0 ? _a : (_b = visualElement.getValue(key)) === null || _b === void 0 ? void 0 : _b.get(); 8918 } 8919 return origin; 8920 } 8921 8922 8923 8924 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/animation.js 8925 8926 8927 8928 8929 8930 /** 8931 * @internal 8932 */ 8933 function animateVisualElement(visualElement, definition, options) { 8934 if (options === void 0) { options = {}; } 8935 visualElement.notifyAnimationStart(); 8936 var animation; 8937 if (Array.isArray(definition)) { 8938 var animations = definition.map(function (variant) { 8939 return animateVariant(visualElement, variant, options); 8940 }); 8941 animation = Promise.all(animations); 8942 } 8943 else if (typeof definition === "string") { 8944 animation = animateVariant(visualElement, definition, options); 8945 } 8946 else { 8947 var resolvedDefinition = typeof definition === "function" 8948 ? resolveVariant(visualElement, definition, options.custom) 8949 : definition; 8950 animation = animateTarget(visualElement, resolvedDefinition, options); 8951 } 8952 return animation.then(function () { 8953 return visualElement.notifyAnimationComplete(definition); 8954 }); 8955 } 8956 function animateVariant(visualElement, variant, options) { 8957 var _a; 8958 if (options === void 0) { options = {}; } 8959 var resolved = resolveVariant(visualElement, variant, options.custom); 8960 var _b = (resolved || {}).transition, transition = _b === void 0 ? visualElement.getDefaultTransition() || {} : _b; 8961 if (options.transitionOverride) { 8962 transition = options.transitionOverride; 8963 } 8964 /** 8965 * If we have a variant, create a callback that runs it as an animation. 8966 * Otherwise, we resolve a Promise immediately for a composable no-op. 8967 */ 8968 var getAnimation = resolved 8969 ? function () { return animateTarget(visualElement, resolved, options); } 8970 : function () { return Promise.resolve(); }; 8971 /** 8972 * If we have children, create a callback that runs all their animations. 8973 * Otherwise, we resolve a Promise immediately for a composable no-op. 8974 */ 8975 var getChildAnimations = ((_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.size) 8976 ? function (forwardDelay) { 8977 if (forwardDelay === void 0) { forwardDelay = 0; } 8978 var _a = transition.delayChildren, delayChildren = _a === void 0 ? 0 : _a, staggerChildren = transition.staggerChildren, staggerDirection = transition.staggerDirection; 8979 return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options); 8980 } 8981 : function () { return Promise.resolve(); }; 8982 /** 8983 * If the transition explicitly defines a "when" option, we need to resolve either 8984 * this animation or all children animations before playing the other. 8985 */ 8986 var when = transition.when; 8987 if (when) { 8988 var _c = __read(when === "beforeChildren" 8989 ? [getAnimation, getChildAnimations] 8990 : [getChildAnimations, getAnimation], 2), first = _c[0], last = _c[1]; 8991 return first().then(last); 8992 } 8993 else { 8994 return Promise.all([getAnimation(), getChildAnimations(options.delay)]); 8995 } 8996 } 8997 /** 8998 * @internal 8999 */ 9000 function animateTarget(visualElement, definition, _a) { 9001 var _b; 9002 var _c = _a === void 0 ? {} : _a, _d = _c.delay, delay = _d === void 0 ? 0 : _d, transitionOverride = _c.transitionOverride, type = _c.type; 9003 var _e = visualElement.makeTargetAnimatable(definition), _f = _e.transition, transition = _f === void 0 ? visualElement.getDefaultTransition() : _f, transitionEnd = _e.transitionEnd, target = __rest(_e, ["transition", "transitionEnd"]); 9004 if (transitionOverride) 9005 transition = transitionOverride; 9006 var animations = []; 9007 var animationTypeState = type && ((_b = visualElement.animationState) === null || _b === void 0 ? void 0 : _b.getState()[type]); 9008 for (var key in target) { 9009 var value = visualElement.getValue(key); 9010 var valueTarget = target[key]; 9011 if (!value || 9012 valueTarget === undefined || 9013 (animationTypeState && 9014 shouldBlockAnimation(animationTypeState, key))) { 9015 continue; 9016 } 9017 var animation = transitions_startAnimation(key, value, valueTarget, __assign({ delay: delay }, transition)); 9018 animations.push(animation); 9019 } 9020 return Promise.all(animations).then(function () { 9021 transitionEnd && setTarget(visualElement, transitionEnd); 9022 }); 9023 } 9024 function animateChildren(visualElement, variant, delayChildren, staggerChildren, staggerDirection, options) { 9025 if (delayChildren === void 0) { delayChildren = 0; } 9026 if (staggerChildren === void 0) { staggerChildren = 0; } 9027 if (staggerDirection === void 0) { staggerDirection = 1; } 9028 var animations = []; 9029 var maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren; 9030 var generateStaggerDuration = staggerDirection === 1 9031 ? function (i) { 9032 if (i === void 0) { i = 0; } 9033 return i * staggerChildren; 9034 } 9035 : function (i) { 9036 if (i === void 0) { i = 0; } 9037 return maxStaggerDuration - i * staggerChildren; 9038 }; 9039 Array.from(visualElement.variantChildren) 9040 .sort(sortByTreeOrder) 9041 .forEach(function (child, i) { 9042 animations.push(animateVariant(child, variant, __assign(__assign({}, options), { delay: delayChildren + generateStaggerDuration(i) })).then(function () { return child.notifyAnimationComplete(variant); })); 9043 }); 9044 return Promise.all(animations); 9045 } 9046 function stopAnimation(visualElement) { 9047 visualElement.forEachValue(function (value) { return value.stop(); }); 9048 } 9049 function sortByTreeOrder(a, b) { 9050 return a.sortNodePosition(b); 9051 } 9052 /** 9053 * Decide whether we should block this animation. Previously, we achieved this 9054 * just by checking whether the key was listed in protectedKeys, but this 9055 * posed problems if an animation was triggered by afterChildren and protectedKeys 9056 * had been set to true in the meantime. 9057 */ 9058 function shouldBlockAnimation(_a, key) { 9059 var protectedKeys = _a.protectedKeys, needsAnimating = _a.needsAnimating; 9060 var shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; 9061 needsAnimating[key] = false; 9062 return shouldBlock; 9063 } 9064 9065 9066 9067 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/animation-state.js 9068 9069 9070 9071 9072 9073 9074 9075 9076 var variantPriorityOrder = [ 9077 AnimationType.Animate, 9078 AnimationType.Hover, 9079 AnimationType.Tap, 9080 AnimationType.Drag, 9081 AnimationType.Focus, 9082 AnimationType.Exit, 9083 ]; 9084 var reversePriorityOrder = __spreadArray([], __read(variantPriorityOrder)).reverse(); 9085 var numAnimationTypes = variantPriorityOrder.length; 9086 function animateList(visualElement) { 9087 return function (animations) { 9088 return Promise.all(animations.map(function (_a) { 9089 var animation = _a.animation, options = _a.options; 9090 return animateVisualElement(visualElement, animation, options); 9091 })); 9092 }; 9093 } 9094 function createAnimationState(visualElement) { 9095 var animate = animateList(visualElement); 9096 var state = createState(); 9097 var allAnimatedKeys = {}; 9098 var isInitialRender = true; 9099 /** 9100 * This function will be used to reduce the animation definitions for 9101 * each active animation type into an object of resolved values for it. 9102 */ 9103 var buildResolvedTypeValues = function (acc, definition) { 9104 var resolved = resolveVariant(visualElement, definition); 9105 if (resolved) { 9106 resolved.transition; var transitionEnd = resolved.transitionEnd, target = __rest(resolved, ["transition", "transitionEnd"]); 9107 acc = __assign(__assign(__assign({}, acc), target), transitionEnd); 9108 } 9109 return acc; 9110 }; 9111 function isAnimated(key) { 9112 return allAnimatedKeys[key] !== undefined; 9113 } 9114 /** 9115 * This just allows us to inject mocked animation functions 9116 * @internal 9117 */ 9118 function setAnimateFunction(makeAnimator) { 9119 animate = makeAnimator(visualElement); 9120 } 9121 /** 9122 * When we receive new props, we need to: 9123 * 1. Create a list of protected keys for each type. This is a directory of 9124 * value keys that are currently being "handled" by types of a higher priority 9125 * so that whenever an animation is played of a given type, these values are 9126 * protected from being animated. 9127 * 2. Determine if an animation type needs animating. 9128 * 3. Determine if any values have been removed from a type and figure out 9129 * what to animate those to. 9130 */ 9131 function animateChanges(options, changedActiveType) { 9132 var _a; 9133 var props = visualElement.getProps(); 9134 var context = visualElement.getVariantContext(true) || {}; 9135 /** 9136 * A list of animations that we'll build into as we iterate through the animation 9137 * types. This will get executed at the end of the function. 9138 */ 9139 var animations = []; 9140 /** 9141 * Keep track of which values have been removed. Then, as we hit lower priority 9142 * animation types, we can check if they contain removed values and animate to that. 9143 */ 9144 var removedKeys = new Set(); 9145 /** 9146 * A dictionary of all encountered keys. This is an object to let us build into and 9147 * copy it without iteration. Each time we hit an animation type we set its protected 9148 * keys - the keys its not allowed to animate - to the latest version of this object. 9149 */ 9150 var encounteredKeys = {}; 9151 /** 9152 * If a variant has been removed at a given index, and this component is controlling 9153 * variant animations, we want to ensure lower-priority variants are forced to animate. 9154 */ 9155 var removedVariantIndex = Infinity; 9156 var _loop_1 = function (i) { 9157 var type = reversePriorityOrder[i]; 9158 var typeState = state[type]; 9159 var prop = (_a = props[type]) !== null && _a !== void 0 ? _a : context[type]; 9160 var propIsVariant = isVariantLabel(prop); 9161 /** 9162 * If this type has *just* changed isActive status, set activeDelta 9163 * to that status. Otherwise set to null. 9164 */ 9165 var activeDelta = type === changedActiveType ? typeState.isActive : null; 9166 if (activeDelta === false) 9167 removedVariantIndex = i; 9168 /** 9169 * If this prop is an inherited variant, rather than been set directly on the 9170 * component itself, we want to make sure we allow the parent to trigger animations. 9171 * 9172 * TODO: Can probably change this to a !isControllingVariants check 9173 */ 9174 var isInherited = prop === context[type] && prop !== props[type] && propIsVariant; 9175 /** 9176 * 9177 */ 9178 if (isInherited && 9179 isInitialRender && 9180 visualElement.manuallyAnimateOnMount) { 9181 isInherited = false; 9182 } 9183 /** 9184 * Set all encountered keys so far as the protected keys for this type. This will 9185 * be any key that has been animated or otherwise handled by active, higher-priortiy types. 9186 */ 9187 typeState.protectedKeys = __assign({}, encounteredKeys); 9188 // Check if we can skip analysing this prop early 9189 if ( 9190 // If it isn't active and hasn't *just* been set as inactive 9191 (!typeState.isActive && activeDelta === null) || 9192 // If we didn't and don't have any defined prop for this animation type 9193 (!prop && !typeState.prevProp) || 9194 // Or if the prop doesn't define an animation 9195 isAnimationControls(prop) || 9196 typeof prop === "boolean") { 9197 return "continue"; 9198 } 9199 /** 9200 * As we go look through the values defined on this type, if we detect 9201 * a changed value or a value that was removed in a higher priority, we set 9202 * this to true and add this prop to the animation list. 9203 */ 9204 var shouldAnimateType = variantsHaveChanged(typeState.prevProp, prop) || 9205 // If we're making this variant active, we want to always make it active 9206 (type === changedActiveType && 9207 typeState.isActive && 9208 !isInherited && 9209 propIsVariant) || 9210 // If we removed a higher-priority variant (i is in reverse order) 9211 (i > removedVariantIndex && propIsVariant); 9212 /** 9213 * As animations can be set as variant lists, variants or target objects, we 9214 * coerce everything to an array if it isn't one already 9215 */ 9216 var definitionList = Array.isArray(prop) ? prop : [prop]; 9217 /** 9218 * Build an object of all the resolved values. We'll use this in the subsequent 9219 * animateChanges calls to determine whether a value has changed. 9220 */ 9221 var resolvedValues = definitionList.reduce(buildResolvedTypeValues, {}); 9222 if (activeDelta === false) 9223 resolvedValues = {}; 9224 /** 9225 * Now we need to loop through all the keys in the prev prop and this prop, 9226 * and decide: 9227 * 1. If the value has changed, and needs animating 9228 * 2. If it has been removed, and needs adding to the removedKeys set 9229 * 3. If it has been removed in a higher priority type and needs animating 9230 * 4. If it hasn't been removed in a higher priority but hasn't changed, and 9231 * needs adding to the type's protectedKeys list. 9232 */ 9233 var _b = typeState.prevResolvedValues, prevResolvedValues = _b === void 0 ? {} : _b; 9234 var allKeys = __assign(__assign({}, prevResolvedValues), resolvedValues); 9235 var markToAnimate = function (key) { 9236 shouldAnimateType = true; 9237 removedKeys.delete(key); 9238 typeState.needsAnimating[key] = true; 9239 }; 9240 for (var key in allKeys) { 9241 var next = resolvedValues[key]; 9242 var prev = prevResolvedValues[key]; 9243 // If we've already handled this we can just skip ahead 9244 if (encounteredKeys.hasOwnProperty(key)) 9245 continue; 9246 /** 9247 * If the value has changed, we probably want to animate it. 9248 */ 9249 if (next !== prev) { 9250 /** 9251 * If both values are keyframes, we need to shallow compare them to 9252 * detect whether any value has changed. If it has, we animate it. 9253 */ 9254 if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { 9255 if (!shallowCompare(next, prev)) { 9256 markToAnimate(key); 9257 } 9258 else { 9259 /** 9260 * If it hasn't changed, we want to ensure it doesn't animate by 9261 * adding it to the list of protected keys. 9262 */ 9263 typeState.protectedKeys[key] = true; 9264 } 9265 } 9266 else if (next !== undefined) { 9267 // If next is defined and doesn't equal prev, it needs animating 9268 markToAnimate(key); 9269 } 9270 else { 9271 // If it's undefined, it's been removed. 9272 removedKeys.add(key); 9273 } 9274 } 9275 else if (next !== undefined && removedKeys.has(key)) { 9276 /** 9277 * If next hasn't changed and it isn't undefined, we want to check if it's 9278 * been removed by a higher priority 9279 */ 9280 markToAnimate(key); 9281 } 9282 else { 9283 /** 9284 * If it hasn't changed, we add it to the list of protected values 9285 * to ensure it doesn't get animated. 9286 */ 9287 typeState.protectedKeys[key] = true; 9288 } 9289 } 9290 /** 9291 * Update the typeState so next time animateChanges is called we can compare the 9292 * latest prop and resolvedValues to these. 9293 */ 9294 typeState.prevProp = prop; 9295 typeState.prevResolvedValues = resolvedValues; 9296 /** 9297 * 9298 */ 9299 if (typeState.isActive) { 9300 encounteredKeys = __assign(__assign({}, encounteredKeys), resolvedValues); 9301 } 9302 if (isInitialRender && visualElement.blockInitialAnimation) { 9303 shouldAnimateType = false; 9304 } 9305 /** 9306 * If this is an inherited prop we want to hard-block animations 9307 * TODO: Test as this should probably still handle animations triggered 9308 * by removed values? 9309 */ 9310 if (shouldAnimateType && !isInherited) { 9311 animations.push.apply(animations, __spreadArray([], __read(definitionList.map(function (animation) { return ({ 9312 animation: animation, 9313 options: __assign({ type: type }, options), 9314 }); })))); 9315 } 9316 }; 9317 /** 9318 * Iterate through all animation types in reverse priority order. For each, we want to 9319 * detect which values it's handling and whether or not they've changed (and therefore 9320 * need to be animated). If any values have been removed, we want to detect those in 9321 * lower priority props and flag for animation. 9322 */ 9323 for (var i = 0; i < numAnimationTypes; i++) { 9324 _loop_1(i); 9325 } 9326 allAnimatedKeys = __assign({}, encounteredKeys); 9327 /** 9328 * If there are some removed value that haven't been dealt with, 9329 * we need to create a new animation that falls back either to the value 9330 * defined in the style prop, or the last read value. 9331 */ 9332 if (removedKeys.size) { 9333 var fallbackAnimation_1 = {}; 9334 removedKeys.forEach(function (key) { 9335 var fallbackTarget = visualElement.getBaseTarget(key); 9336 if (fallbackTarget !== undefined) { 9337 fallbackAnimation_1[key] = fallbackTarget; 9338 } 9339 }); 9340 animations.push({ animation: fallbackAnimation_1 }); 9341 } 9342 var shouldAnimate = Boolean(animations.length); 9343 if (isInitialRender && 9344 props.initial === false && 9345 !visualElement.manuallyAnimateOnMount) { 9346 shouldAnimate = false; 9347 } 9348 isInitialRender = false; 9349 return shouldAnimate ? animate(animations) : Promise.resolve(); 9350 } 9351 /** 9352 * Change whether a certain animation type is active. 9353 */ 9354 function setActive(type, isActive, options) { 9355 var _a; 9356 // If the active state hasn't changed, we can safely do nothing here 9357 if (state[type].isActive === isActive) 9358 return Promise.resolve(); 9359 // Propagate active change to children 9360 (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { var _a; return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); }); 9361 state[type].isActive = isActive; 9362 return animateChanges(options, type); 9363 } 9364 return { 9365 isAnimated: isAnimated, 9366 animateChanges: animateChanges, 9367 setActive: setActive, 9368 setAnimateFunction: setAnimateFunction, 9369 getState: function () { return state; }, 9370 }; 9371 } 9372 function variantsHaveChanged(prev, next) { 9373 if (typeof next === "string") { 9374 return next !== prev; 9375 } 9376 else if (isVariantLabels(next)) { 9377 return !shallowCompare(next, prev); 9378 } 9379 return false; 9380 } 9381 function createTypeState(isActive) { 9382 if (isActive === void 0) { isActive = false; } 9383 return { 9384 isActive: isActive, 9385 protectedKeys: {}, 9386 needsAnimating: {}, 9387 prevResolvedValues: {}, 9388 }; 9389 } 9390 function createState() { 9391 var _a; 9392 return _a = {}, 9393 _a[AnimationType.Animate] = createTypeState(true), 9394 _a[AnimationType.Hover] = createTypeState(), 9395 _a[AnimationType.Tap] = createTypeState(), 9396 _a[AnimationType.Drag] = createTypeState(), 9397 _a[AnimationType.Focus] = createTypeState(), 9398 _a[AnimationType.Exit] = createTypeState(), 9399 _a; 9400 } 9401 9402 9403 9404 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/animations.js 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 var animations_animations = { 9415 animation: makeRenderlessComponent(function (_a) { 9416 var visualElement = _a.visualElement, animate = _a.animate; 9417 /** 9418 * We dynamically generate the AnimationState manager as it contains a reference 9419 * to the underlying animation library. We only want to load that if we load this, 9420 * so people can optionally code split it out using the `m` component. 9421 */ 9422 visualElement.animationState || (visualElement.animationState = createAnimationState(visualElement)); 9423 /** 9424 * Subscribe any provided AnimationControls to the component's VisualElement 9425 */ 9426 if (isAnimationControls(animate)) { 9427 Object(external_React_["useEffect"])(function () { return animate.subscribe(visualElement); }, [animate]); 9428 } 9429 }), 9430 exit: makeRenderlessComponent(function (props) { 9431 var custom = props.custom, visualElement = props.visualElement; 9432 var _a = __read(usePresence(), 2), isPresent = _a[0], onExitComplete = _a[1]; 9433 var presenceContext = Object(external_React_["useContext"])(PresenceContext); 9434 Object(external_React_["useEffect"])(function () { 9435 var _a, _b; 9436 var animation = (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Exit, !isPresent, { custom: (_b = presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.custom) !== null && _b !== void 0 ? _b : custom }); 9437 !isPresent && (animation === null || animation === void 0 ? void 0 : animation.then(onExitComplete)); 9438 }, [isPresent]); 9439 }), 9440 }; 9441 9442 9443 9444 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/is-point.js 9445 var isPoint = function (point) { 9446 return point.hasOwnProperty('x') && point.hasOwnProperty('y'); 9447 }; 9448 9449 9450 9451 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/is-point-3d.js 9452 9453 9454 var isPoint3D = function (point) { 9455 return isPoint(point) && point.hasOwnProperty('z'); 9456 }; 9457 9458 9459 9460 // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/distance.js 9461 9462 9463 9464 9465 var distance1D = function (a, b) { return Math.abs(a - b); }; 9466 function distance(a, b) { 9467 if (isNum(a) && isNum(b)) { 9468 return distance1D(a, b); 9469 } 9470 else if (isPoint(a) && isPoint(b)) { 9471 var xDelta = distance1D(a.x, b.x); 9472 var yDelta = distance1D(a.y, b.y); 9473 var zDelta = isPoint3D(a) && isPoint3D(b) ? distance1D(a.z, b.z) : 0; 9474 return Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2) + Math.pow(zDelta, 2)); 9475 } 9476 } 9477 9478 9479 9480 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/PanSession.js 9481 9482 9483 9484 9485 9486 9487 9488 9489 /** 9490 * @internal 9491 */ 9492 var PanSession_PanSession = /** @class */ (function () { 9493 function PanSession(event, handlers, _a) { 9494 var _this = this; 9495 var _b = _a === void 0 ? {} : _a, transformPagePoint = _b.transformPagePoint; 9496 /** 9497 * @internal 9498 */ 9499 this.startEvent = null; 9500 /** 9501 * @internal 9502 */ 9503 this.lastMoveEvent = null; 9504 /** 9505 * @internal 9506 */ 9507 this.lastMoveEventInfo = null; 9508 /** 9509 * @internal 9510 */ 9511 this.handlers = {}; 9512 this.updatePoint = function () { 9513 if (!(_this.lastMoveEvent && _this.lastMoveEventInfo)) 9514 return; 9515 var info = getPanInfo(_this.lastMoveEventInfo, _this.history); 9516 var isPanStarted = _this.startEvent !== null; 9517 // Only start panning if the offset is larger than 3 pixels. If we make it 9518 // any larger than this we'll want to reset the pointer history 9519 // on the first update to avoid visual snapping to the cursoe. 9520 var isDistancePastThreshold = distance(info.offset, { x: 0, y: 0 }) >= 3; 9521 if (!isPanStarted && !isDistancePastThreshold) 9522 return; 9523 var point = info.point; 9524 var timestamp = getFrameData().timestamp; 9525 _this.history.push(__assign(__assign({}, point), { timestamp: timestamp })); 9526 var _a = _this.handlers, onStart = _a.onStart, onMove = _a.onMove; 9527 if (!isPanStarted) { 9528 onStart && onStart(_this.lastMoveEvent, info); 9529 _this.startEvent = _this.lastMoveEvent; 9530 } 9531 onMove && onMove(_this.lastMoveEvent, info); 9532 }; 9533 this.handlePointerMove = function (event, info) { 9534 _this.lastMoveEvent = event; 9535 _this.lastMoveEventInfo = PanSession_transformPoint(info, _this.transformPagePoint); 9536 // Because Safari doesn't trigger mouseup events when it's above a `<select>` 9537 if (isMouseEvent(event) && event.buttons === 0) { 9538 _this.handlePointerUp(event, info); 9539 return; 9540 } 9541 // Throttle mouse move event to once per frame 9542 es.update(_this.updatePoint, true); 9543 }; 9544 this.handlePointerUp = function (event, info) { 9545 _this.end(); 9546 var _a = _this.handlers, onEnd = _a.onEnd, onSessionEnd = _a.onSessionEnd; 9547 var panInfo = getPanInfo(PanSession_transformPoint(info, _this.transformPagePoint), _this.history); 9548 if (_this.startEvent && onEnd) { 9549 onEnd(event, panInfo); 9550 } 9551 onSessionEnd && onSessionEnd(event, panInfo); 9552 }; 9553 // If we have more than one touch, don't start detecting this gesture 9554 if (isTouchEvent(event) && event.touches.length > 1) 9555 return; 9556 this.handlers = handlers; 9557 this.transformPagePoint = transformPagePoint; 9558 var info = extractEventInfo(event); 9559 var initialInfo = PanSession_transformPoint(info, this.transformPagePoint); 9560 var point = initialInfo.point; 9561 var timestamp = getFrameData().timestamp; 9562 this.history = [__assign(__assign({}, point), { timestamp: timestamp })]; 9563 var onSessionStart = handlers.onSessionStart; 9564 onSessionStart && 9565 onSessionStart(event, getPanInfo(initialInfo, this.history)); 9566 this.removeListeners = pipe(addPointerEvent(window, "pointermove", this.handlePointerMove), addPointerEvent(window, "pointerup", this.handlePointerUp), addPointerEvent(window, "pointercancel", this.handlePointerUp)); 9567 } 9568 PanSession.prototype.updateHandlers = function (handlers) { 9569 this.handlers = handlers; 9570 }; 9571 PanSession.prototype.end = function () { 9572 this.removeListeners && this.removeListeners(); 9573 cancelSync.update(this.updatePoint); 9574 }; 9575 return PanSession; 9576 }()); 9577 function PanSession_transformPoint(info, transformPagePoint) { 9578 return transformPagePoint ? { point: transformPagePoint(info.point) } : info; 9579 } 9580 function subtractPoint(a, b) { 9581 return { x: a.x - b.x, y: a.y - b.y }; 9582 } 9583 function getPanInfo(_a, history) { 9584 var point = _a.point; 9585 return { 9586 point: point, 9587 delta: subtractPoint(point, lastDevicePoint(history)), 9588 offset: subtractPoint(point, startDevicePoint(history)), 9589 velocity: PanSession_getVelocity(history, 0.1), 9590 }; 9591 } 9592 function startDevicePoint(history) { 9593 return history[0]; 9594 } 9595 function lastDevicePoint(history) { 9596 return history[history.length - 1]; 9597 } 9598 function PanSession_getVelocity(history, timeDelta) { 9599 if (history.length < 2) { 9600 return { x: 0, y: 0 }; 9601 } 9602 var i = history.length - 1; 9603 var timestampedPoint = null; 9604 var lastPoint = lastDevicePoint(history); 9605 while (i >= 0) { 9606 timestampedPoint = history[i]; 9607 if (lastPoint.timestamp - timestampedPoint.timestamp > 9608 secondsToMilliseconds(timeDelta)) { 9609 break; 9610 } 9611 i--; 9612 } 9613 if (!timestampedPoint) { 9614 return { x: 0, y: 0 }; 9615 } 9616 var time = (lastPoint.timestamp - timestampedPoint.timestamp) / 1000; 9617 if (time === 0) { 9618 return { x: 0, y: 0 }; 9619 } 9620 var currentVelocity = { 9621 x: (lastPoint.x - timestampedPoint.x) / time, 9622 y: (lastPoint.y - timestampedPoint.y) / time, 9623 }; 9624 if (currentVelocity.x === Infinity) { 9625 currentVelocity.x = 0; 9626 } 9627 if (currentVelocity.y === Infinity) { 9628 currentVelocity.y = 0; 9629 } 9630 return currentVelocity; 9631 } 9632 9633 9634 9635 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/noop.js 9636 function noop(any) { 9637 return any; 9638 } 9639 9640 9641 9642 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/geometry/index.js 9643 9644 9645 9646 /** 9647 * Bounding boxes tend to be defined as top, left, right, bottom. For various operations 9648 * it's easier to consider each axis individually. This function returns a bounding box 9649 * as a map of single-axis min/max values. 9650 */ 9651 function convertBoundingBoxToAxisBox(_a) { 9652 var top = _a.top, left = _a.left, right = _a.right, bottom = _a.bottom; 9653 return { 9654 x: { min: left, max: right }, 9655 y: { min: top, max: bottom }, 9656 }; 9657 } 9658 function convertAxisBoxToBoundingBox(_a) { 9659 var x = _a.x, y = _a.y; 9660 return { 9661 top: y.min, 9662 bottom: y.max, 9663 left: x.min, 9664 right: x.max, 9665 }; 9666 } 9667 /** 9668 * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function 9669 * provided by Framer to allow measured points to be corrected for device scaling. This is used 9670 * when measuring DOM elements and DOM event points. 9671 */ 9672 function transformBoundingBox(_a, transformPoint) { 9673 var top = _a.top, left = _a.left, bottom = _a.bottom, right = _a.right; 9674 if (transformPoint === void 0) { transformPoint = noop; } 9675 var topLeft = transformPoint({ x: left, y: top }); 9676 var bottomRight = transformPoint({ x: right, y: bottom }); 9677 return { 9678 top: topLeft.y, 9679 left: topLeft.x, 9680 bottom: bottomRight.y, 9681 right: bottomRight.x, 9682 }; 9683 } 9684 /** 9685 * Create an empty axis box of zero size 9686 */ 9687 function axisBox() { 9688 return { x: { min: 0, max: 1 }, y: { min: 0, max: 1 } }; 9689 } 9690 function copyAxisBox(box) { 9691 return { 9692 x: __assign({}, box.x), 9693 y: __assign({}, box.y), 9694 }; 9695 } 9696 /** 9697 * Create an empty box delta 9698 */ 9699 var zeroDelta = { 9700 translate: 0, 9701 scale: 1, 9702 origin: 0, 9703 originPoint: 0, 9704 }; 9705 function geometry_delta() { 9706 return { 9707 x: __assign({}, zeroDelta), 9708 y: __assign({}, zeroDelta), 9709 }; 9710 } 9711 9712 9713 9714 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/each-axis.js 9715 // Call a handler once for each axis 9716 function eachAxis(handler) { 9717 return [handler("x"), handler("y")]; 9718 } 9719 9720 9721 9722 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js 9723 9724 9725 9726 /** 9727 * Apply constraints to a point. These constraints are both physical along an 9728 * axis, and an elastic factor that determines how much to constrain the point 9729 * by if it does lie outside the defined parameters. 9730 */ 9731 function applyConstraints(point, _a, elastic) { 9732 var min = _a.min, max = _a.max; 9733 if (min !== undefined && point < min) { 9734 // If we have a min point defined, and this is outside of that, constrain 9735 point = elastic ? mix(min, point, elastic.min) : Math.max(point, min); 9736 } 9737 else if (max !== undefined && point > max) { 9738 // If we have a max point defined, and this is outside of that, constrain 9739 point = elastic ? mix(max, point, elastic.max) : Math.min(point, max); 9740 } 9741 return point; 9742 } 9743 /** 9744 * Calculates a min projection point based on a pointer, pointer progress 9745 * within the drag target, and constraints. 9746 * 9747 * For instance if an element was 100px width, we were dragging from 0.25 9748 * along this axis, the pointer is at 200px, and there were no constraints, 9749 * we would calculate a min projection point of 175px. 9750 */ 9751 function calcConstrainedMinPoint(point, length, progress, constraints, elastic) { 9752 // Calculate a min point for this axis and apply it to the current pointer 9753 var min = point - length * progress; 9754 return constraints ? applyConstraints(min, constraints, elastic) : min; 9755 } 9756 /** 9757 * Calculate constraints in terms of the viewport when defined relatively to the 9758 * measured axis. This is measured from the nearest edge, so a max constraint of 200 9759 * on an axis with a max value of 300 would return a constraint of 500 - axis length 9760 */ 9761 function calcRelativeAxisConstraints(axis, min, max) { 9762 return { 9763 min: min !== undefined ? axis.min + min : undefined, 9764 max: max !== undefined 9765 ? axis.max + max - (axis.max - axis.min) 9766 : undefined, 9767 }; 9768 } 9769 /** 9770 * Calculate constraints in terms of the viewport when 9771 * defined relatively to the measured bounding box. 9772 */ 9773 function calcRelativeConstraints(layoutBox, _a) { 9774 var top = _a.top, left = _a.left, bottom = _a.bottom, right = _a.right; 9775 return { 9776 x: calcRelativeAxisConstraints(layoutBox.x, left, right), 9777 y: calcRelativeAxisConstraints(layoutBox.y, top, bottom), 9778 }; 9779 } 9780 /** 9781 * Calculate viewport constraints when defined as another viewport-relative axis 9782 */ 9783 function calcViewportAxisConstraints(layoutAxis, constraintsAxis) { 9784 var _a; 9785 var min = constraintsAxis.min - layoutAxis.min; 9786 var max = constraintsAxis.max - layoutAxis.max; 9787 // If the constraints axis is actually smaller than the layout axis then we can 9788 // flip the constraints 9789 if (constraintsAxis.max - constraintsAxis.min < 9790 layoutAxis.max - layoutAxis.min) { 9791 _a = __read([max, min], 2), min = _a[0], max = _a[1]; 9792 } 9793 return { 9794 min: layoutAxis.min + min, 9795 max: layoutAxis.min + max, 9796 }; 9797 } 9798 /** 9799 * Calculate viewport constraints when defined as another viewport-relative box 9800 */ 9801 function calcViewportConstraints(layoutBox, constraintsBox) { 9802 return { 9803 x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x), 9804 y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y), 9805 }; 9806 } 9807 /** 9808 * Calculate the an axis position based on two axes and a progress value. 9809 */ 9810 function calcPositionFromProgress(axis, constraints, progress) { 9811 var axisLength = axis.max - axis.min; 9812 var min = mix(constraints.min, constraints.max - axisLength, progress); 9813 return { min: min, max: min + axisLength }; 9814 } 9815 /** 9816 * Rebase the calculated viewport constraints relative to the layout.min point. 9817 */ 9818 function rebaseAxisConstraints(layout, constraints) { 9819 var relativeConstraints = {}; 9820 if (constraints.min !== undefined) { 9821 relativeConstraints.min = constraints.min - layout.min; 9822 } 9823 if (constraints.max !== undefined) { 9824 relativeConstraints.max = constraints.max - layout.min; 9825 } 9826 return relativeConstraints; 9827 } 9828 var defaultElastic = 0.35; 9829 /** 9830 * Accepts a dragElastic prop and returns resolved elastic values for each axis. 9831 */ 9832 function resolveDragElastic(dragElastic) { 9833 if (dragElastic === false) { 9834 dragElastic = 0; 9835 } 9836 else if (dragElastic === true) { 9837 dragElastic = defaultElastic; 9838 } 9839 return { 9840 x: resolveAxisElastic(dragElastic, "left", "right"), 9841 y: resolveAxisElastic(dragElastic, "top", "bottom"), 9842 }; 9843 } 9844 function resolveAxisElastic(dragElastic, minLabel, maxLabel) { 9845 return { 9846 min: resolvePointElastic(dragElastic, minLabel), 9847 max: resolvePointElastic(dragElastic, maxLabel), 9848 }; 9849 } 9850 function resolvePointElastic(dragElastic, label) { 9851 var _a; 9852 return typeof dragElastic === "number" 9853 ? dragElastic 9854 : (_a = dragElastic[label]) !== null && _a !== void 0 ? _a : 0; 9855 } 9856 9857 9858 9859 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/projection/measure.js 9860 9861 9862 /** 9863 * Measure and return the element bounding box. 9864 * 9865 * We convert the box into an AxisBox2D to make it easier to work with each axis 9866 * individually and programmatically. 9867 * 9868 * This function optionally accepts a transformPagePoint function which allows us to compensate 9869 * for, for instance, measuring the element within a scaled plane like a Framer devivce preview component. 9870 */ 9871 function getBoundingBox(element, transformPagePoint) { 9872 var box = element.getBoundingClientRect(); 9873 return convertBoundingBoxToAxisBox(transformBoundingBox(box, transformPagePoint)); 9874 } 9875 9876 9877 9878 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/geometry/delta-calc.js 9879 9880 9881 var clampProgress = function (v) { return clamp_clamp(0, 1, v); }; 9882 /** 9883 * Returns true if the provided value is within maxDistance of the provided target 9884 */ 9885 function isNear(value, target, maxDistance) { 9886 if (target === void 0) { target = 0; } 9887 if (maxDistance === void 0) { maxDistance = 0.01; } 9888 return distance(value, target) < maxDistance; 9889 } 9890 function calcLength(axis) { 9891 return axis.max - axis.min; 9892 } 9893 /** 9894 * Calculate a transform origin relative to the source axis, between 0-1, that results 9895 * in an asthetically pleasing scale/transform needed to project from source to target. 9896 */ 9897 function delta_calc_calcOrigin(source, target) { 9898 var origin = 0.5; 9899 var sourceLength = calcLength(source); 9900 var targetLength = calcLength(target); 9901 if (targetLength > sourceLength) { 9902 origin = progress_progress(target.min, target.max - sourceLength, source.min); 9903 } 9904 else if (sourceLength > targetLength) { 9905 origin = progress_progress(source.min, source.max - targetLength, target.min); 9906 } 9907 return clampProgress(origin); 9908 } 9909 /** 9910 * Update the AxisDelta with a transform that projects source into target. 9911 * 9912 * The transform `origin` is optional. If not provided, it'll be automatically 9913 * calculated based on the relative positions of the two bounding boxes. 9914 */ 9915 function updateAxisDelta(delta, source, target, origin) { 9916 if (origin === void 0) { origin = 0.5; } 9917 delta.origin = origin; 9918 delta.originPoint = mix(source.min, source.max, delta.origin); 9919 delta.scale = calcLength(target) / calcLength(source); 9920 if (isNear(delta.scale, 1, 0.0001)) 9921 delta.scale = 1; 9922 delta.translate = 9923 mix(target.min, target.max, delta.origin) - delta.originPoint; 9924 if (isNear(delta.translate)) 9925 delta.translate = 0; 9926 } 9927 /** 9928 * Update the BoxDelta with a transform that projects the source into the target. 9929 * 9930 * The transform `origin` is optional. If not provided, it'll be automatically 9931 * calculated based on the relative positions of the two bounding boxes. 9932 */ 9933 function updateBoxDelta(delta, source, target, origin) { 9934 updateAxisDelta(delta.x, source.x, target.x, defaultOrigin(origin.originX)); 9935 updateAxisDelta(delta.y, source.y, target.y, defaultOrigin(origin.originY)); 9936 } 9937 /** 9938 * Currently this only accepts numerical origins, measured as 0-1, but could 9939 * accept pixel values by comparing to the target axis. 9940 */ 9941 function defaultOrigin(origin) { 9942 return typeof origin === "number" ? origin : 0.5; 9943 } 9944 function calcRelativeAxis(target, relative, parent) { 9945 target.min = parent.min + relative.min; 9946 target.max = target.min + calcLength(relative); 9947 } 9948 function calcRelativeBox(projection, parentProjection) { 9949 calcRelativeAxis(projection.target.x, projection.relativeTarget.x, parentProjection.target.x); 9950 calcRelativeAxis(projection.target.y, projection.relativeTarget.y, parentProjection.target.y); 9951 } 9952 9953 9954 9955 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/compare-by-depth.js 9956 var compareByDepth = function (a, b) { 9957 return a.depth - b.depth; 9958 }; 9959 9960 9961 9962 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/projection/utils.js 9963 9964 9965 9966 9967 function isProjecting(visualElement) { 9968 var isEnabled = visualElement.projection.isEnabled; 9969 return isEnabled || visualElement.shouldResetTransform(); 9970 } 9971 function collectProjectingAncestors(visualElement, ancestors) { 9972 if (ancestors === void 0) { ancestors = []; } 9973 var parent = visualElement.parent; 9974 if (parent) 9975 collectProjectingAncestors(parent, ancestors); 9976 if (isProjecting(visualElement)) 9977 ancestors.push(visualElement); 9978 return ancestors; 9979 } 9980 function collectProjectingChildren(visualElement) { 9981 var children = []; 9982 var addChild = function (child) { 9983 if (isProjecting(child)) 9984 children.push(child); 9985 child.children.forEach(addChild); 9986 }; 9987 visualElement.children.forEach(addChild); 9988 return children.sort(compareByDepth); 9989 } 9990 /** 9991 * Update the layoutState by measuring the DOM layout. This 9992 * should be called after resetting any layout-affecting transforms. 9993 */ 9994 function updateLayoutMeasurement(visualElement) { 9995 if (visualElement.shouldResetTransform()) 9996 return; 9997 var layoutState = visualElement.getLayoutState(); 9998 visualElement.notifyBeforeLayoutMeasure(layoutState.layout); 9999 layoutState.isHydrated = true; 10000 layoutState.layout = visualElement.measureViewportBox(); 10001 layoutState.layoutCorrected = copyAxisBox(layoutState.layout); 10002 visualElement.notifyLayoutMeasure(layoutState.layout, visualElement.prevViewportBox || layoutState.layout); 10003 es.update(function () { return visualElement.rebaseProjectionTarget(); }); 10004 } 10005 /** 10006 * Record the viewport box as it was before an expected mutation/re-render 10007 */ 10008 function snapshotViewportBox(visualElement) { 10009 if (visualElement.shouldResetTransform()) 10010 return; 10011 visualElement.prevViewportBox = visualElement.measureViewportBox(false); 10012 /** 10013 * Update targetBox to match the prevViewportBox. This is just to ensure 10014 * that targetBox is affected by scroll in the same way as the measured box 10015 */ 10016 visualElement.rebaseProjectionTarget(false, visualElement.prevViewportBox); 10017 } 10018 10019 10020 10021 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/layout/utils.js 10022 10023 10024 function tweenAxis(target, prev, next, p) { 10025 target.min = mix(prev.min, next.min, p); 10026 target.max = mix(prev.max, next.max, p); 10027 } 10028 function calcRelativeOffsetAxis(parent, child) { 10029 return { 10030 min: child.min - parent.min, 10031 max: child.max - parent.min, 10032 }; 10033 } 10034 function calcRelativeOffset(parent, child) { 10035 return { 10036 x: calcRelativeOffsetAxis(parent.x, child.x), 10037 y: calcRelativeOffsetAxis(parent.y, child.y), 10038 }; 10039 } 10040 function checkIfParentHasChanged(prev, next) { 10041 var prevId = prev.getLayoutId(); 10042 var nextId = next.getLayoutId(); 10043 return prevId !== nextId || (nextId === undefined && prev !== next); 10044 } 10045 10046 10047 10048 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/is-draggable.js 10049 function isDraggable(visualElement) { 10050 var _a = visualElement.getProps(), drag = _a.drag, _dragX = _a._dragX; 10051 return drag && !_dragX; 10052 } 10053 10054 10055 10056 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/geometry/delta-apply.js 10057 10058 10059 10060 10061 /** 10062 * Reset an axis to the provided origin box. 10063 * 10064 * This is a mutative operation. 10065 */ 10066 function resetAxis(axis, originAxis) { 10067 axis.min = originAxis.min; 10068 axis.max = originAxis.max; 10069 } 10070 /** 10071 * Reset a box to the provided origin box. 10072 * 10073 * This is a mutative operation. 10074 */ 10075 function resetBox(box, originBox) { 10076 resetAxis(box.x, originBox.x); 10077 resetAxis(box.y, originBox.y); 10078 } 10079 /** 10080 * Scales a point based on a factor and an originPoint 10081 */ 10082 function scalePoint(point, scale, originPoint) { 10083 var distanceFromOrigin = point - originPoint; 10084 var scaled = scale * distanceFromOrigin; 10085 return originPoint + scaled; 10086 } 10087 /** 10088 * Applies a translate/scale delta to a point 10089 */ 10090 function applyPointDelta(point, translate, scale, originPoint, boxScale) { 10091 if (boxScale !== undefined) { 10092 point = scalePoint(point, boxScale, originPoint); 10093 } 10094 return scalePoint(point, scale, originPoint) + translate; 10095 } 10096 /** 10097 * Applies a translate/scale delta to an axis 10098 */ 10099 function applyAxisDelta(axis, translate, scale, originPoint, boxScale) { 10100 if (translate === void 0) { translate = 0; } 10101 if (scale === void 0) { scale = 1; } 10102 axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); 10103 axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); 10104 } 10105 /** 10106 * Applies a translate/scale delta to a box 10107 */ 10108 function applyBoxDelta(box, _a) { 10109 var x = _a.x, y = _a.y; 10110 applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); 10111 applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); 10112 } 10113 /** 10114 * Apply a transform to an axis from the latest resolved motion values. 10115 * This function basically acts as a bridge between a flat motion value map 10116 * and applyAxisDelta 10117 */ 10118 function applyAxisTransforms(final, axis, transforms, _a) { 10119 var _b = __read(_a, 3), key = _b[0], scaleKey = _b[1], originKey = _b[2]; 10120 // Copy the current axis to the final axis before mutation 10121 final.min = axis.min; 10122 final.max = axis.max; 10123 var axisOrigin = transforms[originKey] !== undefined ? transforms[originKey] : 0.5; 10124 var originPoint = mix(axis.min, axis.max, axisOrigin); 10125 // Apply the axis delta to the final axis 10126 applyAxisDelta(final, transforms[key], transforms[scaleKey], originPoint, transforms.scale); 10127 } 10128 /** 10129 * The names of the motion values we want to apply as translation, scale and origin. 10130 */ 10131 var xKeys = ["x", "scaleX", "originX"]; 10132 var yKeys = ["y", "scaleY", "originY"]; 10133 /** 10134 * Apply a transform to a box from the latest resolved motion values. 10135 */ 10136 function applyBoxTransforms(finalBox, box, transforms) { 10137 applyAxisTransforms(finalBox.x, box.x, transforms, xKeys); 10138 applyAxisTransforms(finalBox.y, box.y, transforms, yKeys); 10139 } 10140 /** 10141 * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse 10142 */ 10143 function removePointDelta(point, translate, scale, originPoint, boxScale) { 10144 point -= translate; 10145 point = scalePoint(point, 1 / scale, originPoint); 10146 if (boxScale !== undefined) { 10147 point = scalePoint(point, 1 / boxScale, originPoint); 10148 } 10149 return point; 10150 } 10151 /** 10152 * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse 10153 */ 10154 function removeAxisDelta(axis, translate, scale, origin, boxScale) { 10155 if (translate === void 0) { translate = 0; } 10156 if (scale === void 0) { scale = 1; } 10157 if (origin === void 0) { origin = 0.5; } 10158 var originPoint = mix(axis.min, axis.max, origin) - translate; 10159 axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale); 10160 axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale); 10161 } 10162 /** 10163 * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse 10164 * and acts as a bridge between motion values and removeAxisDelta 10165 */ 10166 function removeAxisTransforms(axis, transforms, _a) { 10167 var _b = __read(_a, 3), key = _b[0], scaleKey = _b[1], originKey = _b[2]; 10168 removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale); 10169 } 10170 /** 10171 * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse 10172 * and acts as a bridge between motion values and removeAxisDelta 10173 */ 10174 function removeBoxTransforms(box, transforms) { 10175 removeAxisTransforms(box.x, transforms, xKeys); 10176 removeAxisTransforms(box.y, transforms, yKeys); 10177 } 10178 /** 10179 * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms 10180 * in a tree upon our box before then calculating how to project it into our desired viewport-relative box 10181 * 10182 * This is the final nested loop within updateLayoutDelta for future refactoring 10183 */ 10184 function applyTreeDeltas(box, treeScale, treePath) { 10185 var treeLength = treePath.length; 10186 if (!treeLength) 10187 return; 10188 // Reset the treeScale 10189 treeScale.x = treeScale.y = 1; 10190 var node; 10191 var delta; 10192 for (var i = 0; i < treeLength; i++) { 10193 node = treePath[i]; 10194 delta = node.getLayoutState().delta; 10195 // Incoporate each ancestor's scale into a culmulative treeScale for this component 10196 treeScale.x *= delta.x.scale; 10197 treeScale.y *= delta.y.scale; 10198 // Apply each ancestor's calculated delta into this component's recorded layout box 10199 applyBoxDelta(box, delta); 10200 // If this is a draggable ancestor, also incorporate the node's transform to the layout box 10201 if (isDraggable(node)) { 10202 applyBoxTransforms(box, box, node.getLatestValues()); 10203 } 10204 } 10205 } 10206 10207 10208 10209 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/projection/convert-to-relative.js 10210 10211 10212 10213 10214 /** 10215 * Returns a boolean stating whether or not we converted the projection 10216 * to relative projection. 10217 */ 10218 function convertToRelativeProjection(visualElement, isLayoutDrag) { 10219 if (isLayoutDrag === void 0) { isLayoutDrag = true; } 10220 var projectionParent = visualElement.getProjectionParent(); 10221 if (!projectionParent) 10222 return false; 10223 var offset; 10224 if (isLayoutDrag) { 10225 offset = calcRelativeOffset(projectionParent.projection.target, visualElement.projection.target); 10226 removeBoxTransforms(offset, projectionParent.getLatestValues()); 10227 } 10228 else { 10229 offset = calcRelativeOffset(projectionParent.getLayoutState().layout, visualElement.getLayoutState().layout); 10230 } 10231 eachAxis(function (axis) { 10232 return visualElement.setProjectionTargetAxis(axis, offset[axis].min, offset[axis].max, true); 10233 }); 10234 return true; 10235 } 10236 10237 10238 10239 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/batch-layout.js 10240 var unresolvedJobs = new Set(); 10241 function pushJob(stack, job, pointer) { 10242 if (!stack[pointer]) 10243 stack[pointer] = []; 10244 stack[pointer].push(job); 10245 } 10246 function batchLayout(callback) { 10247 unresolvedJobs.add(callback); 10248 return function () { return unresolvedJobs.delete(callback); }; 10249 } 10250 function flushLayout() { 10251 if (!unresolvedJobs.size) 10252 return; 10253 var pointer = 0; 10254 var reads = [[]]; 10255 var writes = []; 10256 var setRead = function (job) { return pushJob(reads, job, pointer); }; 10257 var setWrite = function (job) { 10258 pushJob(writes, job, pointer); 10259 pointer++; 10260 }; 10261 /** 10262 * Resolve jobs into their array stacks 10263 */ 10264 unresolvedJobs.forEach(function (callback) { 10265 callback(setRead, setWrite); 10266 pointer = 0; 10267 }); 10268 unresolvedJobs.clear(); 10269 /** 10270 * Execute jobs 10271 */ 10272 var numStacks = writes.length; 10273 for (var i = 0; i <= numStacks; i++) { 10274 reads[i] && reads[i].forEach(executeJob); 10275 writes[i] && writes[i].forEach(executeJob); 10276 } 10277 } 10278 var executeJob = function (job) { return job(); }; 10279 10280 10281 10282 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303 10304 10305 var elementDragControls = new WeakMap(); 10306 /** 10307 * 10308 */ 10309 var lastPointerEvent; 10310 var VisualElementDragControls_VisualElementDragControls = /** @class */ (function () { 10311 function VisualElementDragControls(_a) { 10312 var visualElement = _a.visualElement; 10313 /** 10314 * Track whether we're currently dragging. 10315 * 10316 * @internal 10317 */ 10318 this.isDragging = false; 10319 /** 10320 * The current direction of drag, or `null` if both. 10321 * 10322 * @internal 10323 */ 10324 this.currentDirection = null; 10325 /** 10326 * The permitted boundaries of travel, in pixels. 10327 * 10328 * @internal 10329 */ 10330 this.constraints = false; 10331 /** 10332 * The per-axis resolved elastic values. 10333 * 10334 * @internal 10335 */ 10336 this.elastic = axisBox(); 10337 /** 10338 * A reference to the host component's latest props. 10339 * 10340 * @internal 10341 */ 10342 this.props = {}; 10343 /** 10344 * @internal 10345 */ 10346 this.hasMutatedConstraints = false; 10347 /** 10348 * Track the initial position of the cursor relative to the dragging element 10349 * when dragging starts as a value of 0-1 on each axis. We then use this to calculate 10350 * an ideal bounding box for the VisualElement renderer to project into every frame. 10351 * 10352 * @internal 10353 */ 10354 this.cursorProgress = { 10355 x: 0.5, 10356 y: 0.5, 10357 }; 10358 // When updating _dragX, or _dragY instead of the VisualElement, 10359 // persist their values between drag gestures. 10360 this.originPoint = {}; 10361 // This is a reference to the global drag gesture lock, ensuring only one component 10362 // can "capture" the drag of one or both axes. 10363 // TODO: Look into moving this into pansession? 10364 this.openGlobalLock = null; 10365 /** 10366 * @internal 10367 */ 10368 this.panSession = null; 10369 this.visualElement = visualElement; 10370 this.visualElement.enableLayoutProjection(); 10371 elementDragControls.set(visualElement, this); 10372 } 10373 /** 10374 * Instantiate a PanSession for the drag gesture 10375 * 10376 * @public 10377 */ 10378 VisualElementDragControls.prototype.start = function (originEvent, _a) { 10379 var _this = this; 10380 var _b = _a === void 0 ? {} : _a, _c = _b.snapToCursor, snapToCursor = _c === void 0 ? false : _c, cursorProgress = _b.cursorProgress; 10381 var onSessionStart = function (event) { 10382 var _a; 10383 // Stop any animations on both axis values immediately. This allows the user to throw and catch 10384 // the component. 10385 _this.stopMotion(); 10386 /** 10387 * Save the initial point. We'll use this to calculate the pointer's position rather 10388 * than the one we receive when the gesture actually starts. By then, the pointer will 10389 * have already moved, and the perception will be of the pointer "slipping" across the element 10390 */ 10391 var initialPoint = getViewportPointFromEvent(event).point; 10392 (_a = _this.cancelLayout) === null || _a === void 0 ? void 0 : _a.call(_this); 10393 _this.cancelLayout = batchLayout(function (read, write) { 10394 var ancestors = collectProjectingAncestors(_this.visualElement); 10395 var children = collectProjectingChildren(_this.visualElement); 10396 var tree = __spreadArray(__spreadArray([], __read(ancestors)), __read(children)); 10397 var hasManuallySetCursorOrigin = false; 10398 /** 10399 * Apply a simple lock to the projection target. This ensures no animations 10400 * can run on the projection box while this lock is active. 10401 */ 10402 _this.isLayoutDrag() && _this.visualElement.lockProjectionTarget(); 10403 write(function () { 10404 tree.forEach(function (element) { return element.resetTransform(); }); 10405 }); 10406 read(function () { 10407 updateLayoutMeasurement(_this.visualElement); 10408 children.forEach(updateLayoutMeasurement); 10409 }); 10410 write(function () { 10411 tree.forEach(function (element) { return element.restoreTransform(); }); 10412 if (snapToCursor) { 10413 hasManuallySetCursorOrigin = _this.snapToCursor(initialPoint); 10414 } 10415 }); 10416 read(function () { 10417 var isRelativeDrag = Boolean(_this.getAxisMotionValue("x") && !_this.isExternalDrag()); 10418 if (!isRelativeDrag) { 10419 _this.visualElement.rebaseProjectionTarget(true, _this.visualElement.measureViewportBox(false)); 10420 } 10421 _this.visualElement.scheduleUpdateLayoutProjection(); 10422 /** 10423 * When dragging starts, we want to find where the cursor is relative to the bounding box 10424 * of the element. Every frame, we calculate a new bounding box using this relative position 10425 * and let the visualElement renderer figure out how to reproject the element into this bounding 10426 * box. 10427 * 10428 * By doing it this way, rather than applying an x/y transform directly to the element, 10429 * we can ensure the component always visually sticks to the cursor as we'd expect, even 10430 * if the DOM element itself changes layout as a result of React updates the user might 10431 * make based on the drag position. 10432 */ 10433 var projection = _this.visualElement.projection; 10434 eachAxis(function (axis) { 10435 if (!hasManuallySetCursorOrigin) { 10436 var _a = projection.target[axis], min = _a.min, max = _a.max; 10437 _this.cursorProgress[axis] = cursorProgress 10438 ? cursorProgress[axis] 10439 : progress_progress(min, max, initialPoint[axis]); 10440 } 10441 /** 10442 * If we have external drag MotionValues, record their origin point. On pointermove 10443 * we'll apply the pan gesture offset directly to this value. 10444 */ 10445 var axisValue = _this.getAxisMotionValue(axis); 10446 if (axisValue) { 10447 _this.originPoint[axis] = axisValue.get(); 10448 } 10449 }); 10450 }); 10451 write(function () { 10452 flushSync.update(); 10453 flushSync.preRender(); 10454 flushSync.render(); 10455 flushSync.postRender(); 10456 }); 10457 read(function () { return _this.resolveDragConstraints(); }); 10458 }); 10459 }; 10460 var onStart = function (event, info) { 10461 var _a, _b, _c; 10462 // Attempt to grab the global drag gesture lock - maybe make this part of PanSession 10463 var _d = _this.props, drag = _d.drag, dragPropagation = _d.dragPropagation; 10464 if (drag && !dragPropagation) { 10465 if (_this.openGlobalLock) 10466 _this.openGlobalLock(); 10467 _this.openGlobalLock = getGlobalLock(drag); 10468 // If we don 't have the lock, don't start dragging 10469 if (!_this.openGlobalLock) 10470 return; 10471 } 10472 flushLayout(); 10473 // Set current drag status 10474 _this.isDragging = true; 10475 _this.currentDirection = null; 10476 // Fire onDragStart event 10477 (_b = (_a = _this.props).onDragStart) === null || _b === void 0 ? void 0 : _b.call(_a, event, info); 10478 (_c = _this.visualElement.animationState) === null || _c === void 0 ? void 0 : _c.setActive(AnimationType.Drag, true); 10479 }; 10480 var onMove = function (event, info) { 10481 var _a, _b, _c, _d; 10482 var _e = _this.props, dragPropagation = _e.dragPropagation, dragDirectionLock = _e.dragDirectionLock; 10483 // If we didn't successfully receive the gesture lock, early return. 10484 if (!dragPropagation && !_this.openGlobalLock) 10485 return; 10486 var offset = info.offset; 10487 // Attempt to detect drag direction if directionLock is true 10488 if (dragDirectionLock && _this.currentDirection === null) { 10489 _this.currentDirection = getCurrentDirection(offset); 10490 // If we've successfully set a direction, notify listener 10491 if (_this.currentDirection !== null) { 10492 (_b = (_a = _this.props).onDirectionLock) === null || _b === void 0 ? void 0 : _b.call(_a, _this.currentDirection); 10493 } 10494 return; 10495 } 10496 // Update each point with the latest position 10497 _this.updateAxis("x", info.point, offset); 10498 _this.updateAxis("y", info.point, offset); 10499 // Fire onDrag event 10500 (_d = (_c = _this.props).onDrag) === null || _d === void 0 ? void 0 : _d.call(_c, event, info); 10501 // Update the last pointer event 10502 lastPointerEvent = event; 10503 }; 10504 var onSessionEnd = function (event, info) { 10505 return _this.stop(event, info); 10506 }; 10507 var transformPagePoint = this.props.transformPagePoint; 10508 this.panSession = new PanSession_PanSession(originEvent, { 10509 onSessionStart: onSessionStart, 10510 onStart: onStart, 10511 onMove: onMove, 10512 onSessionEnd: onSessionEnd, 10513 }, { transformPagePoint: transformPagePoint }); 10514 }; 10515 VisualElementDragControls.prototype.resolveDragConstraints = function () { 10516 var _this = this; 10517 var _a = this.props, dragConstraints = _a.dragConstraints, dragElastic = _a.dragElastic; 10518 var layout = this.visualElement.getLayoutState().layoutCorrected; 10519 if (dragConstraints) { 10520 this.constraints = isRefObject(dragConstraints) 10521 ? this.resolveRefConstraints(layout, dragConstraints) 10522 : calcRelativeConstraints(layout, dragConstraints); 10523 } 10524 else { 10525 this.constraints = false; 10526 } 10527 this.elastic = resolveDragElastic(dragElastic); 10528 /** 10529 * If we're outputting to external MotionValues, we want to rebase the measured constraints 10530 * from viewport-relative to component-relative. 10531 */ 10532 if (this.constraints && !this.hasMutatedConstraints) { 10533 eachAxis(function (axis) { 10534 if (_this.getAxisMotionValue(axis)) { 10535 _this.constraints[axis] = rebaseAxisConstraints(layout[axis], _this.constraints[axis]); 10536 } 10537 }); 10538 } 10539 }; 10540 VisualElementDragControls.prototype.resolveRefConstraints = function (layoutBox, constraints) { 10541 var _a = this.props, onMeasureDragConstraints = _a.onMeasureDragConstraints, transformPagePoint = _a.transformPagePoint; 10542 var constraintsElement = constraints.current; 10543 invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop."); 10544 this.constraintsBox = getBoundingBox(constraintsElement, transformPagePoint); 10545 var measuredConstraints = calcViewportConstraints(layoutBox, this.constraintsBox); 10546 /** 10547 * If there's an onMeasureDragConstraints listener we call it and 10548 * if different constraints are returned, set constraints to that 10549 */ 10550 if (onMeasureDragConstraints) { 10551 var userConstraints = onMeasureDragConstraints(convertAxisBoxToBoundingBox(measuredConstraints)); 10552 this.hasMutatedConstraints = !!userConstraints; 10553 if (userConstraints) { 10554 measuredConstraints = convertBoundingBoxToAxisBox(userConstraints); 10555 } 10556 } 10557 return measuredConstraints; 10558 }; 10559 VisualElementDragControls.prototype.cancelDrag = function () { 10560 var _a, _b; 10561 this.visualElement.unlockProjectionTarget(); 10562 (_a = this.cancelLayout) === null || _a === void 0 ? void 0 : _a.call(this); 10563 this.isDragging = false; 10564 this.panSession && this.panSession.end(); 10565 this.panSession = null; 10566 if (!this.props.dragPropagation && this.openGlobalLock) { 10567 this.openGlobalLock(); 10568 this.openGlobalLock = null; 10569 } 10570 (_b = this.visualElement.animationState) === null || _b === void 0 ? void 0 : _b.setActive(AnimationType.Drag, false); 10571 }; 10572 VisualElementDragControls.prototype.stop = function (event, info) { 10573 var _a, _b, _c; 10574 (_a = this.panSession) === null || _a === void 0 ? void 0 : _a.end(); 10575 this.panSession = null; 10576 var isDragging = this.isDragging; 10577 this.cancelDrag(); 10578 if (!isDragging) 10579 return; 10580 var velocity = info.velocity; 10581 this.animateDragEnd(velocity); 10582 (_c = (_b = this.props).onDragEnd) === null || _c === void 0 ? void 0 : _c.call(_b, event, info); 10583 }; 10584 VisualElementDragControls.prototype.snapToCursor = function (point) { 10585 var _this = this; 10586 return eachAxis(function (axis) { 10587 var drag = _this.props.drag; 10588 // If we're not dragging this axis, do an early return. 10589 if (!shouldDrag(axis, drag, _this.currentDirection)) 10590 return; 10591 var axisValue = _this.getAxisMotionValue(axis); 10592 if (axisValue) { 10593 var box = _this.visualElement.getLayoutState().layout; 10594 var length_1 = box[axis].max - box[axis].min; 10595 var center = box[axis].min + length_1 / 2; 10596 var offset = point[axis] - center; 10597 _this.originPoint[axis] = point[axis]; 10598 axisValue.set(offset); 10599 } 10600 else { 10601 _this.cursorProgress[axis] = 0.5; 10602 return true; 10603 } 10604 }).includes(true); 10605 }; 10606 /** 10607 * Update the specified axis with the latest pointer information. 10608 */ 10609 VisualElementDragControls.prototype.updateAxis = function (axis, point, offset) { 10610 var drag = this.props.drag; 10611 // If we're not dragging this axis, do an early return. 10612 if (!shouldDrag(axis, drag, this.currentDirection)) 10613 return; 10614 return this.getAxisMotionValue(axis) 10615 ? this.updateAxisMotionValue(axis, offset) 10616 : this.updateVisualElementAxis(axis, point); 10617 }; 10618 VisualElementDragControls.prototype.updateAxisMotionValue = function (axis, offset) { 10619 var axisValue = this.getAxisMotionValue(axis); 10620 if (!offset || !axisValue) 10621 return; 10622 var nextValue = this.originPoint[axis] + offset[axis]; 10623 var update = this.constraints 10624 ? applyConstraints(nextValue, this.constraints[axis], this.elastic[axis]) 10625 : nextValue; 10626 axisValue.set(update); 10627 }; 10628 VisualElementDragControls.prototype.updateVisualElementAxis = function (axis, point) { 10629 var _a; 10630 // Get the actual layout bounding box of the element 10631 var axisLayout = this.visualElement.getLayoutState().layout[axis]; 10632 // Calculate its current length. In the future we might want to lerp this to animate 10633 // between lengths if the layout changes as we change the DOM 10634 var axisLength = axisLayout.max - axisLayout.min; 10635 // Get the initial progress that the pointer sat on this axis on gesture start. 10636 var axisProgress = this.cursorProgress[axis]; 10637 // Calculate a new min point based on the latest pointer position, constraints and elastic 10638 var min = calcConstrainedMinPoint(point[axis], axisLength, axisProgress, (_a = this.constraints) === null || _a === void 0 ? void 0 : _a[axis], this.elastic[axis]); 10639 // Update the axis viewport target with this new min and the length 10640 this.visualElement.setProjectionTargetAxis(axis, min, min + axisLength); 10641 }; 10642 VisualElementDragControls.prototype.setProps = function (_a) { 10643 var _b = _a.drag, drag = _b === void 0 ? false : _b, _c = _a.dragDirectionLock, dragDirectionLock = _c === void 0 ? false : _c, _d = _a.dragPropagation, dragPropagation = _d === void 0 ? false : _d, _e = _a.dragConstraints, dragConstraints = _e === void 0 ? false : _e, _f = _a.dragElastic, dragElastic = _f === void 0 ? defaultElastic : _f, _g = _a.dragMomentum, dragMomentum = _g === void 0 ? true : _g, remainingProps = __rest(_a, ["drag", "dragDirectionLock", "dragPropagation", "dragConstraints", "dragElastic", "dragMomentum"]); 10644 this.props = __assign({ drag: drag, 10645 dragDirectionLock: dragDirectionLock, 10646 dragPropagation: dragPropagation, 10647 dragConstraints: dragConstraints, 10648 dragElastic: dragElastic, 10649 dragMomentum: dragMomentum }, remainingProps); 10650 }; 10651 /** 10652 * Drag works differently depending on which props are provided. 10653 * 10654 * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values. 10655 * - If the component will perform layout animations, we output the gesture to the component's 10656 * visual bounding box 10657 * - Otherwise, we apply the delta to the x/y motion values. 10658 */ 10659 VisualElementDragControls.prototype.getAxisMotionValue = function (axis) { 10660 var _a = this.props, layout = _a.layout, layoutId = _a.layoutId; 10661 var dragKey = "_drag" + axis.toUpperCase(); 10662 if (this.props[dragKey]) { 10663 return this.props[dragKey]; 10664 } 10665 else if (!layout && layoutId === undefined) { 10666 return this.visualElement.getValue(axis, 0); 10667 } 10668 }; 10669 VisualElementDragControls.prototype.isLayoutDrag = function () { 10670 return !this.getAxisMotionValue("x"); 10671 }; 10672 VisualElementDragControls.prototype.isExternalDrag = function () { 10673 var _a = this.props, _dragX = _a._dragX, _dragY = _a._dragY; 10674 return _dragX || _dragY; 10675 }; 10676 VisualElementDragControls.prototype.animateDragEnd = function (velocity) { 10677 var _this = this; 10678 var _a = this.props, drag = _a.drag, dragMomentum = _a.dragMomentum, dragElastic = _a.dragElastic, dragTransition = _a.dragTransition; 10679 /** 10680 * Everything beyond the drag gesture should be performed with 10681 * relative projection so children stay in sync with their parent element. 10682 */ 10683 var isRelative = convertToRelativeProjection(this.visualElement, this.isLayoutDrag() && !this.isExternalDrag()); 10684 /** 10685 * If we had previously resolved constraints relative to the viewport, 10686 * we need to also convert those to a relative coordinate space for the animation 10687 */ 10688 var constraints = this.constraints || {}; 10689 if (isRelative && 10690 Object.keys(constraints).length && 10691 this.isLayoutDrag()) { 10692 var projectionParent = this.visualElement.getProjectionParent(); 10693 if (projectionParent) { 10694 var relativeConstraints_1 = calcRelativeOffset(projectionParent.projection.targetFinal, constraints); 10695 eachAxis(function (axis) { 10696 var _a = relativeConstraints_1[axis], min = _a.min, max = _a.max; 10697 constraints[axis] = { 10698 min: isNaN(min) ? undefined : min, 10699 max: isNaN(max) ? undefined : max, 10700 }; 10701 }); 10702 } 10703 } 10704 var momentumAnimations = eachAxis(function (axis) { 10705 var _a; 10706 if (!shouldDrag(axis, drag, _this.currentDirection)) { 10707 return; 10708 } 10709 var transition = (_a = constraints === null || constraints === void 0 ? void 0 : constraints[axis]) !== null && _a !== void 0 ? _a : {}; 10710 /** 10711 * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame 10712 * of spring animations so we should look into adding a disable spring option to `inertia`. 10713 * We could do something here where we affect the `bounceStiffness` and `bounceDamping` 10714 * using the value of `dragElastic`. 10715 */ 10716 var bounceStiffness = dragElastic ? 200 : 1000000; 10717 var bounceDamping = dragElastic ? 40 : 10000000; 10718 var inertia = __assign(__assign({ type: "inertia", velocity: dragMomentum ? velocity[axis] : 0, bounceStiffness: bounceStiffness, 10719 bounceDamping: bounceDamping, timeConstant: 750, restDelta: 1, restSpeed: 10 }, dragTransition), transition); 10720 // If we're not animating on an externally-provided `MotionValue` we can use the 10721 // component's animation controls which will handle interactions with whileHover (etc), 10722 // otherwise we just have to animate the `MotionValue` itself. 10723 return _this.getAxisMotionValue(axis) 10724 ? _this.startAxisValueAnimation(axis, inertia) 10725 : _this.visualElement.startLayoutAnimation(axis, inertia, isRelative); 10726 }); 10727 // Run all animations and then resolve the new drag constraints. 10728 return Promise.all(momentumAnimations).then(function () { 10729 var _a, _b; 10730 (_b = (_a = _this.props).onDragTransitionEnd) === null || _b === void 0 ? void 0 : _b.call(_a); 10731 }); 10732 }; 10733 VisualElementDragControls.prototype.stopMotion = function () { 10734 var _this = this; 10735 eachAxis(function (axis) { 10736 var axisValue = _this.getAxisMotionValue(axis); 10737 axisValue 10738 ? axisValue.stop() 10739 : _this.visualElement.stopLayoutAnimation(); 10740 }); 10741 }; 10742 VisualElementDragControls.prototype.startAxisValueAnimation = function (axis, transition) { 10743 var axisValue = this.getAxisMotionValue(axis); 10744 if (!axisValue) 10745 return; 10746 var currentValue = axisValue.get(); 10747 axisValue.set(currentValue); 10748 axisValue.set(currentValue); // Set twice to hard-reset velocity 10749 return transitions_startAnimation(axis, axisValue, 0, transition); 10750 }; 10751 VisualElementDragControls.prototype.scalePoint = function () { 10752 var _this = this; 10753 var _a = this.props, drag = _a.drag, dragConstraints = _a.dragConstraints; 10754 if (!isRefObject(dragConstraints) || !this.constraintsBox) 10755 return; 10756 // Stop any current animations as there can be some visual glitching if we resize mid animation 10757 this.stopMotion(); 10758 // Record the relative progress of the targetBox relative to the constraintsBox 10759 var boxProgress = { x: 0, y: 0 }; 10760 eachAxis(function (axis) { 10761 boxProgress[axis] = delta_calc_calcOrigin(_this.visualElement.projection.target[axis], _this.constraintsBox[axis]); 10762 }); 10763 /** 10764 * For each axis, calculate the current progress of the layout axis within the constraints. 10765 * Then, using the latest layout and constraints measurements, reposition the new layout axis 10766 * proportionally within the constraints. 10767 */ 10768 this.updateConstraints(function () { 10769 eachAxis(function (axis) { 10770 if (!shouldDrag(axis, drag, null)) 10771 return; 10772 // Calculate the position of the targetBox relative to the constraintsBox using the 10773 // previously calculated progress 10774 var _a = calcPositionFromProgress(_this.visualElement.projection.target[axis], _this.constraintsBox[axis], boxProgress[axis]), min = _a.min, max = _a.max; 10775 _this.visualElement.setProjectionTargetAxis(axis, min, max); 10776 }); 10777 }); 10778 /** 10779 * If any other draggable components are queuing the same tasks synchronously 10780 * this will wait until they've all been scheduled before flushing. 10781 */ 10782 setTimeout(flushLayout, 1); 10783 }; 10784 VisualElementDragControls.prototype.updateConstraints = function (onReady) { 10785 var _this = this; 10786 this.cancelLayout = batchLayout(function (read, write) { 10787 var ancestors = collectProjectingAncestors(_this.visualElement); 10788 write(function () { 10789 return ancestors.forEach(function (element) { return element.resetTransform(); }); 10790 }); 10791 read(function () { return updateLayoutMeasurement(_this.visualElement); }); 10792 write(function () { 10793 return ancestors.forEach(function (element) { return element.restoreTransform(); }); 10794 }); 10795 read(function () { 10796 _this.resolveDragConstraints(); 10797 }); 10798 if (onReady) 10799 write(onReady); 10800 }); 10801 }; 10802 VisualElementDragControls.prototype.mount = function (visualElement) { 10803 var _this = this; 10804 var element = visualElement.getInstance(); 10805 /** 10806 * Attach a pointerdown event listener on this DOM element to initiate drag tracking. 10807 */ 10808 var stopPointerListener = addPointerEvent(element, "pointerdown", function (event) { 10809 var _a = _this.props, drag = _a.drag, _b = _a.dragListener, dragListener = _b === void 0 ? true : _b; 10810 drag && dragListener && _this.start(event); 10811 }); 10812 /** 10813 * Attach a window resize listener to scale the draggable target within its defined 10814 * constraints as the window resizes. 10815 */ 10816 var stopResizeListener = addDomEvent(window, "resize", function () { 10817 _this.scalePoint(); 10818 }); 10819 /** 10820 * Ensure drag constraints are resolved correctly relative to the dragging element 10821 * whenever its layout changes. 10822 */ 10823 var stopLayoutUpdateListener = visualElement.onLayoutUpdate(function () { 10824 if (_this.isDragging) { 10825 _this.resolveDragConstraints(); 10826 } 10827 }); 10828 /** 10829 * If the previous component with this same layoutId was dragging at the time 10830 * it was unmounted, we want to continue the same gesture on this component. 10831 */ 10832 var prevDragCursor = visualElement.prevDragCursor; 10833 if (prevDragCursor) { 10834 this.start(lastPointerEvent, { cursorProgress: prevDragCursor }); 10835 } 10836 /** 10837 * Return a function that will teardown the drag gesture 10838 */ 10839 return function () { 10840 stopPointerListener === null || stopPointerListener === void 0 ? void 0 : stopPointerListener(); 10841 stopResizeListener === null || stopResizeListener === void 0 ? void 0 : stopResizeListener(); 10842 stopLayoutUpdateListener === null || stopLayoutUpdateListener === void 0 ? void 0 : stopLayoutUpdateListener(); 10843 _this.cancelDrag(); 10844 }; 10845 }; 10846 return VisualElementDragControls; 10847 }()); 10848 function shouldDrag(direction, drag, currentDirection) { 10849 return ((drag === true || drag === direction) && 10850 (currentDirection === null || currentDirection === direction)); 10851 } 10852 /** 10853 * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower 10854 * than the provided threshold, return `null`. 10855 * 10856 * @param offset - The x/y offset from origin. 10857 * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction. 10858 */ 10859 function getCurrentDirection(offset, lockThreshold) { 10860 if (lockThreshold === void 0) { lockThreshold = 10; } 10861 var direction = null; 10862 if (Math.abs(offset.y) > lockThreshold) { 10863 direction = "y"; 10864 } 10865 else if (Math.abs(offset.x) > lockThreshold) { 10866 direction = "x"; 10867 } 10868 return direction; 10869 } 10870 10871 10872 10873 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/use-drag.js 10874 10875 10876 10877 10878 10879 10880 /** 10881 * A hook that allows an element to be dragged. 10882 * 10883 * @internal 10884 */ 10885 function useDrag(props) { 10886 var groupDragControls = props.dragControls, visualElement = props.visualElement; 10887 var transformPagePoint = Object(external_React_["useContext"])(MotionConfigContext).transformPagePoint; 10888 var dragControls = useConstant(function () { 10889 return new VisualElementDragControls_VisualElementDragControls({ 10890 visualElement: visualElement, 10891 }); 10892 }); 10893 dragControls.setProps(__assign(__assign({}, props), { transformPagePoint: transformPagePoint })); 10894 // If we've been provided a DragControls for manual control over the drag gesture, 10895 // subscribe this component to it on mount. 10896 Object(external_React_["useEffect"])(function () { return groupDragControls && groupDragControls.subscribe(dragControls); }, [dragControls]); 10897 // Mount the drag controls with the visualElement 10898 Object(external_React_["useEffect"])(function () { return dragControls.mount(visualElement); }, []); 10899 } 10900 10901 10902 10903 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-pan-gesture.js 10904 10905 10906 10907 10908 10909 10910 /** 10911 * 10912 * @param handlers - 10913 * @param ref - 10914 * 10915 * @internalremarks 10916 * Currently this sets new pan gesture functions every render. The memo route has been explored 10917 * in the past but ultimately we're still creating new functions every render. An optimisation 10918 * to explore is creating the pan gestures and loading them into a `ref`. 10919 * 10920 * @internal 10921 */ 10922 function usePanGesture(_a) { 10923 var onPan = _a.onPan, onPanStart = _a.onPanStart, onPanEnd = _a.onPanEnd, onPanSessionStart = _a.onPanSessionStart, visualElement = _a.visualElement; 10924 var hasPanEvents = onPan || onPanStart || onPanEnd || onPanSessionStart; 10925 var panSession = Object(external_React_["useRef"])(null); 10926 var transformPagePoint = Object(external_React_["useContext"])(MotionConfigContext).transformPagePoint; 10927 var handlers = { 10928 onSessionStart: onPanSessionStart, 10929 onStart: onPanStart, 10930 onMove: onPan, 10931 onEnd: function (event, info) { 10932 panSession.current = null; 10933 onPanEnd && onPanEnd(event, info); 10934 }, 10935 }; 10936 Object(external_React_["useEffect"])(function () { 10937 if (panSession.current !== null) { 10938 panSession.current.updateHandlers(handlers); 10939 } 10940 }); 10941 function onPointerDown(event) { 10942 panSession.current = new PanSession_PanSession(event, handlers, { 10943 transformPagePoint: transformPagePoint, 10944 }); 10945 } 10946 usePointerEvent(visualElement, "pointerdown", hasPanEvents && onPointerDown); 10947 useUnmountEffect(function () { return panSession.current && panSession.current.end(); }); 10948 } 10949 10950 10951 10952 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/drag.js 10953 10954 10955 10956 10957 var drag_drag = { 10958 pan: makeRenderlessComponent(usePanGesture), 10959 drag: makeRenderlessComponent(useDrag), 10960 }; 10961 10962 10963 10964 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/AnimateSharedLayout/types.js 10965 /** 10966 * @public 10967 */ 10968 var Presence; 10969 (function (Presence) { 10970 Presence[Presence["Entering"] = 0] = "Entering"; 10971 Presence[Presence["Present"] = 1] = "Present"; 10972 Presence[Presence["Exiting"] = 2] = "Exiting"; 10973 })(Presence || (Presence = {})); 10974 /** 10975 * @public 10976 */ 10977 var VisibilityAction; 10978 (function (VisibilityAction) { 10979 VisibilityAction[VisibilityAction["Hide"] = 0] = "Hide"; 10980 VisibilityAction[VisibilityAction["Show"] = 1] = "Show"; 10981 })(VisibilityAction || (VisibilityAction = {})); 10982 10983 10984 10985 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.js 10986 10987 10988 10989 function css_variables_conversion_isCSSVariable(value) { 10990 return typeof value === "string" && value.startsWith("var(--"); 10991 } 10992 /** 10993 * Parse Framer's special CSS variable format into a CSS token and a fallback. 10994 * 10995 * ``` 10996 * `var(--foo, #fff)` => [`--foo`, '#fff'] 10997 * ``` 10998 * 10999 * @param current 11000 */ 11001 var cssVariableRegex = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/; 11002 function parseCSSVariable(current) { 11003 var match = cssVariableRegex.exec(current); 11004 if (!match) 11005 return [,]; 11006 var _a = __read(match, 3), token = _a[1], fallback = _a[2]; 11007 return [token, fallback]; 11008 } 11009 var maxDepth = 4; 11010 function getVariableValue(current, element, depth) { 11011 if (depth === void 0) { depth = 1; } 11012 invariant(depth <= maxDepth, "Max CSS variable fallback depth detected in property \"" + current + "\". This may indicate a circular fallback dependency."); 11013 var _a = __read(parseCSSVariable(current), 2), token = _a[0], fallback = _a[1]; 11014 // No CSS variable detected 11015 if (!token) 11016 return; 11017 // Attempt to read this CSS variable off the element 11018 var resolved = window.getComputedStyle(element).getPropertyValue(token); 11019 if (resolved) { 11020 return resolved.trim(); 11021 } 11022 else if (css_variables_conversion_isCSSVariable(fallback)) { 11023 // The fallback might itself be a CSS variable, in which case we attempt to resolve it too. 11024 return getVariableValue(fallback, element, depth + 1); 11025 } 11026 else { 11027 return fallback; 11028 } 11029 } 11030 /** 11031 * Resolve CSS variables from 11032 * 11033 * @internal 11034 */ 11035 function resolveCSSVariables(visualElement, _a, transitionEnd) { 11036 var _b; 11037 var target = __rest(_a, []); 11038 var element = visualElement.getInstance(); 11039 if (!(element instanceof HTMLElement)) 11040 return { target: target, transitionEnd: transitionEnd }; 11041 // If `transitionEnd` isn't `undefined`, clone it. We could clone `target` and `transitionEnd` 11042 // only if they change but I think this reads clearer and this isn't a performance-critical path. 11043 if (transitionEnd) { 11044 transitionEnd = __assign({}, transitionEnd); 11045 } 11046 // Go through existing `MotionValue`s and ensure any existing CSS variables are resolved 11047 visualElement.forEachValue(function (value) { 11048 var current = value.get(); 11049 if (!css_variables_conversion_isCSSVariable(current)) 11050 return; 11051 var resolved = getVariableValue(current, element); 11052 if (resolved) 11053 value.set(resolved); 11054 }); 11055 // Cycle through every target property and resolve CSS variables. Currently 11056 // we only read single-var properties like `var(--foo)`, not `calc(var(--foo) + 20px)` 11057 for (var key in target) { 11058 var current = target[key]; 11059 if (!css_variables_conversion_isCSSVariable(current)) 11060 continue; 11061 var resolved = getVariableValue(current, element); 11062 if (!resolved) 11063 continue; 11064 // Clone target if it hasn't already been 11065 target[key] = resolved; 11066 // If the user hasn't already set this key on `transitionEnd`, set it to the unresolved 11067 // CSS variable. This will ensure that after the animation the component will reflect 11068 // changes in the value of the CSS variable. 11069 if (transitionEnd) 11070 (_b = transitionEnd[key]) !== null && _b !== void 0 ? _b : (transitionEnd[key] = current); 11071 } 11072 return { target: target, transitionEnd: transitionEnd }; 11073 } 11074 11075 11076 11077 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/projection/default-scale-correctors.js 11078 11079 11080 11081 11082 11083 function pixelsToPercent(pixels, axis) { 11084 return (pixels / (axis.max - axis.min)) * 100; 11085 } 11086 /** 11087 * We always correct borderRadius as a percentage rather than pixels to reduce paints. 11088 * For example, if you are projecting a box that is 100px wide with a 10px borderRadius 11089 * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% 11090 * borderRadius in both states. If we animate between the two in pixels that will trigger 11091 * a paint each time. If we animate between the two in percentage we'll avoid a paint. 11092 */ 11093 function correctBorderRadius(latest, _layoutState, _a) { 11094 var target = _a.target; 11095 /** 11096 * If latest is a string, if it's a percentage we can return immediately as it's 11097 * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number. 11098 */ 11099 if (typeof latest === "string") { 11100 if (px.test(latest)) { 11101 latest = parseFloat(latest); 11102 } 11103 else { 11104 return latest; 11105 } 11106 } 11107 /** 11108 * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that 11109 * pixel value as a percentage of each axis 11110 */ 11111 var x = pixelsToPercent(latest, target.x); 11112 var y = pixelsToPercent(latest, target.y); 11113 return x + "% " + y + "%"; 11114 } 11115 var varToken = "_$css"; 11116 function correctBoxShadow(latest, _a) { 11117 var delta = _a.delta, treeScale = _a.treeScale; 11118 var original = latest; 11119 /** 11120 * We need to first strip and store CSS variables from the string. 11121 */ 11122 var containsCSSVariables = latest.includes("var("); 11123 var cssVariables = []; 11124 if (containsCSSVariables) { 11125 latest = latest.replace(cssVariableRegex, function (match) { 11126 cssVariables.push(match); 11127 return varToken; 11128 }); 11129 } 11130 var shadow = complex.parse(latest); 11131 // TODO: Doesn't support multiple shadows 11132 if (shadow.length > 5) 11133 return original; 11134 var template = complex.createTransformer(latest); 11135 var offset = typeof shadow[0] !== "number" ? 1 : 0; 11136 // Calculate the overall context scale 11137 var xScale = delta.x.scale * treeScale.x; 11138 var yScale = delta.y.scale * treeScale.y; 11139 shadow[0 + offset] /= xScale; 11140 shadow[1 + offset] /= yScale; 11141 /** 11142 * Ideally we'd correct x and y scales individually, but because blur and 11143 * spread apply to both we have to take a scale average and apply that instead. 11144 * We could potentially improve the outcome of this by incorporating the ratio between 11145 * the two scales. 11146 */ 11147 var averageScale = mix(xScale, yScale, 0.5); 11148 // Blur 11149 if (typeof shadow[2 + offset] === "number") 11150 shadow[2 + offset] /= averageScale; 11151 // Spread 11152 if (typeof shadow[3 + offset] === "number") 11153 shadow[3 + offset] /= averageScale; 11154 var output = template(shadow); 11155 if (containsCSSVariables) { 11156 var i_1 = 0; 11157 output = output.replace(varToken, function () { 11158 var cssVariable = cssVariables[i_1]; 11159 i_1++; 11160 return cssVariable; 11161 }); 11162 } 11163 return output; 11164 } 11165 var borderCorrectionDefinition = { 11166 process: correctBorderRadius, 11167 }; 11168 var defaultScaleCorrectors = { 11169 borderRadius: __assign(__assign({}, borderCorrectionDefinition), { applyTo: [ 11170 "borderTopLeftRadius", 11171 "borderTopRightRadius", 11172 "borderBottomLeftRadius", 11173 "borderBottomRightRadius", 11174 ] }), 11175 borderTopLeftRadius: borderCorrectionDefinition, 11176 borderTopRightRadius: borderCorrectionDefinition, 11177 borderBottomLeftRadius: borderCorrectionDefinition, 11178 borderBottomRightRadius: borderCorrectionDefinition, 11179 boxShadow: { 11180 process: correctBoxShadow, 11181 }, 11182 }; 11183 11184 11185 11186 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/layout/Animate.js 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 var progressTarget = 1000; 11199 var Animate_Animate = /** @class */ (function (_super) { 11200 __extends(Animate, _super); 11201 function Animate() { 11202 var _this = _super !== null && _super.apply(this, arguments) || this; 11203 /** 11204 * A mutable object that tracks the target viewport box 11205 * for the current animation frame. 11206 */ 11207 _this.frameTarget = axisBox(); 11208 /** 11209 * The current animation target, we use this to check whether to start 11210 * a new animation or continue the existing one. 11211 */ 11212 _this.currentAnimationTarget = axisBox(); 11213 /** 11214 * Track whether we're animating this axis. 11215 */ 11216 _this.isAnimating = { 11217 x: false, 11218 y: false, 11219 }; 11220 _this.stopAxisAnimation = { 11221 x: undefined, 11222 y: undefined, 11223 }; 11224 _this.isAnimatingTree = false; 11225 _this.animate = function (target, origin, _a) { 11226 if (_a === void 0) { _a = {}; } 11227 var originBox = _a.originBox, targetBox = _a.targetBox, visibilityAction = _a.visibilityAction, shouldStackAnimate = _a.shouldStackAnimate, onComplete = _a.onComplete, prevParent = _a.prevParent, config = __rest(_a, ["originBox", "targetBox", "visibilityAction", "shouldStackAnimate", "onComplete", "prevParent"]); 11228 var _b = _this.props, visualElement = _b.visualElement, layout = _b.layout; 11229 /** 11230 * Early return if we've been instructed not to animate this render. 11231 */ 11232 if (shouldStackAnimate === false) { 11233 _this.isAnimatingTree = false; 11234 return _this.safeToRemove(); 11235 } 11236 /** 11237 * Prioritise tree animations 11238 */ 11239 if (_this.isAnimatingTree && shouldStackAnimate !== true) { 11240 return; 11241 } 11242 else if (shouldStackAnimate) { 11243 _this.isAnimatingTree = true; 11244 } 11245 /** 11246 * Allow the measured origin (prev bounding box) and target (actual layout) to be 11247 * overridden by the provided config. 11248 */ 11249 origin = originBox || origin; 11250 target = targetBox || target; 11251 /** 11252 * If this element has a projecting parent, there's an opportunity to animate 11253 * it relatively to that parent rather than relatively to the viewport. This 11254 * allows us to add orchestrated animations. 11255 */ 11256 var isRelative = false; 11257 var projectionParent = visualElement.getProjectionParent(); 11258 if (projectionParent) { 11259 var prevParentViewportBox = projectionParent.prevViewportBox; 11260 var parentLayout = projectionParent.getLayoutState().layout; 11261 /** 11262 * If we're being provided a previous parent VisualElement by AnimateSharedLayout 11263 */ 11264 if (prevParent) { 11265 /** 11266 * If we've been provided an explicit target box it means we're animating back 11267 * to this previous parent. So we can make a relative box by comparing to the previous 11268 * parent's layout 11269 */ 11270 if (targetBox) { 11271 parentLayout = prevParent.getLayoutState().layout; 11272 } 11273 /** 11274 * Likewise if we've been provided an explicit origin box it means we're 11275 * animating out from a different element. So we should figure out where that was 11276 * on screen relative to the new parent element. 11277 */ 11278 if (originBox && 11279 !checkIfParentHasChanged(prevParent, projectionParent) && 11280 prevParent.prevViewportBox) { 11281 prevParentViewportBox = prevParent.prevViewportBox; 11282 } 11283 } 11284 if (prevParentViewportBox && 11285 isProvidedCorrectDataForRelativeSharedLayout(prevParent, originBox, targetBox)) { 11286 isRelative = true; 11287 origin = calcRelativeOffset(prevParentViewportBox, origin); 11288 target = calcRelativeOffset(parentLayout, target); 11289 } 11290 } 11291 var boxHasMoved = hasMoved(origin, target); 11292 var animations = eachAxis(function (axis) { 11293 var _a, _b; 11294 /** 11295 * If layout is set to "position", we can resize the origin box based on the target 11296 * box and only animate its position. 11297 */ 11298 if (layout === "position") { 11299 var targetLength = target[axis].max - target[axis].min; 11300 origin[axis].max = origin[axis].min + targetLength; 11301 } 11302 if (visualElement.projection.isTargetLocked) { 11303 return; 11304 } 11305 else if (visibilityAction !== undefined) { 11306 visualElement.setVisibility(visibilityAction === VisibilityAction.Show); 11307 } 11308 else if (boxHasMoved) { 11309 // If the box has moved, animate between it's current visual state and its 11310 // final state 11311 return _this.animateAxis(axis, target[axis], origin[axis], __assign(__assign({}, config), { isRelative: isRelative })); 11312 } 11313 else { 11314 (_b = (_a = _this.stopAxisAnimation)[axis]) === null || _b === void 0 ? void 0 : _b.call(_a); 11315 // If the box has remained in the same place, immediately set the axis target 11316 // to the final desired state 11317 return visualElement.setProjectionTargetAxis(axis, target[axis].min, target[axis].max, isRelative); 11318 } 11319 }); 11320 // Force a render to ensure there's no flash of uncorrected bounding box. 11321 visualElement.syncRender(); 11322 /** 11323 * If this visualElement isn't present (ie it's been removed from the tree by the user but 11324 * kept in by the tree by AnimatePresence) then call safeToRemove when all axis animations 11325 * have successfully finished. 11326 */ 11327 return Promise.all(animations).then(function () { 11328 _this.isAnimatingTree = false; 11329 onComplete && onComplete(); 11330 visualElement.notifyLayoutAnimationComplete(); 11331 }); 11332 }; 11333 return _this; 11334 } 11335 Animate.prototype.componentDidMount = function () { 11336 var _this = this; 11337 var visualElement = this.props.visualElement; 11338 visualElement.animateMotionValue = transitions_startAnimation; 11339 visualElement.enableLayoutProjection(); 11340 this.unsubLayoutReady = visualElement.onLayoutUpdate(this.animate); 11341 visualElement.layoutSafeToRemove = function () { return _this.safeToRemove(); }; 11342 addScaleCorrection(defaultScaleCorrectors); 11343 }; 11344 Animate.prototype.componentWillUnmount = function () { 11345 var _this = this; 11346 this.unsubLayoutReady(); 11347 eachAxis(function (axis) { var _a, _b; return (_b = (_a = _this.stopAxisAnimation)[axis]) === null || _b === void 0 ? void 0 : _b.call(_a); }); 11348 }; 11349 /** 11350 * TODO: This manually performs animations on the visualElement's layout progress 11351 * values. It'd be preferable to amend the startLayoutAxisAnimation 11352 * API to accept more custom animations like this. 11353 */ 11354 Animate.prototype.animateAxis = function (axis, target, origin, _a) { 11355 var _this = this; 11356 var _b, _c; 11357 var _d = _a === void 0 ? {} : _a, transition = _d.transition, isRelative = _d.isRelative; 11358 /** 11359 * If we're not animating to a new target, don't run this animation 11360 */ 11361 if (this.isAnimating[axis] && 11362 axisIsEqual(target, this.currentAnimationTarget[axis])) { 11363 return; 11364 } 11365 (_c = (_b = this.stopAxisAnimation)[axis]) === null || _c === void 0 ? void 0 : _c.call(_b); 11366 this.isAnimating[axis] = true; 11367 var visualElement = this.props.visualElement; 11368 var frameTarget = this.frameTarget[axis]; 11369 var layoutProgress = visualElement.getProjectionAnimationProgress()[axis]; 11370 /** 11371 * Set layout progress back to 0. We set it twice to hard-reset any velocity that might 11372 * be re-incoporated into a subsequent spring animation. 11373 */ 11374 layoutProgress.clearListeners(); 11375 layoutProgress.set(0); 11376 layoutProgress.set(0); 11377 /** 11378 * Create an animation function to run once per frame. This will tween the visual bounding box from 11379 * origin to target using the latest progress value. 11380 */ 11381 var frame = function () { 11382 // Convert the latest layoutProgress, which is a value from 0-1000, into a 0-1 progress 11383 var p = layoutProgress.get() / progressTarget; 11384 // Tween the axis and update the visualElement with the latest values 11385 tweenAxis(frameTarget, origin, target, p); 11386 visualElement.setProjectionTargetAxis(axis, frameTarget.min, frameTarget.max, isRelative); 11387 }; 11388 // Synchronously run a frame to ensure there's no flash of the uncorrected bounding box. 11389 frame(); 11390 // Create a function to stop animation on this specific axis 11391 var unsubscribeProgress = layoutProgress.onChange(frame); 11392 this.stopAxisAnimation[axis] = function () { 11393 _this.isAnimating[axis] = false; 11394 layoutProgress.stop(); 11395 unsubscribeProgress(); 11396 }; 11397 this.currentAnimationTarget[axis] = target; 11398 var layoutTransition = transition || 11399 visualElement.getDefaultTransition() || 11400 defaultLayoutTransition; 11401 // Start the animation on this axis 11402 var animation = transitions_startAnimation(axis === "x" ? "layoutX" : "layoutY", layoutProgress, progressTarget, layoutTransition && getValueTransition(layoutTransition, "layout")).then(this.stopAxisAnimation[axis]); 11403 return animation; 11404 }; 11405 Animate.prototype.safeToRemove = function () { 11406 var _a, _b; 11407 (_b = (_a = this.props).safeToRemove) === null || _b === void 0 ? void 0 : _b.call(_a); 11408 }; 11409 Animate.prototype.render = function () { 11410 return null; 11411 }; 11412 return Animate; 11413 }(external_React_["Component"])); 11414 function AnimateLayoutContextProvider(props) { 11415 var _a = __read(usePresence(), 2), safeToRemove = _a[1]; 11416 return external_React_["createElement"](Animate_Animate, __assign({}, props, { safeToRemove: safeToRemove })); 11417 } 11418 function hasMoved(a, b) { 11419 return (!isZeroBox(a) && 11420 !isZeroBox(b) && 11421 (!axisIsEqual(a.x, b.x) || !axisIsEqual(a.y, b.y))); 11422 } 11423 var zeroAxis = { min: 0, max: 0 }; 11424 function isZeroBox(a) { 11425 return axisIsEqual(a.x, zeroAxis) && axisIsEqual(a.y, zeroAxis); 11426 } 11427 function axisIsEqual(a, b) { 11428 return a.min === b.min && a.max === b.max; 11429 } 11430 var defaultLayoutTransition = { 11431 duration: 0.45, 11432 ease: [0.4, 0, 0.1, 1], 11433 }; 11434 function isProvidedCorrectDataForRelativeSharedLayout(prevParent, originBox, targetBox) { 11435 return prevParent || (!prevParent && !(originBox || targetBox)); 11436 } 11437 11438 11439 11440 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/AnimateSharedLayout/utils/batcher.js 11441 11442 11443 11444 11445 11446 11447 11448 /** 11449 * Default handlers for batching VisualElements 11450 */ 11451 var defaultHandler = { 11452 layoutReady: function (child) { return child.notifyLayoutReady(); }, 11453 }; 11454 /** 11455 * Create a batcher to process VisualElements 11456 */ 11457 function createBatcher() { 11458 var queue = new Set(); 11459 return { 11460 add: function (child) { return queue.add(child); }, 11461 flush: function (_a) { 11462 var _b = _a === void 0 ? defaultHandler : _a, layoutReady = _b.layoutReady, parent = _b.parent; 11463 batchLayout(function (read, write) { 11464 var order = Array.from(queue).sort(compareByDepth); 11465 var ancestors = parent 11466 ? collectProjectingAncestors(parent) 11467 : []; 11468 write(function () { 11469 var allElements = __spreadArray(__spreadArray([], __read(ancestors)), __read(order)); 11470 allElements.forEach(function (element) { return element.resetTransform(); }); 11471 }); 11472 read(function () { 11473 order.forEach(updateLayoutMeasurement); 11474 }); 11475 write(function () { 11476 ancestors.forEach(function (element) { return element.restoreTransform(); }); 11477 order.forEach(layoutReady); 11478 }); 11479 read(function () { 11480 /** 11481 * After all children have started animating, ensure any Entering components are set to Present. 11482 * If we add deferred animations (set up all animations and then start them in two loops) this 11483 * could be moved to the start loop. But it needs to happen after all the animations configs 11484 * are generated in AnimateSharedLayout as this relies on presence data 11485 */ 11486 order.forEach(function (child) { 11487 if (child.isPresent) 11488 child.presence = Presence.Present; 11489 }); 11490 }); 11491 write(function () { 11492 /** 11493 * Starting these animations will have queued jobs on the frame loop. In some situations, 11494 * like when removing an element, these will be processed too late after the DOM is manipulated, 11495 * leaving a flash of incorrectly-projected content. By manually flushing these jobs 11496 * we ensure there's no flash. 11497 */ 11498 flushSync.preRender(); 11499 flushSync.render(); 11500 }); 11501 read(function () { 11502 /** 11503 * Schedule a callback at the end of the following frame to assign the latest projection 11504 * box to the prevViewportBox snapshot. Once global batching is in place this could be run 11505 * synchronously. But for now it ensures that if any nested `AnimateSharedLayout` top-level 11506 * child attempts to calculate its previous relative position against a prevViewportBox 11507 * it will be against its latest projection box instead, as the snapshot is useless beyond this 11508 * render. 11509 */ 11510 es.postRender(function () { 11511 return order.forEach(assignProjectionToSnapshot); 11512 }); 11513 queue.clear(); 11514 }); 11515 }); 11516 // TODO: Need to find a layout-synchronous way of flushing this 11517 flushLayout(); 11518 }, 11519 }; 11520 } 11521 function assignProjectionToSnapshot(child) { 11522 child.prevViewportBox = child.projection.target; 11523 } 11524 11525 11526 11527 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/SharedLayoutContext.js 11528 11529 11530 11531 var SharedLayoutContext = Object(external_React_["createContext"])(createBatcher()); 11532 /** 11533 * @internal 11534 */ 11535 var FramerTreeLayoutContext = Object(external_React_["createContext"])(createBatcher()); 11536 function isSharedLayout(context) { 11537 return !!context.forceUpdate; 11538 } 11539 11540 11541 11542 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/layout/Measure.js 11543 11544 11545 11546 11547 11548 /** 11549 * This component is responsible for scheduling the measuring of the motion component 11550 */ 11551 var Measure_Measure = /** @class */ (function (_super) { 11552 __extends(Measure, _super); 11553 function Measure() { 11554 return _super !== null && _super.apply(this, arguments) || this; 11555 } 11556 /** 11557 * If this is a child of a SyncContext, register the VisualElement with it on mount. 11558 */ 11559 Measure.prototype.componentDidMount = function () { 11560 var _a = this.props, syncLayout = _a.syncLayout, framerSyncLayout = _a.framerSyncLayout, visualElement = _a.visualElement; 11561 isSharedLayout(syncLayout) && syncLayout.register(visualElement); 11562 isSharedLayout(framerSyncLayout) && 11563 framerSyncLayout.register(visualElement); 11564 visualElement.onUnmount(function () { 11565 if (isSharedLayout(syncLayout)) { 11566 syncLayout.remove(visualElement); 11567 } 11568 if (isSharedLayout(framerSyncLayout)) { 11569 framerSyncLayout.remove(visualElement); 11570 } 11571 }); 11572 }; 11573 /** 11574 * If this is a child of a SyncContext, notify it that it needs to re-render. It will then 11575 * handle the snapshotting. 11576 * 11577 * If it is stand-alone component, add it to the batcher. 11578 */ 11579 Measure.prototype.getSnapshotBeforeUpdate = function () { 11580 var _a = this.props, syncLayout = _a.syncLayout, visualElement = _a.visualElement; 11581 if (isSharedLayout(syncLayout)) { 11582 syncLayout.syncUpdate(); 11583 } 11584 else { 11585 snapshotViewportBox(visualElement); 11586 syncLayout.add(visualElement); 11587 } 11588 return null; 11589 }; 11590 Measure.prototype.componentDidUpdate = function () { 11591 var syncLayout = this.props.syncLayout; 11592 if (!isSharedLayout(syncLayout)) 11593 syncLayout.flush(); 11594 }; 11595 Measure.prototype.render = function () { 11596 return null; 11597 }; 11598 return Measure; 11599 }(external_React_default.a.Component)); 11600 function MeasureContextProvider(props) { 11601 var syncLayout = Object(external_React_["useContext"])(SharedLayoutContext); 11602 var framerSyncLayout = Object(external_React_["useContext"])(FramerTreeLayoutContext); 11603 return (external_React_default.a.createElement(Measure_Measure, __assign({}, props, { syncLayout: syncLayout, framerSyncLayout: framerSyncLayout }))); 11604 } 11605 11606 11607 11608 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/layout/index.js 11609 11610 11611 11612 var layoutAnimations = { 11613 measureLayout: MeasureContextProvider, 11614 layoutAnimation: AnimateLayoutContextProvider, 11615 }; 11616 11617 11618 11619 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/state.js 11620 11621 11622 var createProjectionState = function () { return ({ 11623 isEnabled: false, 11624 isHydrated: false, 11625 isTargetLocked: false, 11626 target: axisBox(), 11627 targetFinal: axisBox(), 11628 }); }; 11629 function createLayoutState() { 11630 return { 11631 isHydrated: false, 11632 layout: axisBox(), 11633 layoutCorrected: axisBox(), 11634 treeScale: { x: 1, y: 1 }, 11635 delta: geometry_delta(), 11636 deltaFinal: geometry_delta(), 11637 deltaTransform: "", 11638 }; 11639 } 11640 var zeroLayout = createLayoutState(); 11641 11642 11643 11644 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/build-projection-transform.js 11645 11646 11647 /** 11648 * Build a transform style that takes a calculated delta between the element's current 11649 * space on screen and projects it into the desired space. 11650 */ 11651 function buildLayoutProjectionTransform(_a, treeScale, latestTransform) { 11652 var x = _a.x, y = _a.y; 11653 /** 11654 * The translations we use to calculate are always relative to the viewport coordinate space. 11655 * But when we apply scales, we also scale the coordinate space of an element and its children. 11656 * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need 11657 * to move an element 100 pixels, we actually need to move it 200 in within that scaled space. 11658 */ 11659 var xTranslate = x.translate / treeScale.x; 11660 var yTranslate = y.translate / treeScale.y; 11661 var transform = "translate3d(" + xTranslate + "px, " + yTranslate + "px, 0) "; 11662 if (latestTransform) { 11663 var rotate = latestTransform.rotate, rotateX = latestTransform.rotateX, rotateY = latestTransform.rotateY; 11664 if (rotate) 11665 transform += "rotate(" + rotate + ") "; 11666 if (rotateX) 11667 transform += "rotateX(" + rotateX + ") "; 11668 if (rotateY) 11669 transform += "rotateY(" + rotateY + ") "; 11670 } 11671 transform += "scale(" + x.scale + ", " + y.scale + ")"; 11672 return !latestTransform && transform === identityProjection ? "" : transform; 11673 } 11674 /** 11675 * Take the calculated delta origin and apply it as a transform string. 11676 */ 11677 function buildLayoutProjectionTransformOrigin(_a) { 11678 var deltaFinal = _a.deltaFinal; 11679 return deltaFinal.x.origin * 100 + "% " + deltaFinal.y.origin * 100 + "% 0"; 11680 } 11681 var identityProjection = buildLayoutProjectionTransform(zeroLayout.delta, zeroLayout.treeScale, { x: 1, y: 1 }); 11682 11683 11684 11685 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/lifecycles.js 11686 11687 11688 11689 var names = [ 11690 "LayoutMeasure", 11691 "BeforeLayoutMeasure", 11692 "LayoutUpdate", 11693 "ViewportBoxUpdate", 11694 "Update", 11695 "Render", 11696 "AnimationComplete", 11697 "LayoutAnimationComplete", 11698 "AnimationStart", 11699 "SetAxisTarget", 11700 "Unmount", 11701 ]; 11702 function createLifecycles() { 11703 var managers = names.map(function () { return new subscription_manager_SubscriptionManager(); }); 11704 var propSubscriptions = {}; 11705 var lifecycles = { 11706 clearAllListeners: function () { return managers.forEach(function (manager) { return manager.clear(); }); }, 11707 updatePropListeners: function (props) { 11708 return names.forEach(function (name) { 11709 var _a; 11710 (_a = propSubscriptions[name]) === null || _a === void 0 ? void 0 : _a.call(propSubscriptions); 11711 var on = "on" + name; 11712 var propListener = props[on]; 11713 if (propListener) { 11714 propSubscriptions[name] = lifecycles[on](propListener); 11715 } 11716 }); 11717 }, 11718 }; 11719 managers.forEach(function (manager, i) { 11720 lifecycles["on" + names[i]] = function (handler) { return manager.add(handler); }; 11721 lifecycles["notify" + names[i]] = function () { 11722 var args = []; 11723 for (var _i = 0; _i < arguments.length; _i++) { 11724 args[_i] = arguments[_i]; 11725 } 11726 return manager.notify.apply(manager, __spreadArray([], __read(args))); 11727 }; 11728 }); 11729 return lifecycles; 11730 } 11731 11732 11733 11734 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/motion-values.js 11735 11736 11737 11738 function updateMotionValuesFromProps(element, next, prev) { 11739 var _a; 11740 for (var key in next) { 11741 var nextValue = next[key]; 11742 var prevValue = prev[key]; 11743 if (isMotionValue(nextValue)) { 11744 /** 11745 * If this is a motion value found in props or style, we want to add it 11746 * to our visual element's motion value map. 11747 */ 11748 element.addValue(key, nextValue); 11749 } 11750 else if (isMotionValue(prevValue)) { 11751 /** 11752 * If we're swapping to a new motion value, create a new motion value 11753 * from that 11754 */ 11755 element.addValue(key, motionValue(nextValue)); 11756 } 11757 else if (prevValue !== nextValue) { 11758 /** 11759 * If this is a flat value that has changed, update the motion value 11760 * or create one if it doesn't exist. We only want to do this if we're 11761 * not handling the value with our animation state. 11762 */ 11763 if (element.hasValue(key)) { 11764 var existingValue = element.getValue(key); 11765 // TODO: Only update values that aren't being animated or even looked at 11766 !existingValue.hasAnimated && existingValue.set(nextValue); 11767 } 11768 else { 11769 element.addValue(key, motionValue((_a = element.getStaticValue(key)) !== null && _a !== void 0 ? _a : nextValue)); 11770 } 11771 } 11772 } 11773 // Handle removed values 11774 for (var key in prev) { 11775 if (next[key] === undefined) 11776 element.removeValue(key); 11777 } 11778 return next; 11779 } 11780 11781 11782 11783 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/projection.js 11784 11785 11786 11787 function updateLayoutDeltas(_a, _b, treePath, transformOrigin) { 11788 var delta = _a.delta, layout = _a.layout, layoutCorrected = _a.layoutCorrected, treeScale = _a.treeScale; 11789 var target = _b.target; 11790 /** 11791 * Reset the corrected box with the latest values from box, as we're then going 11792 * to perform mutative operations on it. 11793 */ 11794 resetBox(layoutCorrected, layout); 11795 /** 11796 * Apply all the parent deltas to this box to produce the corrected box. This 11797 * is the layout box, as it will appear on screen as a result of the transforms of its parents. 11798 */ 11799 applyTreeDeltas(layoutCorrected, treeScale, treePath); 11800 /** 11801 * Update the delta between the corrected box and the target box before user-set transforms were applied. 11802 * This will allow us to calculate the corrected borderRadius and boxShadow to compensate 11803 * for our layout reprojection, but still allow them to be scaled correctly by the user. 11804 * It might be that to simplify this we may want to accept that user-set scale is also corrected 11805 * and we wouldn't have to keep and calc both deltas, OR we could support a user setting 11806 * to allow people to choose whether these styles are corrected based on just the 11807 * layout reprojection or the final bounding box. 11808 */ 11809 updateBoxDelta(delta, layoutCorrected, target, transformOrigin); 11810 } 11811 11812 11813 11814 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/flat-tree.js 11815 11816 11817 11818 var flat_tree_FlatTree = /** @class */ (function () { 11819 function FlatTree() { 11820 this.children = []; 11821 this.isDirty = false; 11822 } 11823 FlatTree.prototype.add = function (child) { 11824 addUniqueItem(this.children, child); 11825 this.isDirty = true; 11826 }; 11827 FlatTree.prototype.remove = function (child) { 11828 removeItem(this.children, child); 11829 this.isDirty = true; 11830 }; 11831 FlatTree.prototype.forEach = function (callback) { 11832 this.isDirty && this.children.sort(compareByDepth); 11833 this.isDirty = false; 11834 this.children.forEach(callback); 11835 }; 11836 return FlatTree; 11837 }()); 11838 11839 11840 11841 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/projection/relative-set.js 11842 11843 11844 11845 function setCurrentViewportBox(visualElement) { 11846 var projectionParent = visualElement.getProjectionParent(); 11847 if (!projectionParent) { 11848 visualElement.rebaseProjectionTarget(); 11849 return; 11850 } 11851 var relativeOffset = calcRelativeOffset(projectionParent.getLayoutState().layout, visualElement.getLayoutState().layout); 11852 eachAxis(function (axis) { 11853 visualElement.setProjectionTargetAxis(axis, relativeOffset[axis].min, relativeOffset[axis].max, true); 11854 }); 11855 } 11856 11857 11858 11859 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/index.js 11860 11861 11862 11863 11864 11865 11866 11867 11868 11869 11870 11871 11872 11873 11874 11875 11876 11877 11878 11879 11880 11881 var render_visualElement = function (_a) { 11882 var _b = _a.treeType, treeType = _b === void 0 ? "" : _b, build = _a.build, getBaseTarget = _a.getBaseTarget, makeTargetAnimatable = _a.makeTargetAnimatable, measureViewportBox = _a.measureViewportBox, renderInstance = _a.render, readValueFromInstance = _a.readValueFromInstance, resetTransform = _a.resetTransform, restoreTransform = _a.restoreTransform, removeValueFromRenderState = _a.removeValueFromRenderState, sortNodePosition = _a.sortNodePosition, scrapeMotionValuesFromProps = _a.scrapeMotionValuesFromProps; 11883 return function (_a, options) { 11884 var parent = _a.parent, props = _a.props, presenceId = _a.presenceId, blockInitialAnimation = _a.blockInitialAnimation, visualState = _a.visualState; 11885 if (options === void 0) { options = {}; } 11886 var latestValues = visualState.latestValues, renderState = visualState.renderState; 11887 /** 11888 * The instance of the render-specific node that will be hydrated by the 11889 * exposed React ref. So for example, this visual element can host a 11890 * HTMLElement, plain object, or Three.js object. The functions provided 11891 * in VisualElementConfig allow us to interface with this instance. 11892 */ 11893 var instance; 11894 /** 11895 * Manages the subscriptions for a visual element's lifecycle, for instance 11896 * onRender and onViewportBoxUpdate. 11897 */ 11898 var lifecycles = createLifecycles(); 11899 /** 11900 * 11901 */ 11902 var projection = createProjectionState(); 11903 /** 11904 * A reference to the nearest projecting parent. This is either 11905 * undefined if we haven't looked for the nearest projecting parent, 11906 * false if there is no parent performing layout projection, or a reference 11907 * to the projecting parent. 11908 */ 11909 var projectionParent; 11910 /** 11911 * This is a reference to the visual state of the "lead" visual element. 11912 * Usually, this will be this visual element. But if it shares a layoutId 11913 * with other visual elements, only one of them will be designated lead by 11914 * AnimateSharedLayout. All the other visual elements will take on the visual 11915 * appearance of the lead while they crossfade to it. 11916 */ 11917 var leadProjection = projection; 11918 var leadLatestValues = latestValues; 11919 var unsubscribeFromLeadVisualElement; 11920 /** 11921 * The latest layout measurements and calculated projections. This 11922 * is seperate from the target projection data in visualState as 11923 * many visual elements might point to the same piece of visualState as 11924 * a target, whereas they might each have different layouts and thus 11925 * projection calculations needed to project into the same viewport box. 11926 */ 11927 var layoutState = createLayoutState(); 11928 /** 11929 * 11930 */ 11931 var crossfader; 11932 /** 11933 * Keep track of whether the viewport box has been updated since the 11934 * last time the layout projection was re-calculated. 11935 */ 11936 var hasViewportBoxUpdated = false; 11937 /** 11938 * A map of all motion values attached to this visual element. Motion 11939 * values are source of truth for any given animated value. A motion 11940 * value might be provided externally by the component via props. 11941 */ 11942 var values = new Map(); 11943 /** 11944 * A map of every subscription that binds the provided or generated 11945 * motion values onChange listeners to this visual element. 11946 */ 11947 var valueSubscriptions = new Map(); 11948 /** 11949 * A reference to the previously-provided motion values as returned 11950 * from scrapeMotionValuesFromProps. We use the keys in here to determine 11951 * if any motion values need to be removed after props are updated. 11952 */ 11953 var prevMotionValues = {}; 11954 /** 11955 * x/y motion values that track the progress of initiated layout 11956 * animations. 11957 * 11958 * TODO: Target for removal 11959 */ 11960 var projectionTargetProgress; 11961 /** 11962 * When values are removed from all animation props we need to search 11963 * for a fallback value to animate to. These values are tracked in baseTarget. 11964 */ 11965 var baseTarget = __assign({}, latestValues); 11966 // Internal methods ======================== 11967 /** 11968 * On mount, this will be hydrated with a callback to disconnect 11969 * this visual element from its parent on unmount. 11970 */ 11971 var removeFromVariantTree; 11972 /** 11973 * 11974 */ 11975 function render() { 11976 if (!instance) 11977 return; 11978 if (element.isProjectionReady()) { 11979 /** 11980 * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal. 11981 * This is the final box that we will then project into by calculating a transform delta and 11982 * applying it to the corrected box. 11983 */ 11984 applyBoxTransforms(leadProjection.targetFinal, leadProjection.target, leadLatestValues); 11985 /** 11986 * Update the delta between the corrected box and the final target box, after 11987 * user-set transforms are applied to it. This will be used by the renderer to 11988 * create a transform style that will reproject the element from its actual layout 11989 * into the desired bounding box. 11990 */ 11991 updateBoxDelta(layoutState.deltaFinal, layoutState.layoutCorrected, leadProjection.targetFinal, latestValues); 11992 } 11993 triggerBuild(); 11994 renderInstance(instance, renderState); 11995 } 11996 function triggerBuild() { 11997 var valuesToRender = latestValues; 11998 if (crossfader && crossfader.isActive()) { 11999 var crossfadedValues = crossfader.getCrossfadeState(element); 12000 if (crossfadedValues) 12001 valuesToRender = crossfadedValues; 12002 } 12003 build(element, renderState, valuesToRender, leadProjection, layoutState, options, props); 12004 } 12005 function update() { 12006 lifecycles.notifyUpdate(latestValues); 12007 } 12008 function updateLayoutProjection() { 12009 if (!element.isProjectionReady()) 12010 return; 12011 var delta = layoutState.delta, treeScale = layoutState.treeScale; 12012 var prevTreeScaleX = treeScale.x; 12013 var prevTreeScaleY = treeScale.y; 12014 var prevDeltaTransform = layoutState.deltaTransform; 12015 updateLayoutDeltas(layoutState, leadProjection, element.path, latestValues); 12016 hasViewportBoxUpdated && 12017 element.notifyViewportBoxUpdate(leadProjection.target, delta); 12018 hasViewportBoxUpdated = false; 12019 var deltaTransform = buildLayoutProjectionTransform(delta, treeScale); 12020 if (deltaTransform !== prevDeltaTransform || 12021 // Also compare calculated treeScale, for values that rely on this only for scale correction 12022 prevTreeScaleX !== treeScale.x || 12023 prevTreeScaleY !== treeScale.y) { 12024 element.scheduleRender(); 12025 } 12026 layoutState.deltaTransform = deltaTransform; 12027 } 12028 function updateTreeLayoutProjection() { 12029 element.layoutTree.forEach(fireUpdateLayoutProjection); 12030 } 12031 /** 12032 * 12033 */ 12034 function bindToMotionValue(key, value) { 12035 var removeOnChange = value.onChange(function (latestValue) { 12036 latestValues[key] = latestValue; 12037 props.onUpdate && es.update(update, false, true); 12038 }); 12039 var removeOnRenderRequest = value.onRenderRequest(element.scheduleRender); 12040 valueSubscriptions.set(key, function () { 12041 removeOnChange(); 12042 removeOnRenderRequest(); 12043 }); 12044 } 12045 /** 12046 * Any motion values that are provided to the element when created 12047 * aren't yet bound to the element, as this would technically be impure. 12048 * However, we iterate through the motion values and set them to the 12049 * initial values for this component. 12050 * 12051 * TODO: This is impure and we should look at changing this to run on mount. 12052 * Doing so will break some tests but this isn't neccessarily a breaking change, 12053 * more a reflection of the test. 12054 */ 12055 var initialMotionValues = scrapeMotionValuesFromProps(props); 12056 for (var key in initialMotionValues) { 12057 var value = initialMotionValues[key]; 12058 if (latestValues[key] !== undefined && isMotionValue(value)) { 12059 value.set(latestValues[key], false); 12060 } 12061 } 12062 /** 12063 * Determine what role this visual element should take in the variant tree. 12064 */ 12065 var isControllingVariants = checkIfControllingVariants(props); 12066 var isVariantNode = checkIfVariantNode(props); 12067 var element = __assign(__assign({ treeType: treeType, 12068 /** 12069 * This is a mirror of the internal instance prop, which keeps 12070 * VisualElement type-compatible with React's RefObject. 12071 */ 12072 current: null, 12073 /** 12074 * The depth of this visual element within the visual element tree. 12075 */ 12076 depth: parent ? parent.depth + 1 : 0, parent: parent, children: new Set(), 12077 /** 12078 * An ancestor path back to the root visual element. This is used 12079 * by layout projection to quickly recurse back up the tree. 12080 */ 12081 path: parent ? __spreadArray(__spreadArray([], __read(parent.path)), [parent]) : [], layoutTree: parent ? parent.layoutTree : new flat_tree_FlatTree(), 12082 /** 12083 * 12084 */ 12085 presenceId: presenceId, 12086 projection: projection, 12087 /** 12088 * If this component is part of the variant tree, it should track 12089 * any children that are also part of the tree. This is essentially 12090 * a shadow tree to simplify logic around how to stagger over children. 12091 */ 12092 variantChildren: isVariantNode ? new Set() : undefined, 12093 /** 12094 * Whether this instance is visible. This can be changed imperatively 12095 * by AnimateSharedLayout, is analogous to CSS's visibility in that 12096 * hidden elements should take up layout, and needs enacting by the configured 12097 * render function. 12098 */ 12099 isVisible: undefined, 12100 /** 12101 * Normally, if a component is controlled by a parent's variants, it can 12102 * rely on that ancestor to trigger animations further down the tree. 12103 * However, if a component is created after its parent is mounted, the parent 12104 * won't trigger that mount animation so the child needs to. 12105 * 12106 * TODO: This might be better replaced with a method isParentMounted 12107 */ 12108 manuallyAnimateOnMount: Boolean(parent === null || parent === void 0 ? void 0 : parent.isMounted()), 12109 /** 12110 * This can be set by AnimatePresence to force components that mount 12111 * at the same time as it to mount as if they have initial={false} set. 12112 */ 12113 blockInitialAnimation: blockInitialAnimation, 12114 /** 12115 * Determine whether this component has mounted yet. This is mostly used 12116 * by variant children to determine whether they need to trigger their 12117 * own animations on mount. 12118 */ 12119 isMounted: function () { return Boolean(instance); }, mount: function (newInstance) { 12120 instance = element.current = newInstance; 12121 element.pointTo(element); 12122 if (isVariantNode && parent && !isControllingVariants) { 12123 removeFromVariantTree = parent === null || parent === void 0 ? void 0 : parent.addVariantChild(element); 12124 } 12125 parent === null || parent === void 0 ? void 0 : parent.children.add(element); 12126 }, 12127 /** 12128 * 12129 */ 12130 unmount: function () { 12131 cancelSync.update(update); 12132 cancelSync.render(render); 12133 cancelSync.preRender(element.updateLayoutProjection); 12134 valueSubscriptions.forEach(function (remove) { return remove(); }); 12135 element.stopLayoutAnimation(); 12136 element.layoutTree.remove(element); 12137 removeFromVariantTree === null || removeFromVariantTree === void 0 ? void 0 : removeFromVariantTree(); 12138 parent === null || parent === void 0 ? void 0 : parent.children.delete(element); 12139 unsubscribeFromLeadVisualElement === null || unsubscribeFromLeadVisualElement === void 0 ? void 0 : unsubscribeFromLeadVisualElement(); 12140 lifecycles.clearAllListeners(); 12141 }, 12142 /** 12143 * Add a child visual element to our set of children. 12144 */ 12145 addVariantChild: function (child) { 12146 var _a; 12147 var closestVariantNode = element.getClosestVariantNode(); 12148 if (closestVariantNode) { 12149 (_a = closestVariantNode.variantChildren) === null || _a === void 0 ? void 0 : _a.add(child); 12150 return function () { return closestVariantNode.variantChildren.delete(child); }; 12151 } 12152 }, 12153 sortNodePosition: function (other) { 12154 /** 12155 * If these nodes aren't even of the same type we can't compare their depth. 12156 */ 12157 if (!sortNodePosition || treeType !== other.treeType) 12158 return 0; 12159 return sortNodePosition(element.getInstance(), other.getInstance()); 12160 }, 12161 /** 12162 * Returns the closest variant node in the tree starting from 12163 * this visual element. 12164 */ 12165 getClosestVariantNode: function () { 12166 return isVariantNode ? element : parent === null || parent === void 0 ? void 0 : parent.getClosestVariantNode(); 12167 }, 12168 /** 12169 * A method that schedules an update to layout projections throughout 12170 * the tree. We inherit from the parent so there's only ever one 12171 * job scheduled on the next frame - that of the root visual element. 12172 */ 12173 scheduleUpdateLayoutProjection: parent 12174 ? parent.scheduleUpdateLayoutProjection 12175 : function () { 12176 return es.preRender(element.updateTreeLayoutProjection, false, true); 12177 }, 12178 /** 12179 * Expose the latest layoutId prop. 12180 */ 12181 getLayoutId: function () { return props.layoutId; }, 12182 /** 12183 * Returns the current instance. 12184 */ 12185 getInstance: function () { return instance; }, 12186 /** 12187 * Get/set the latest static values. 12188 */ 12189 getStaticValue: function (key) { return latestValues[key]; }, setStaticValue: function (key, value) { return (latestValues[key] = value); }, 12190 /** 12191 * Returns the latest motion value state. Currently only used to take 12192 * a snapshot of the visual element - perhaps this can return the whole 12193 * visual state 12194 */ 12195 getLatestValues: function () { return latestValues; }, 12196 /** 12197 * Set the visiblity of the visual element. If it's changed, schedule 12198 * a render to reflect these changes. 12199 */ 12200 setVisibility: function (visibility) { 12201 if (element.isVisible === visibility) 12202 return; 12203 element.isVisible = visibility; 12204 element.scheduleRender(); 12205 }, 12206 /** 12207 * Make a target animatable by Popmotion. For instance, if we're 12208 * trying to animate width from 100px to 100vw we need to measure 100vw 12209 * in pixels to determine what we really need to animate to. This is also 12210 * pluggable to support Framer's custom value types like Color, 12211 * and CSS variables. 12212 */ 12213 makeTargetAnimatable: function (target, canMutate) { 12214 if (canMutate === void 0) { canMutate = true; } 12215 return makeTargetAnimatable(element, target, props, canMutate); 12216 }, 12217 // Motion values ======================== 12218 /** 12219 * Add a motion value and bind it to this visual element. 12220 */ 12221 addValue: function (key, value) { 12222 // Remove existing value if it exists 12223 if (element.hasValue(key)) 12224 element.removeValue(key); 12225 values.set(key, value); 12226 latestValues[key] = value.get(); 12227 bindToMotionValue(key, value); 12228 }, 12229 /** 12230 * Remove a motion value and unbind any active subscriptions. 12231 */ 12232 removeValue: function (key) { 12233 var _a; 12234 values.delete(key); 12235 (_a = valueSubscriptions.get(key)) === null || _a === void 0 ? void 0 : _a(); 12236 valueSubscriptions.delete(key); 12237 delete latestValues[key]; 12238 removeValueFromRenderState(key, renderState); 12239 }, 12240 /** 12241 * Check whether we have a motion value for this key 12242 */ 12243 hasValue: function (key) { return values.has(key); }, 12244 /** 12245 * Get a motion value for this key. If called with a default 12246 * value, we'll create one if none exists. 12247 */ 12248 getValue: function (key, defaultValue) { 12249 var value = values.get(key); 12250 if (value === undefined && defaultValue !== undefined) { 12251 value = motionValue(defaultValue); 12252 element.addValue(key, value); 12253 } 12254 return value; 12255 }, 12256 /** 12257 * Iterate over our motion values. 12258 */ 12259 forEachValue: function (callback) { return values.forEach(callback); }, 12260 /** 12261 * If we're trying to animate to a previously unencountered value, 12262 * we need to check for it in our state and as a last resort read it 12263 * directly from the instance (which might have performance implications). 12264 */ 12265 readValue: function (key) { var _a; return (_a = latestValues[key]) !== null && _a !== void 0 ? _a : readValueFromInstance(instance, key, options); }, 12266 /** 12267 * Set the base target to later animate back to. This is currently 12268 * only hydrated on creation and when we first read a value. 12269 */ 12270 setBaseTarget: function (key, value) { 12271 baseTarget[key] = value; 12272 }, 12273 /** 12274 * Find the base target for a value thats been removed from all animation 12275 * props. 12276 */ 12277 getBaseTarget: function (key) { 12278 if (getBaseTarget) { 12279 var target = getBaseTarget(props, key); 12280 if (target !== undefined && !isMotionValue(target)) 12281 return target; 12282 } 12283 return baseTarget[key]; 12284 } }, lifecycles), { 12285 /** 12286 * Build the renderer state based on the latest visual state. 12287 */ 12288 build: function () { 12289 triggerBuild(); 12290 return renderState; 12291 }, 12292 /** 12293 * Schedule a render on the next animation frame. 12294 */ 12295 scheduleRender: function () { 12296 es.render(render, false, true); 12297 }, 12298 /** 12299 * Synchronously fire render. It's prefered that we batch renders but 12300 * in many circumstances, like layout measurement, we need to run this 12301 * synchronously. However in those instances other measures should be taken 12302 * to batch reads/writes. 12303 */ 12304 syncRender: render, 12305 /** 12306 * Update the provided props. Ensure any newly-added motion values are 12307 * added to our map, old ones removed, and listeners updated. 12308 */ 12309 setProps: function (newProps) { 12310 props = newProps; 12311 lifecycles.updatePropListeners(newProps); 12312 prevMotionValues = updateMotionValuesFromProps(element, scrapeMotionValuesFromProps(props), prevMotionValues); 12313 }, getProps: function () { return props; }, 12314 // Variants ============================== 12315 /** 12316 * Returns the variant definition with a given name. 12317 */ 12318 getVariant: function (name) { var _a; return (_a = props.variants) === null || _a === void 0 ? void 0 : _a[name]; }, 12319 /** 12320 * Returns the defined default transition on this component. 12321 */ 12322 getDefaultTransition: function () { return props.transition; }, 12323 /** 12324 * Used by child variant nodes to get the closest ancestor variant props. 12325 */ 12326 getVariantContext: function (startAtParent) { 12327 if (startAtParent === void 0) { startAtParent = false; } 12328 if (startAtParent) 12329 return parent === null || parent === void 0 ? void 0 : parent.getVariantContext(); 12330 if (!isControllingVariants) { 12331 var context_1 = (parent === null || parent === void 0 ? void 0 : parent.getVariantContext()) || {}; 12332 if (props.initial !== undefined) { 12333 context_1.initial = props.initial; 12334 } 12335 return context_1; 12336 } 12337 var context = {}; 12338 for (var i = 0; i < numVariantProps; i++) { 12339 var name_1 = variantProps[i]; 12340 var prop = props[name_1]; 12341 if (isVariantLabel(prop) || prop === false) { 12342 context[name_1] = prop; 12343 } 12344 } 12345 return context; 12346 }, 12347 // Layout projection ============================== 12348 /** 12349 * Enable layout projection for this visual element. Won't actually 12350 * occur until we also have hydrated layout measurements. 12351 */ 12352 enableLayoutProjection: function () { 12353 projection.isEnabled = true; 12354 element.layoutTree.add(element); 12355 }, 12356 /** 12357 * Lock the projection target, for instance when dragging, so 12358 * nothing else can try and animate it. 12359 */ 12360 lockProjectionTarget: function () { 12361 projection.isTargetLocked = true; 12362 }, 12363 unlockProjectionTarget: function () { 12364 element.stopLayoutAnimation(); 12365 projection.isTargetLocked = false; 12366 }, getLayoutState: function () { return layoutState; }, setCrossfader: function (newCrossfader) { 12367 crossfader = newCrossfader; 12368 }, isProjectionReady: function () { 12369 return projection.isEnabled && 12370 projection.isHydrated && 12371 layoutState.isHydrated; 12372 }, 12373 /** 12374 * Start a layout animation on a given axis. 12375 */ 12376 startLayoutAnimation: function (axis, transition, isRelative) { 12377 if (isRelative === void 0) { isRelative = false; } 12378 var progress = element.getProjectionAnimationProgress()[axis]; 12379 var _a = isRelative 12380 ? projection.relativeTarget[axis] 12381 : projection.target[axis], min = _a.min, max = _a.max; 12382 var length = max - min; 12383 progress.clearListeners(); 12384 progress.set(min); 12385 progress.set(min); // Set twice to hard-reset velocity 12386 progress.onChange(function (v) { 12387 element.setProjectionTargetAxis(axis, v, v + length, isRelative); 12388 }); 12389 return element.animateMotionValue(axis, progress, 0, transition); 12390 }, 12391 /** 12392 * Stop layout animations. 12393 */ 12394 stopLayoutAnimation: function () { 12395 eachAxis(function (axis) { 12396 return element.getProjectionAnimationProgress()[axis].stop(); 12397 }); 12398 }, 12399 /** 12400 * Measure the current viewport box with or without transforms. 12401 * Only measures axis-aligned boxes, rotate and skew must be manually 12402 * removed with a re-render to work. 12403 */ 12404 measureViewportBox: function (withTransform) { 12405 if (withTransform === void 0) { withTransform = true; } 12406 var viewportBox = measureViewportBox(instance, options); 12407 if (!withTransform) 12408 removeBoxTransforms(viewportBox, latestValues); 12409 return viewportBox; 12410 }, 12411 /** 12412 * Get the motion values tracking the layout animations on each 12413 * axis. Lazy init if not already created. 12414 */ 12415 getProjectionAnimationProgress: function () { 12416 projectionTargetProgress || (projectionTargetProgress = { 12417 x: motionValue(0), 12418 y: motionValue(0), 12419 }); 12420 return projectionTargetProgress; 12421 }, 12422 /** 12423 * Update the projection of a single axis. Schedule an update to 12424 * the tree layout projection. 12425 */ 12426 setProjectionTargetAxis: function (axis, min, max, isRelative) { 12427 if (isRelative === void 0) { isRelative = false; } 12428 var target; 12429 if (isRelative) { 12430 if (!projection.relativeTarget) { 12431 projection.relativeTarget = axisBox(); 12432 } 12433 target = projection.relativeTarget[axis]; 12434 } 12435 else { 12436 projection.relativeTarget = undefined; 12437 target = projection.target[axis]; 12438 } 12439 projection.isHydrated = true; 12440 target.min = min; 12441 target.max = max; 12442 // Flag that we want to fire the onViewportBoxUpdate event handler 12443 hasViewportBoxUpdated = true; 12444 lifecycles.notifySetAxisTarget(); 12445 }, 12446 /** 12447 * Rebase the projection target on top of the provided viewport box 12448 * or the measured layout. This ensures that non-animating elements 12449 * don't fall out of sync differences in measurements vs projections 12450 * after a page scroll or other relayout. 12451 */ 12452 rebaseProjectionTarget: function (force, box) { 12453 if (box === void 0) { box = layoutState.layout; } 12454 var _a = element.getProjectionAnimationProgress(), x = _a.x, y = _a.y; 12455 var shouldRebase = !projection.relativeTarget && 12456 !projection.isTargetLocked && 12457 !x.isAnimating() && 12458 !y.isAnimating(); 12459 if (force || shouldRebase) { 12460 eachAxis(function (axis) { 12461 var _a = box[axis], min = _a.min, max = _a.max; 12462 element.setProjectionTargetAxis(axis, min, max); 12463 }); 12464 } 12465 }, 12466 /** 12467 * Notify the visual element that its layout is up-to-date. 12468 * Currently Animate.tsx uses this to check whether a layout animation 12469 * needs to be performed. 12470 */ 12471 notifyLayoutReady: function (config) { 12472 setCurrentViewportBox(element); 12473 element.notifyLayoutUpdate(layoutState.layout, element.prevViewportBox || layoutState.layout, config); 12474 }, 12475 /** 12476 * Temporarily reset the transform of the instance. 12477 */ 12478 resetTransform: function () { return resetTransform(element, instance, props); }, restoreTransform: function () { return restoreTransform(instance, renderState); }, updateLayoutProjection: updateLayoutProjection, 12479 updateTreeLayoutProjection: function () { 12480 element.layoutTree.forEach(fireResolveRelativeTargetBox); 12481 /** 12482 * Schedule the projection updates at the end of the current preRender 12483 * step. This will ensure that all layout trees will first resolve 12484 * relative projection boxes into viewport boxes, and *then* 12485 * update projections. 12486 */ 12487 es.preRender(updateTreeLayoutProjection, false, true); 12488 // sync.postRender(() => element.scheduleUpdateLayoutProjection()) 12489 }, 12490 getProjectionParent: function () { 12491 if (projectionParent === undefined) { 12492 var foundParent = false; 12493 // Search backwards through the tree path 12494 for (var i = element.path.length - 1; i >= 0; i--) { 12495 var ancestor = element.path[i]; 12496 if (ancestor.projection.isEnabled) { 12497 foundParent = ancestor; 12498 break; 12499 } 12500 } 12501 projectionParent = foundParent; 12502 } 12503 return projectionParent; 12504 }, 12505 resolveRelativeTargetBox: function () { 12506 var relativeParent = element.getProjectionParent(); 12507 if (!projection.relativeTarget || !relativeParent) 12508 return; 12509 calcRelativeBox(projection, relativeParent.projection); 12510 if (isDraggable(relativeParent)) { 12511 var target = projection.target; 12512 applyBoxTransforms(target, target, relativeParent.getLatestValues()); 12513 } 12514 }, 12515 shouldResetTransform: function () { 12516 return Boolean(props._layoutResetTransform); 12517 }, 12518 /** 12519 * 12520 */ 12521 pointTo: function (newLead) { 12522 leadProjection = newLead.projection; 12523 leadLatestValues = newLead.getLatestValues(); 12524 /** 12525 * Subscribe to lead component's layout animations 12526 */ 12527 unsubscribeFromLeadVisualElement === null || unsubscribeFromLeadVisualElement === void 0 ? void 0 : unsubscribeFromLeadVisualElement(); 12528 unsubscribeFromLeadVisualElement = pipe(newLead.onSetAxisTarget(element.scheduleUpdateLayoutProjection), newLead.onLayoutAnimationComplete(function () { 12529 var _a; 12530 if (element.isPresent) { 12531 element.presence = Presence.Present; 12532 } 12533 else { 12534 (_a = element.layoutSafeToRemove) === null || _a === void 0 ? void 0 : _a.call(element); 12535 } 12536 })); 12537 }, 12538 // TODO: Clean this up 12539 isPresent: true, presence: Presence.Entering }); 12540 return element; 12541 }; 12542 }; 12543 function fireResolveRelativeTargetBox(child) { 12544 child.resolveRelativeTargetBox(); 12545 } 12546 function fireUpdateLayoutProjection(child) { 12547 child.updateLayoutProjection(); 12548 } 12549 var variantProps = __spreadArray(["initial"], __read(variantPriorityOrder)); 12550 var numVariantProps = variantProps.length; 12551 12552 12553 12554 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.js 12555 12556 12557 12558 12559 12560 12561 12562 var positionalKeys = new Set([ 12563 "width", 12564 "height", 12565 "top", 12566 "left", 12567 "right", 12568 "bottom", 12569 "x", 12570 "y", 12571 ]); 12572 var isPositionalKey = function (key) { return positionalKeys.has(key); }; 12573 var hasPositionalKey = function (target) { 12574 return Object.keys(target).some(isPositionalKey); 12575 }; 12576 var setAndResetVelocity = function (value, to) { 12577 // Looks odd but setting it twice doesn't render, it'll just 12578 // set both prev and current to the latest value 12579 value.set(to, false); 12580 value.set(to); 12581 }; 12582 var isNumOrPxType = function (v) { 12583 return v === numbers_number || v === px; 12584 }; 12585 var BoundingBoxDimension; 12586 (function (BoundingBoxDimension) { 12587 BoundingBoxDimension["width"] = "width"; 12588 BoundingBoxDimension["height"] = "height"; 12589 BoundingBoxDimension["left"] = "left"; 12590 BoundingBoxDimension["right"] = "right"; 12591 BoundingBoxDimension["top"] = "top"; 12592 BoundingBoxDimension["bottom"] = "bottom"; 12593 })(BoundingBoxDimension || (BoundingBoxDimension = {})); 12594 var getPosFromMatrix = function (matrix, pos) { 12595 return parseFloat(matrix.split(", ")[pos]); 12596 }; 12597 var getTranslateFromMatrix = function (pos2, pos3) { return function (_bbox, _a) { 12598 var transform = _a.transform; 12599 if (transform === "none" || !transform) 12600 return 0; 12601 var matrix3d = transform.match(/^matrix3d\((.+)\)$/); 12602 if (matrix3d) { 12603 return getPosFromMatrix(matrix3d[1], pos3); 12604 } 12605 else { 12606 var matrix = transform.match(/^matrix\((.+)\)$/); 12607 if (matrix) { 12608 return getPosFromMatrix(matrix[1], pos2); 12609 } 12610 else { 12611 return 0; 12612 } 12613 } 12614 }; }; 12615 var unit_conversion_transformKeys = new Set(["x", "y", "z"]); 12616 var nonTranslationalTransformKeys = transformProps.filter(function (key) { return !unit_conversion_transformKeys.has(key); }); 12617 function removeNonTranslationalTransform(visualElement) { 12618 var removedTransforms = []; 12619 nonTranslationalTransformKeys.forEach(function (key) { 12620 var value = visualElement.getValue(key); 12621 if (value !== undefined) { 12622 removedTransforms.push([key, value.get()]); 12623 value.set(key.startsWith("scale") ? 1 : 0); 12624 } 12625 }); 12626 // Apply changes to element before measurement 12627 if (removedTransforms.length) 12628 visualElement.syncRender(); 12629 return removedTransforms; 12630 } 12631 var positionalValues = { 12632 // Dimensions 12633 width: function (_a) { 12634 var x = _a.x; 12635 return x.max - x.min; 12636 }, 12637 height: function (_a) { 12638 var y = _a.y; 12639 return y.max - y.min; 12640 }, 12641 top: function (_bbox, _a) { 12642 var top = _a.top; 12643 return parseFloat(top); 12644 }, 12645 left: function (_bbox, _a) { 12646 var left = _a.left; 12647 return parseFloat(left); 12648 }, 12649 bottom: function (_a, _b) { 12650 var y = _a.y; 12651 var top = _b.top; 12652 return parseFloat(top) + (y.max - y.min); 12653 }, 12654 right: function (_a, _b) { 12655 var x = _a.x; 12656 var left = _b.left; 12657 return parseFloat(left) + (x.max - x.min); 12658 }, 12659 // Transform 12660 x: getTranslateFromMatrix(4, 13), 12661 y: getTranslateFromMatrix(5, 14), 12662 }; 12663 var convertChangedValueTypes = function (target, visualElement, changedKeys) { 12664 var originBbox = visualElement.measureViewportBox(); 12665 var element = visualElement.getInstance(); 12666 var elementComputedStyle = getComputedStyle(element); 12667 var display = elementComputedStyle.display, top = elementComputedStyle.top, left = elementComputedStyle.left, bottom = elementComputedStyle.bottom, right = elementComputedStyle.right, transform = elementComputedStyle.transform; 12668 var originComputedStyle = { top: top, left: left, bottom: bottom, right: right, transform: transform }; 12669 // If the element is currently set to display: "none", make it visible before 12670 // measuring the target bounding box 12671 if (display === "none") { 12672 visualElement.setStaticValue("display", target.display || "block"); 12673 } 12674 // Apply the latest values (as set in checkAndConvertChangedValueTypes) 12675 visualElement.syncRender(); 12676 var targetBbox = visualElement.measureViewportBox(); 12677 changedKeys.forEach(function (key) { 12678 // Restore styles to their **calculated computed style**, not their actual 12679 // originally set style. This allows us to animate between equivalent pixel units. 12680 var value = visualElement.getValue(key); 12681 setAndResetVelocity(value, positionalValues[key](originBbox, originComputedStyle)); 12682 target[key] = positionalValues[key](targetBbox, elementComputedStyle); 12683 }); 12684 return target; 12685 }; 12686 var checkAndConvertChangedValueTypes = function (visualElement, target, origin, transitionEnd) { 12687 if (origin === void 0) { origin = {}; } 12688 if (transitionEnd === void 0) { transitionEnd = {}; } 12689 target = __assign({}, target); 12690 transitionEnd = __assign({}, transitionEnd); 12691 var targetPositionalKeys = Object.keys(target).filter(isPositionalKey); 12692 // We want to remove any transform values that could affect the element's bounding box before 12693 // it's measured. We'll reapply these later. 12694 var removedTransformValues = []; 12695 var hasAttemptedToRemoveTransformValues = false; 12696 var changedValueTypeKeys = []; 12697 targetPositionalKeys.forEach(function (key) { 12698 var value = visualElement.getValue(key); 12699 if (!visualElement.hasValue(key)) 12700 return; 12701 var from = origin[key]; 12702 var to = target[key]; 12703 var fromType = findDimensionValueType(from); 12704 var toType; 12705 // TODO: The current implementation of this basically throws an error 12706 // if you try and do value conversion via keyframes. There's probably 12707 // a way of doing this but the performance implications would need greater scrutiny, 12708 // as it'd be doing multiple resize-remeasure operations. 12709 if (isKeyframesTarget(to)) { 12710 var numKeyframes = to.length; 12711 for (var i = to[0] === null ? 1 : 0; i < numKeyframes; i++) { 12712 if (!toType) { 12713 toType = findDimensionValueType(to[i]); 12714 invariant(toType === fromType || 12715 (isNumOrPxType(fromType) && isNumOrPxType(toType)), "Keyframes must be of the same dimension as the current value"); 12716 } 12717 else { 12718 invariant(findDimensionValueType(to[i]) === toType, "All keyframes must be of the same type"); 12719 } 12720 } 12721 } 12722 else { 12723 toType = findDimensionValueType(to); 12724 } 12725 if (fromType !== toType) { 12726 // If they're both just number or px, convert them both to numbers rather than 12727 // relying on resize/remeasure to convert (which is wasteful in this situation) 12728 if (isNumOrPxType(fromType) && isNumOrPxType(toType)) { 12729 var current = value.get(); 12730 if (typeof current === "string") { 12731 value.set(parseFloat(current)); 12732 } 12733 if (typeof to === "string") { 12734 target[key] = parseFloat(to); 12735 } 12736 else if (Array.isArray(to) && toType === px) { 12737 target[key] = to.map(parseFloat); 12738 } 12739 } 12740 else if ((fromType === null || fromType === void 0 ? void 0 : fromType.transform) && 12741 (toType === null || toType === void 0 ? void 0 : toType.transform) && 12742 (from === 0 || to === 0)) { 12743 // If one or the other value is 0, it's safe to coerce it to the 12744 // type of the other without measurement 12745 if (from === 0) { 12746 value.set(toType.transform(from)); 12747 } 12748 else { 12749 target[key] = fromType.transform(to); 12750 } 12751 } 12752 else { 12753 // If we're going to do value conversion via DOM measurements, we first 12754 // need to remove non-positional transform values that could affect the bbox measurements. 12755 if (!hasAttemptedToRemoveTransformValues) { 12756 removedTransformValues = removeNonTranslationalTransform(visualElement); 12757 hasAttemptedToRemoveTransformValues = true; 12758 } 12759 changedValueTypeKeys.push(key); 12760 transitionEnd[key] = 12761 transitionEnd[key] !== undefined 12762 ? transitionEnd[key] 12763 : target[key]; 12764 setAndResetVelocity(value, to); 12765 } 12766 } 12767 }); 12768 if (changedValueTypeKeys.length) { 12769 var convertedTarget = convertChangedValueTypes(target, visualElement, changedValueTypeKeys); 12770 // If we removed transform values, reapply them before the next render 12771 if (removedTransformValues.length) { 12772 removedTransformValues.forEach(function (_a) { 12773 var _b = __read(_a, 2), key = _b[0], value = _b[1]; 12774 visualElement.getValue(key).set(value); 12775 }); 12776 } 12777 // Reapply original values 12778 visualElement.syncRender(); 12779 return { target: convertedTarget, transitionEnd: transitionEnd }; 12780 } 12781 else { 12782 return { target: target, transitionEnd: transitionEnd }; 12783 } 12784 }; 12785 /** 12786 * Convert value types for x/y/width/height/top/left/bottom/right 12787 * 12788 * Allows animation between `'auto'` -> `'100%'` or `0` -> `'calc(50% - 10vw)'` 12789 * 12790 * @internal 12791 */ 12792 function unitConversion(visualElement, target, origin, transitionEnd) { 12793 return hasPositionalKey(target) 12794 ? checkAndConvertChangedValueTypes(visualElement, target, origin, transitionEnd) 12795 : { target: target, transitionEnd: transitionEnd }; 12796 } 12797 12798 12799 12800 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/parse-dom-variant.js 12801 12802 12803 12804 /** 12805 * Parse a DOM variant to make it animatable. This involves resolving CSS variables 12806 * and ensuring animations like "20%" => "calc(50vw)" are performed in pixels. 12807 */ 12808 var parseDomVariant = function (visualElement, target, origin, transitionEnd) { 12809 var resolved = resolveCSSVariables(visualElement, target, transitionEnd); 12810 target = resolved.target; 12811 transitionEnd = resolved.transitionEnd; 12812 return unitConversion(visualElement, target, origin, transitionEnd); 12813 }; 12814 12815 12816 12817 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/visual-element.js 12818 12819 12820 12821 12822 12823 12824 12825 12826 12827 12828 12829 12830 12831 function visual_element_getComputedStyle(element) { 12832 return window.getComputedStyle(element); 12833 } 12834 var htmlConfig = { 12835 treeType: "dom", 12836 readValueFromInstance: function (domElement, key) { 12837 if (isTransformProp(key)) { 12838 var defaultType = getDefaultValueType(key); 12839 return defaultType ? defaultType.default || 0 : 0; 12840 } 12841 else { 12842 var computedStyle = visual_element_getComputedStyle(domElement); 12843 return ((isCSSVariable(key) 12844 ? computedStyle.getPropertyValue(key) 12845 : computedStyle[key]) || 0); 12846 } 12847 }, 12848 sortNodePosition: function (a, b) { 12849 /** 12850 * compareDocumentPosition returns a bitmask, by using the bitwise & 12851 * we're returning true if 2 in that bitmask is set to true. 2 is set 12852 * to true if b preceeds a. 12853 */ 12854 return a.compareDocumentPosition(b) & 2 ? 1 : -1; 12855 }, 12856 getBaseTarget: function (props, key) { 12857 var _a; 12858 return (_a = props.style) === null || _a === void 0 ? void 0 : _a[key]; 12859 }, 12860 measureViewportBox: function (element, _a) { 12861 var transformPagePoint = _a.transformPagePoint; 12862 return getBoundingBox(element, transformPagePoint); 12863 }, 12864 /** 12865 * Reset the transform on the current Element. This is called as part 12866 * of a batched process across the entire layout tree. To remove this write 12867 * cycle it'd be interesting to see if it's possible to "undo" all the current 12868 * layout transforms up the tree in the same way this.getBoundingBoxWithoutTransforms 12869 * works 12870 */ 12871 resetTransform: function (element, domElement, props) { 12872 var transformTemplate = props.transformTemplate; 12873 domElement.style.transform = transformTemplate 12874 ? transformTemplate({}, "") 12875 : "none"; 12876 // Ensure that whatever happens next, we restore our transform on the next frame 12877 element.scheduleRender(); 12878 }, 12879 restoreTransform: function (instance, mutableState) { 12880 instance.style.transform = mutableState.style.transform; 12881 }, 12882 removeValueFromRenderState: function (key, _a) { 12883 var vars = _a.vars, style = _a.style; 12884 delete vars[key]; 12885 delete style[key]; 12886 }, 12887 /** 12888 * Ensure that HTML and Framer-specific value types like `px`->`%` and `Color` 12889 * can be animated by Motion. 12890 */ 12891 makeTargetAnimatable: function (element, _a, _b, isMounted) { 12892 var transformValues = _b.transformValues; 12893 if (isMounted === void 0) { isMounted = true; } 12894 var transition = _a.transition, transitionEnd = _a.transitionEnd, target = __rest(_a, ["transition", "transitionEnd"]); 12895 var origin = getOrigin(target, transition || {}, element); 12896 /** 12897 * If Framer has provided a function to convert `Color` etc value types, convert them 12898 */ 12899 if (transformValues) { 12900 if (transitionEnd) 12901 transitionEnd = transformValues(transitionEnd); 12902 if (target) 12903 target = transformValues(target); 12904 if (origin) 12905 origin = transformValues(origin); 12906 } 12907 if (isMounted) { 12908 checkTargetForNewValues(element, target, origin); 12909 var parsed = parseDomVariant(element, target, origin, transitionEnd); 12910 transitionEnd = parsed.transitionEnd; 12911 target = parsed.target; 12912 } 12913 return __assign({ transition: transition, 12914 transitionEnd: transitionEnd }, target); 12915 }, 12916 scrapeMotionValuesFromProps: scrape_motion_values_scrapeMotionValuesFromProps, 12917 build: function (element, renderState, latestValues, projection, layoutState, options, props) { 12918 if (element.isVisible !== undefined) { 12919 renderState.style.visibility = element.isVisible 12920 ? "visible" 12921 : "hidden"; 12922 } 12923 var isProjectionTranform = projection.isEnabled && layoutState.isHydrated; 12924 buildHTMLStyles(renderState, latestValues, projection, layoutState, options, props.transformTemplate, isProjectionTranform ? buildLayoutProjectionTransform : undefined, isProjectionTranform 12925 ? buildLayoutProjectionTransformOrigin 12926 : undefined); 12927 }, 12928 render: renderHTML, 12929 }; 12930 var htmlVisualElement = render_visualElement(htmlConfig); 12931 12932 12933 12934 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/visual-element.js 12935 12936 12937 12938 12939 12940 12941 12942 12943 12944 12945 12946 12947 var svgVisualElement = render_visualElement(__assign(__assign({}, htmlConfig), { getBaseTarget: function (props, key) { 12948 return props[key]; 12949 }, 12950 readValueFromInstance: function (domElement, key) { 12951 var _a; 12952 if (isTransformProp(key)) { 12953 return ((_a = getDefaultValueType(key)) === null || _a === void 0 ? void 0 : _a.default) || 0; 12954 } 12955 key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; 12956 return domElement.getAttribute(key); 12957 }, 12958 scrapeMotionValuesFromProps: utils_scrape_motion_values_scrapeMotionValuesFromProps, 12959 build: function (_element, renderState, latestValues, projection, layoutState, options, props) { 12960 var isProjectionTranform = projection.isEnabled && layoutState.isHydrated; 12961 buildSVGAttrs(renderState, latestValues, projection, layoutState, options, props.transformTemplate, isProjectionTranform ? buildLayoutProjectionTransform : undefined, isProjectionTranform 12962 ? buildLayoutProjectionTransformOrigin 12963 : undefined); 12964 }, render: renderSVG })); 12965 12966 12967 12968 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/create-visual-element.js 12969 12970 12971 12972 12973 var createDomVisualElement = function (Component, options) { 12974 return isSVGComponent(Component) 12975 ? svgVisualElement(options, { enableHardwareAcceleration: false }) 12976 : htmlVisualElement(options, { enableHardwareAcceleration: true }); 12977 }; 12978 12979 12980 12981 // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/motion.js 12982 12983 12984 12985 12986 12987 12988 12989 12990 12991 12992 var featureBundle = __assign(__assign(__assign(__assign({}, animations_animations), gestureAnimations), drag_drag), layoutAnimations); 12993 /** 12994 * HTML & SVG components, optimised for use with gestures and animation. These can be used as 12995 * drop-in replacements for any HTML & SVG component, all CSS & SVG properties are supported. 12996 * 12997 * @public 12998 */ 12999 var motion = /*@__PURE__*/ createMotionProxy(function (Component, config) { 13000 return createDomMotionConfig(Component, config, featureBundle, createDomVisualElement); 13001 }); 13002 /** 13003 * Create a DOM `motion` component with the provided string. This is primarily intended 13004 * as a full alternative to `motion` for consumers who have to support environments that don't 13005 * support `Proxy`. 13006 * 13007 * ```javascript 13008 * import { createDomMotionComponent } from "framer-motion" 13009 * 13010 * const motion = { 13011 * div: createDomMotionComponent('div') 13012 * } 13013 * ``` 13014 * 13015 * @public 13016 */ 13017 function createDomMotionComponent(key) { 13018 return createMotionComponent(createDomMotionConfig(key, { forwardMotionProps: false }, featureBundle, createDomVisualElement)); 13019 } 13020 13021 13022 13023 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/arrow-left.js 13024 var arrow_left = __webpack_require__("cjQ8"); 13025 13026 // EXTERNAL MODULE: external ["wp","a11y"] 13027 var external_wp_a11y_ = __webpack_require__("gdqT"); 13028 13029 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/visual-editor/block-inspector-button.js 13030 13031 13032 /** 13033 * External dependencies 13034 */ 13035 13036 /** 13037 * WordPress dependencies 13038 */ 13039 13040 13041 13042 13043 13044 13045 /** 13046 * Internal dependencies 13047 */ 13048 13049 13050 function BlockInspectorButton({ 13051 onClick = external_lodash_["noop"], 13052 small = false 13053 }) { 13054 const { 13055 shortcut, 13056 areAdvancedSettingsOpened 13057 } = Object(external_wp_data_["useSelect"])(select => ({ 13058 shortcut: select(external_wp_keyboardShortcuts_["store"]).getShortcutRepresentation('core/edit-post/toggle-sidebar'), 13059 areAdvancedSettingsOpened: select(store["a" /* store */]).getActiveGeneralSidebarName() === 'edit-post/block' 13060 }), []); 13061 const { 13062 openGeneralSidebar, 13063 closeGeneralSidebar 13064 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 13065 13066 const speakMessage = () => { 13067 if (areAdvancedSettingsOpened) { 13068 Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('Block settings closed')); 13069 } else { 13070 Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('Additional settings are now available in the Editor block settings sidebar')); 13071 } 13072 }; 13073 13074 const label = areAdvancedSettingsOpened ? Object(external_wp_i18n_["__"])('Hide more settings') : Object(external_wp_i18n_["__"])('Show more settings'); 13075 return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { 13076 onClick: () => { 13077 if (areAdvancedSettingsOpened) { 13078 closeGeneralSidebar(); 13079 } else { 13080 openGeneralSidebar('edit-post/block'); 13081 speakMessage(); 13082 onClick(); 13083 } 13084 }, 13085 shortcut: shortcut 13086 }, !small && label); 13087 } 13088 /* harmony default export */ var block_inspector_button = (BlockInspectorButton); 13089 13090 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/visual-editor/index.js 13091 13092 13093 /** 13094 * External dependencies 13095 */ 13096 13097 13098 /** 13099 * WordPress dependencies 13100 */ 13101 13102 13103 13104 13105 13106 13107 13108 13109 13110 /** 13111 * Internal dependencies 13112 */ 13113 13114 13115 13116 13117 function MaybeIframe({ 13118 children, 13119 contentRef, 13120 isTemplateMode, 13121 styles, 13122 style 13123 }) { 13124 const ref = Object(external_wp_blockEditor_["__unstableUseMouseMoveTypingReset"])(); 13125 13126 if (!isTemplateMode) { 13127 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__unstableEditorStyles"], { 13128 styles: styles 13129 }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["WritingFlow"], { 13130 ref: contentRef, 13131 className: "editor-styles-wrapper", 13132 style: { 13133 flex: '1', 13134 ...style 13135 }, 13136 tabIndex: -1 13137 }, children)); 13138 } 13139 13140 return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__unstableIframe"], { 13141 head: Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__unstableEditorStyles"], { 13142 styles: styles 13143 }), 13144 ref: ref, 13145 contentRef: contentRef, 13146 style: { 13147 width: '100%', 13148 height: '100%', 13149 display: 'block' 13150 } 13151 }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["WritingFlow"], null, children)); 13152 } 13153 13154 function VisualEditor({ 13155 styles 13156 }) { 13157 const { 13158 deviceType, 13159 isTemplateMode, 13160 wrapperBlockName, 13161 wrapperUniqueId 13162 } = Object(external_wp_data_["useSelect"])(select => { 13163 const { 13164 isEditingTemplate, 13165 __experimentalGetPreviewDeviceType 13166 } = select(store["a" /* store */]); 13167 const { 13168 getCurrentPostId, 13169 getCurrentPostType 13170 } = select(external_wp_editor_["store"]); 13171 13172 const _isTemplateMode = isEditingTemplate(); 13173 13174 let _wrapperBlockName; 13175 13176 if (getCurrentPostType() === 'wp_block') { 13177 _wrapperBlockName = 'core/block'; 13178 } else if (!_isTemplateMode) { 13179 _wrapperBlockName = 'core/post-content'; 13180 } 13181 13182 return { 13183 deviceType: __experimentalGetPreviewDeviceType(), 13184 isTemplateMode: _isTemplateMode, 13185 wrapperBlockName: _wrapperBlockName, 13186 wrapperUniqueId: getCurrentPostId() 13187 }; 13188 }, []); 13189 const hasMetaBoxes = Object(external_wp_data_["useSelect"])(select => select(store["a" /* store */]).hasMetaBoxes(), []); 13190 const themeSupportsLayout = Object(external_wp_data_["useSelect"])(select => { 13191 const { 13192 getSettings 13193 } = select(external_wp_blockEditor_["store"]); 13194 return getSettings().supportsLayout; 13195 }, []); 13196 const { 13197 clearSelectedBlock 13198 } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]); 13199 const { 13200 setIsEditingTemplate 13201 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 13202 const desktopCanvasStyles = { 13203 height: '100%', 13204 width: '100%', 13205 margin: 0, 13206 display: 'flex', 13207 flexFlow: 'column', 13208 // Default background color so that grey 13209 // .edit-post-editor-regions__content color doesn't show through. 13210 background: 'white' 13211 }; 13212 const templateModeStyles = { ...desktopCanvasStyles, 13213 borderRadius: '2px 2px 0 0', 13214 border: '1px solid #ddd', 13215 borderBottom: 0 13216 }; 13217 const resizedCanvasStyles = Object(external_wp_blockEditor_["__experimentalUseResizeCanvas"])(deviceType, isTemplateMode); 13218 const defaultLayout = Object(external_wp_blockEditor_["useSetting"])('layout'); 13219 const { 13220 contentSize, 13221 wideSize 13222 } = defaultLayout || {}; 13223 let animatedStyles = isTemplateMode ? templateModeStyles : desktopCanvasStyles; 13224 13225 if (resizedCanvasStyles) { 13226 animatedStyles = resizedCanvasStyles; 13227 } 13228 13229 let paddingBottom; // Add a constant padding for the typewritter effect. When typing at the 13230 // bottom, there needs to be room to scroll up. 13231 13232 if (!hasMetaBoxes && !resizedCanvasStyles && !isTemplateMode) { 13233 paddingBottom = '40vh'; 13234 } 13235 13236 const ref = Object(external_wp_element_["useRef"])(); 13237 const contentRef = Object(external_wp_compose_["useMergeRefs"])([ref, Object(external_wp_blockEditor_["__unstableUseClipboardHandler"])(), Object(external_wp_blockEditor_["__unstableUseCanvasClickRedirect"])(), Object(external_wp_blockEditor_["__unstableUseTypewriter"])(), Object(external_wp_blockEditor_["__unstableUseTypingObserver"])(), Object(external_wp_blockEditor_["__unstableUseBlockSelectionClearer"])()]); 13238 const blockSelectionClearerRef = Object(external_wp_blockEditor_["__unstableUseBlockSelectionClearer"])(); 13239 const [, RecursionProvider] = Object(external_wp_blockEditor_["__experimentalUseNoRecursiveRenders"])(wrapperUniqueId, wrapperBlockName); 13240 const layout = Object(external_wp_element_["useMemo"])(() => { 13241 if (isTemplateMode) { 13242 return { 13243 type: 'default' 13244 }; 13245 } 13246 13247 if (themeSupportsLayout) { 13248 const alignments = contentSize || wideSize ? ['wide', 'full', 'left', 'center', 'right'] : ['left', 'center', 'right']; 13249 return { 13250 type: 'default', 13251 // Find a way to inject this in the support flag code (hooks). 13252 alignments 13253 }; 13254 } 13255 13256 return undefined; 13257 }, [isTemplateMode, themeSupportsLayout, contentSize, wideSize]); 13258 return Object(external_wp_element_["createElement"])("div", { 13259 className: classnames_default()('edit-post-visual-editor', { 13260 'is-template-mode': isTemplateMode 13261 }) 13262 }, Object(external_wp_element_["createElement"])(external_wp_editor_["VisualEditorGlobalKeyboardShortcuts"], null), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockTools"], { 13263 __unstableContentRef: ref 13264 }, Object(external_wp_element_["createElement"])(motion.div, { 13265 className: "edit-post-visual-editor__content-area", 13266 animate: { 13267 padding: isTemplateMode ? '48px 48px 0' : '0' 13268 }, 13269 ref: blockSelectionClearerRef 13270 }, isTemplateMode && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 13271 className: "edit-post-visual-editor__exit-template-mode", 13272 icon: arrow_left["a" /* default */], 13273 onClick: () => { 13274 clearSelectedBlock(); 13275 setIsEditingTemplate(false); 13276 } 13277 }, Object(external_wp_i18n_["__"])('Back')), Object(external_wp_element_["createElement"])(motion.div, { 13278 animate: animatedStyles, 13279 initial: desktopCanvasStyles 13280 }, Object(external_wp_element_["createElement"])(MaybeIframe, { 13281 isTemplateMode: isTemplateMode, 13282 contentRef: contentRef, 13283 styles: styles, 13284 style: { 13285 paddingBottom 13286 } 13287 }, themeSupportsLayout && !isTemplateMode && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalLayoutStyle"], { 13288 selector: ".edit-post-visual-editor__post-title-wrapper, .block-editor-block-list__layout.is-root-container", 13289 layout: defaultLayout 13290 }), !isTemplateMode && Object(external_wp_element_["createElement"])("div", { 13291 className: "edit-post-visual-editor__post-title-wrapper" 13292 }, Object(external_wp_element_["createElement"])(external_wp_editor_["PostTitle"], null)), Object(external_wp_element_["createElement"])(RecursionProvider, null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockList"], { 13293 __experimentalLayout: layout 13294 })))))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__unstableBlockSettingsMenuFirstItem"], null, ({ 13295 onClose 13296 }) => Object(external_wp_element_["createElement"])(block_inspector_button, { 13297 onClick: onClose 13298 }))); 13299 } 13300 13301 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcuts/index.js 13302 /** 13303 * WordPress dependencies 13304 */ 13305 13306 13307 13308 13309 13310 13311 /** 13312 * Internal dependencies 13313 */ 13314 13315 13316 13317 function KeyboardShortcuts() { 13318 const { 13319 getBlockSelectionStart 13320 } = Object(external_wp_data_["useSelect"])(external_wp_blockEditor_["store"]); 13321 const { 13322 getEditorMode, 13323 isEditorSidebarOpened, 13324 isListViewOpened 13325 } = Object(external_wp_data_["useSelect"])(store["a" /* store */]); 13326 const isModeToggleDisabled = Object(external_wp_data_["useSelect"])(select => { 13327 const { 13328 richEditingEnabled, 13329 codeEditingEnabled 13330 } = select(external_wp_editor_["store"]).getEditorSettings(); 13331 return !richEditingEnabled || !codeEditingEnabled; 13332 }, []); 13333 const { 13334 switchEditorMode, 13335 openGeneralSidebar, 13336 closeGeneralSidebar, 13337 toggleFeature, 13338 setIsListViewOpened 13339 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 13340 const { 13341 registerShortcut 13342 } = Object(external_wp_data_["useDispatch"])(external_wp_keyboardShortcuts_["store"]); 13343 Object(external_wp_element_["useEffect"])(() => { 13344 registerShortcut({ 13345 name: 'core/edit-post/toggle-mode', 13346 category: 'global', 13347 description: Object(external_wp_i18n_["__"])('Switch between visual editor and code editor.'), 13348 keyCombination: { 13349 modifier: 'secondary', 13350 character: 'm' 13351 } 13352 }); 13353 registerShortcut({ 13354 name: 'core/edit-post/toggle-fullscreen', 13355 category: 'global', 13356 description: Object(external_wp_i18n_["__"])('Toggle fullscreen mode.'), 13357 keyCombination: { 13358 modifier: 'secondary', 13359 character: 'f' 13360 } 13361 }); 13362 registerShortcut({ 13363 name: 'core/edit-post/toggle-block-navigation', 13364 category: 'global', 13365 description: Object(external_wp_i18n_["__"])('Open the block list view.'), 13366 keyCombination: { 13367 modifier: 'access', 13368 character: 'o' 13369 } 13370 }); 13371 registerShortcut({ 13372 name: 'core/edit-post/toggle-sidebar', 13373 category: 'global', 13374 description: Object(external_wp_i18n_["__"])('Show or hide the settings sidebar.'), 13375 keyCombination: { 13376 modifier: 'primaryShift', 13377 character: ',' 13378 } 13379 }); 13380 registerShortcut({ 13381 name: 'core/edit-post/next-region', 13382 category: 'global', 13383 description: Object(external_wp_i18n_["__"])('Navigate to the next part of the editor.'), 13384 keyCombination: { 13385 modifier: 'ctrl', 13386 character: '`' 13387 }, 13388 aliases: [{ 13389 modifier: 'access', 13390 character: 'n' 13391 }] 13392 }); 13393 registerShortcut({ 13394 name: 'core/edit-post/previous-region', 13395 category: 'global', 13396 description: Object(external_wp_i18n_["__"])('Navigate to the previous part of the editor.'), 13397 keyCombination: { 13398 modifier: 'ctrlShift', 13399 character: '`' 13400 }, 13401 aliases: [{ 13402 modifier: 'access', 13403 character: 'p' 13404 }] 13405 }); 13406 registerShortcut({ 13407 name: 'core/edit-post/keyboard-shortcuts', 13408 category: 'main', 13409 description: Object(external_wp_i18n_["__"])('Display these keyboard shortcuts.'), 13410 keyCombination: { 13411 modifier: 'access', 13412 character: 'h' 13413 } 13414 }); 13415 }, []); 13416 Object(external_wp_keyboardShortcuts_["useShortcut"])('core/edit-post/toggle-mode', () => { 13417 switchEditorMode(getEditorMode() === 'visual' ? 'text' : 'visual'); 13418 }, { 13419 bindGlobal: true, 13420 isDisabled: isModeToggleDisabled 13421 }); 13422 Object(external_wp_keyboardShortcuts_["useShortcut"])('core/edit-post/toggle-fullscreen', () => { 13423 toggleFeature('fullscreenMode'); 13424 }, { 13425 bindGlobal: true 13426 }); 13427 Object(external_wp_keyboardShortcuts_["useShortcut"])('core/edit-post/toggle-sidebar', event => { 13428 // This shortcut has no known clashes, but use preventDefault to prevent any 13429 // obscure shortcuts from triggering. 13430 event.preventDefault(); 13431 13432 if (isEditorSidebarOpened()) { 13433 closeGeneralSidebar(); 13434 } else { 13435 const sidebarToOpen = getBlockSelectionStart() ? 'edit-post/block' : 'edit-post/document'; 13436 openGeneralSidebar(sidebarToOpen); 13437 } 13438 }, { 13439 bindGlobal: true 13440 }); 13441 Object(external_wp_keyboardShortcuts_["useShortcut"])('core/edit-post/toggle-block-navigation', () => setIsListViewOpened(!isListViewOpened()), { 13442 bindGlobal: true 13443 }); 13444 return null; 13445 } 13446 13447 /* harmony default export */ var keyboard_shortcuts = (KeyboardShortcuts); 13448 13449 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcut-help-modal/config.js 13450 /** 13451 * WordPress dependencies 13452 */ 13453 13454 const textFormattingShortcuts = [{ 13455 keyCombination: { 13456 modifier: 'primary', 13457 character: 'b' 13458 }, 13459 description: Object(external_wp_i18n_["__"])('Make the selected text bold.') 13460 }, { 13461 keyCombination: { 13462 modifier: 'primary', 13463 character: 'i' 13464 }, 13465 description: Object(external_wp_i18n_["__"])('Make the selected text italic.') 13466 }, { 13467 keyCombination: { 13468 modifier: 'primary', 13469 character: 'k' 13470 }, 13471 description: Object(external_wp_i18n_["__"])('Convert the selected text into a link.') 13472 }, { 13473 keyCombination: { 13474 modifier: 'primaryShift', 13475 character: 'k' 13476 }, 13477 description: Object(external_wp_i18n_["__"])('Remove a link.') 13478 }, { 13479 keyCombination: { 13480 modifier: 'primary', 13481 character: 'u' 13482 }, 13483 description: Object(external_wp_i18n_["__"])('Underline the selected text.') 13484 }]; 13485 13486 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcut-help-modal/shortcut.js 13487 13488 13489 /** 13490 * External dependencies 13491 */ 13492 13493 /** 13494 * WordPress dependencies 13495 */ 13496 13497 13498 13499 13500 function KeyCombination({ 13501 keyCombination, 13502 forceAriaLabel 13503 }) { 13504 const shortcut = keyCombination.modifier ? external_wp_keycodes_["displayShortcutList"][keyCombination.modifier](keyCombination.character) : keyCombination.character; 13505 const ariaLabel = keyCombination.modifier ? external_wp_keycodes_["shortcutAriaLabel"][keyCombination.modifier](keyCombination.character) : keyCombination.character; 13506 return Object(external_wp_element_["createElement"])("kbd", { 13507 className: "edit-post-keyboard-shortcut-help-modal__shortcut-key-combination", 13508 "aria-label": forceAriaLabel || ariaLabel 13509 }, Object(external_lodash_["castArray"])(shortcut).map((character, index) => { 13510 if (character === '+') { 13511 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], { 13512 key: index 13513 }, character); 13514 } 13515 13516 return Object(external_wp_element_["createElement"])("kbd", { 13517 key: index, 13518 className: "edit-post-keyboard-shortcut-help-modal__shortcut-key" 13519 }, character); 13520 })); 13521 } 13522 13523 function Shortcut({ 13524 description, 13525 keyCombination, 13526 aliases = [], 13527 ariaLabel 13528 }) { 13529 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("div", { 13530 className: "edit-post-keyboard-shortcut-help-modal__shortcut-description" 13531 }, description), Object(external_wp_element_["createElement"])("div", { 13532 className: "edit-post-keyboard-shortcut-help-modal__shortcut-term" 13533 }, Object(external_wp_element_["createElement"])(KeyCombination, { 13534 keyCombination: keyCombination, 13535 forceAriaLabel: ariaLabel 13536 }), aliases.map((alias, index) => Object(external_wp_element_["createElement"])(KeyCombination, { 13537 keyCombination: alias, 13538 forceAriaLabel: ariaLabel, 13539 key: index 13540 })))); 13541 } 13542 13543 /* harmony default export */ var keyboard_shortcut_help_modal_shortcut = (Shortcut); 13544 13545 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js 13546 13547 13548 /** 13549 * WordPress dependencies 13550 */ 13551 13552 13553 /** 13554 * Internal dependencies 13555 */ 13556 13557 13558 13559 function DynamicShortcut({ 13560 name 13561 }) { 13562 const { 13563 keyCombination, 13564 description, 13565 aliases 13566 } = Object(external_wp_data_["useSelect"])(select => { 13567 const { 13568 getShortcutKeyCombination, 13569 getShortcutDescription, 13570 getShortcutAliases 13571 } = select(external_wp_keyboardShortcuts_["store"]); 13572 return { 13573 keyCombination: getShortcutKeyCombination(name), 13574 aliases: getShortcutAliases(name), 13575 description: getShortcutDescription(name) 13576 }; 13577 }); 13578 13579 if (!keyCombination) { 13580 return null; 13581 } 13582 13583 return Object(external_wp_element_["createElement"])(keyboard_shortcut_help_modal_shortcut, { 13584 keyCombination: keyCombination, 13585 description: description, 13586 aliases: aliases 13587 }); 13588 } 13589 13590 /* harmony default export */ var dynamic_shortcut = (DynamicShortcut); 13591 13592 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcut-help-modal/index.js 13593 13594 13595 /** 13596 * External dependencies 13597 */ 13598 13599 13600 /** 13601 * WordPress dependencies 13602 */ 13603 13604 13605 13606 13607 13608 13609 /** 13610 * Internal dependencies 13611 */ 13612 13613 13614 13615 13616 13617 const MODAL_NAME = 'edit-post/keyboard-shortcut-help'; 13618 13619 const ShortcutList = ({ 13620 shortcuts 13621 }) => 13622 /* 13623 * Disable reason: The `list` ARIA role is redundant but 13624 * Safari+VoiceOver won't announce the list otherwise. 13625 */ 13626 13627 /* eslint-disable jsx-a11y/no-redundant-roles */ 13628 Object(external_wp_element_["createElement"])("ul", { 13629 className: "edit-post-keyboard-shortcut-help-modal__shortcut-list", 13630 role: "list" 13631 }, shortcuts.map((shortcut, index) => Object(external_wp_element_["createElement"])("li", { 13632 className: "edit-post-keyboard-shortcut-help-modal__shortcut", 13633 key: index 13634 }, Object(external_lodash_["isString"])(shortcut) ? Object(external_wp_element_["createElement"])(dynamic_shortcut, { 13635 name: shortcut 13636 }) : Object(external_wp_element_["createElement"])(keyboard_shortcut_help_modal_shortcut, shortcut)))) 13637 /* eslint-enable jsx-a11y/no-redundant-roles */ 13638 ; 13639 13640 const ShortcutSection = ({ 13641 title, 13642 shortcuts, 13643 className 13644 }) => Object(external_wp_element_["createElement"])("section", { 13645 className: classnames_default()('edit-post-keyboard-shortcut-help-modal__section', className) 13646 }, !!title && Object(external_wp_element_["createElement"])("h2", { 13647 className: "edit-post-keyboard-shortcut-help-modal__section-title" 13648 }, title), Object(external_wp_element_["createElement"])(ShortcutList, { 13649 shortcuts: shortcuts 13650 })); 13651 13652 const ShortcutCategorySection = ({ 13653 title, 13654 categoryName, 13655 additionalShortcuts = [] 13656 }) => { 13657 const categoryShortcuts = Object(external_wp_data_["useSelect"])(select => { 13658 return select(external_wp_keyboardShortcuts_["store"]).getCategoryShortcuts(categoryName); 13659 }, [categoryName]); 13660 return Object(external_wp_element_["createElement"])(ShortcutSection, { 13661 title: title, 13662 shortcuts: categoryShortcuts.concat(additionalShortcuts) 13663 }); 13664 }; 13665 13666 function KeyboardShortcutHelpModal({ 13667 isModalActive, 13668 toggleModal 13669 }) { 13670 Object(external_wp_keyboardShortcuts_["useShortcut"])('core/edit-post/keyboard-shortcuts', toggleModal, { 13671 bindGlobal: true 13672 }); 13673 13674 if (!isModalActive) { 13675 return null; 13676 } 13677 13678 return Object(external_wp_element_["createElement"])(external_wp_components_["Modal"], { 13679 className: "edit-post-keyboard-shortcut-help-modal", 13680 title: Object(external_wp_i18n_["__"])('Keyboard shortcuts'), 13681 closeLabel: Object(external_wp_i18n_["__"])('Close'), 13682 onRequestClose: toggleModal 13683 }, Object(external_wp_element_["createElement"])(ShortcutSection, { 13684 className: "edit-post-keyboard-shortcut-help-modal__main-shortcuts", 13685 shortcuts: ['core/edit-post/keyboard-shortcuts'] 13686 }), Object(external_wp_element_["createElement"])(ShortcutCategorySection, { 13687 title: Object(external_wp_i18n_["__"])('Global shortcuts'), 13688 categoryName: "global" 13689 }), Object(external_wp_element_["createElement"])(ShortcutCategorySection, { 13690 title: Object(external_wp_i18n_["__"])('Selection shortcuts'), 13691 categoryName: "selection" 13692 }), Object(external_wp_element_["createElement"])(ShortcutCategorySection, { 13693 title: Object(external_wp_i18n_["__"])('Block shortcuts'), 13694 categoryName: "block", 13695 additionalShortcuts: [{ 13696 keyCombination: { 13697 character: '/' 13698 }, 13699 description: Object(external_wp_i18n_["__"])('Change the block type after adding a new paragraph.'), 13700 13701 /* translators: The forward-slash character. e.g. '/'. */ 13702 ariaLabel: Object(external_wp_i18n_["__"])('Forward-slash') 13703 }] 13704 }), Object(external_wp_element_["createElement"])(ShortcutSection, { 13705 title: Object(external_wp_i18n_["__"])('Text formatting'), 13706 shortcuts: textFormattingShortcuts 13707 })); 13708 } 13709 /* harmony default export */ var keyboard_shortcut_help_modal = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])(select => ({ 13710 isModalActive: select(store["a" /* store */]).isModalActive(MODAL_NAME) 13711 })), Object(external_wp_data_["withDispatch"])((dispatch, { 13712 isModalActive 13713 }) => { 13714 const { 13715 openModal, 13716 closeModal 13717 } = dispatch(store["a" /* store */]); 13718 return { 13719 toggleModal: () => isModalActive ? closeModal() : openModal(MODAL_NAME) 13720 }; 13721 })])(KeyboardShortcutHelpModal)); 13722 13723 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/manage-blocks-modal/checklist.js 13724 13725 13726 /** 13727 * External dependencies 13728 */ 13729 13730 /** 13731 * WordPress dependencies 13732 */ 13733 13734 13735 13736 13737 function BlockTypesChecklist({ 13738 blockTypes, 13739 value, 13740 onItemChange 13741 }) { 13742 return Object(external_wp_element_["createElement"])("ul", { 13743 className: "edit-post-manage-blocks-modal__checklist" 13744 }, blockTypes.map(blockType => Object(external_wp_element_["createElement"])("li", { 13745 key: blockType.name, 13746 className: "edit-post-manage-blocks-modal__checklist-item" 13747 }, Object(external_wp_element_["createElement"])(external_wp_components_["CheckboxControl"], { 13748 label: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, blockType.title, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockIcon"], { 13749 icon: blockType.icon 13750 })), 13751 checked: value.includes(blockType.name), 13752 onChange: Object(external_lodash_["partial"])(onItemChange, blockType.name) 13753 })))); 13754 } 13755 13756 /* harmony default export */ var checklist = (BlockTypesChecklist); 13757 13758 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/edit-post-settings/index.js 13759 /** 13760 * WordPress dependencies 13761 */ 13762 13763 const EditPostSettings = Object(external_wp_element_["createContext"])({}); 13764 /* harmony default export */ var edit_post_settings = (EditPostSettings); 13765 13766 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/manage-blocks-modal/category.js 13767 13768 13769 /** 13770 * External dependencies 13771 */ 13772 13773 /** 13774 * WordPress dependencies 13775 */ 13776 13777 13778 13779 13780 13781 /** 13782 * Internal dependencies 13783 */ 13784 13785 13786 13787 13788 13789 function BlockManagerCategory({ 13790 instanceId, 13791 title, 13792 blockTypes, 13793 hiddenBlockTypes, 13794 toggleVisible, 13795 toggleAllVisible 13796 }) { 13797 const settings = Object(external_wp_element_["useContext"])(edit_post_settings); 13798 const { 13799 allowedBlockTypes 13800 } = settings; 13801 const filteredBlockTypes = Object(external_wp_element_["useMemo"])(() => { 13802 if (allowedBlockTypes === true) { 13803 return blockTypes; 13804 } 13805 13806 return blockTypes.filter(({ 13807 name 13808 }) => { 13809 return Object(external_lodash_["includes"])(allowedBlockTypes || [], name); 13810 }); 13811 }, [allowedBlockTypes, blockTypes]); 13812 13813 if (!filteredBlockTypes.length) { 13814 return null; 13815 } 13816 13817 const checkedBlockNames = Object(external_lodash_["without"])(Object(external_lodash_["map"])(filteredBlockTypes, 'name'), ...hiddenBlockTypes); 13818 const titleId = 'edit-post-manage-blocks-modal__category-title-' + instanceId; 13819 const isAllChecked = checkedBlockNames.length === filteredBlockTypes.length; 13820 let ariaChecked; 13821 13822 if (isAllChecked) { 13823 ariaChecked = 'true'; 13824 } else if (checkedBlockNames.length > 0) { 13825 ariaChecked = 'mixed'; 13826 } else { 13827 ariaChecked = 'false'; 13828 } 13829 13830 return Object(external_wp_element_["createElement"])("div", { 13831 role: "group", 13832 "aria-labelledby": titleId, 13833 className: "edit-post-manage-blocks-modal__category" 13834 }, Object(external_wp_element_["createElement"])(external_wp_components_["CheckboxControl"], { 13835 checked: isAllChecked, 13836 onChange: toggleAllVisible, 13837 className: "edit-post-manage-blocks-modal__category-title", 13838 "aria-checked": ariaChecked, 13839 label: Object(external_wp_element_["createElement"])("span", { 13840 id: titleId 13841 }, title) 13842 }), Object(external_wp_element_["createElement"])(checklist, { 13843 blockTypes: filteredBlockTypes, 13844 value: checkedBlockNames, 13845 onItemChange: toggleVisible 13846 })); 13847 } 13848 13849 /* harmony default export */ var manage_blocks_modal_category = (Object(external_wp_compose_["compose"])([external_wp_compose_["withInstanceId"], Object(external_wp_data_["withSelect"])(select => { 13850 const { 13851 getPreference 13852 } = select(store["a" /* store */]); 13853 return { 13854 hiddenBlockTypes: getPreference('hiddenBlockTypes') 13855 }; 13856 }), Object(external_wp_data_["withDispatch"])((dispatch, ownProps) => { 13857 const { 13858 showBlockTypes, 13859 hideBlockTypes 13860 } = dispatch(store["a" /* store */]); 13861 return { 13862 toggleVisible(blockName, nextIsChecked) { 13863 if (nextIsChecked) { 13864 showBlockTypes(blockName); 13865 } else { 13866 hideBlockTypes(blockName); 13867 } 13868 }, 13869 13870 toggleAllVisible(nextIsChecked) { 13871 const blockNames = Object(external_lodash_["map"])(ownProps.blockTypes, 'name'); 13872 13873 if (nextIsChecked) { 13874 showBlockTypes(blockNames); 13875 } else { 13876 hideBlockTypes(blockNames); 13877 } 13878 } 13879 13880 }; 13881 })])(BlockManagerCategory)); 13882 13883 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/manage-blocks-modal/manager.js 13884 13885 13886 /** 13887 * External dependencies 13888 */ 13889 13890 /** 13891 * WordPress dependencies 13892 */ 13893 13894 13895 13896 13897 13898 13899 /** 13900 * Internal dependencies 13901 */ 13902 13903 13904 13905 13906 function BlockManager({ 13907 search, 13908 setState, 13909 blockTypes, 13910 categories, 13911 hasBlockSupport, 13912 isMatchingSearchTerm, 13913 numberOfHiddenBlocks 13914 }) { 13915 // Filtering occurs here (as opposed to `withSelect`) to avoid 13916 // wasted renders by consequence of `Array#filter` producing 13917 // a new value reference on each call. 13918 blockTypes = blockTypes.filter(blockType => hasBlockSupport(blockType, 'inserter', true) && (!search || isMatchingSearchTerm(blockType, search)) && (!blockType.parent || Object(external_lodash_["includes"])(blockType.parent, 'core/post-content'))); 13919 return Object(external_wp_element_["createElement"])("div", { 13920 className: "edit-post-manage-blocks-modal__content" 13921 }, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], { 13922 type: "search", 13923 label: Object(external_wp_i18n_["__"])('Search for a block'), 13924 value: search, 13925 onChange: nextSearch => setState({ 13926 search: nextSearch 13927 }), 13928 className: "edit-post-manage-blocks-modal__search" 13929 }), !!numberOfHiddenBlocks && Object(external_wp_element_["createElement"])("div", { 13930 className: "edit-post-manage-blocks-modal__disabled-blocks-count" 13931 }, Object(external_wp_i18n_["sprintf"])( 13932 /* translators: %d: number of blocks. */ 13933 Object(external_wp_i18n_["_n"])('%d block is disabled.', '%d blocks are disabled.', numberOfHiddenBlocks), numberOfHiddenBlocks)), Object(external_wp_element_["createElement"])("div", { 13934 tabIndex: "0", 13935 role: "region", 13936 "aria-label": Object(external_wp_i18n_["__"])('Available block types'), 13937 className: "edit-post-manage-blocks-modal__results" 13938 }, blockTypes.length === 0 && Object(external_wp_element_["createElement"])("p", { 13939 className: "edit-post-manage-blocks-modal__no-results" 13940 }, Object(external_wp_i18n_["__"])('No blocks found.')), categories.map(category => Object(external_wp_element_["createElement"])(manage_blocks_modal_category, { 13941 key: category.slug, 13942 title: category.title, 13943 blockTypes: Object(external_lodash_["filter"])(blockTypes, { 13944 category: category.slug 13945 }) 13946 })), Object(external_wp_element_["createElement"])(manage_blocks_modal_category, { 13947 title: Object(external_wp_i18n_["__"])('Uncategorized'), 13948 blockTypes: Object(external_lodash_["filter"])(blockTypes, ({ 13949 category 13950 }) => !category) 13951 }))); 13952 } 13953 13954 /* harmony default export */ var manage_blocks_modal_manager = (Object(external_wp_compose_["compose"])([Object(external_wp_compose_["withState"])({ 13955 search: '' 13956 }), Object(external_wp_data_["withSelect"])(select => { 13957 const { 13958 getBlockTypes, 13959 getCategories, 13960 hasBlockSupport, 13961 isMatchingSearchTerm 13962 } = select(external_wp_blocks_["store"]); 13963 const { 13964 getPreference 13965 } = select(store["a" /* store */]); 13966 const hiddenBlockTypes = getPreference('hiddenBlockTypes'); 13967 const numberOfHiddenBlocks = Object(external_lodash_["isArray"])(hiddenBlockTypes) && hiddenBlockTypes.length; 13968 return { 13969 blockTypes: getBlockTypes(), 13970 categories: getCategories(), 13971 hasBlockSupport, 13972 isMatchingSearchTerm, 13973 numberOfHiddenBlocks 13974 }; 13975 })])(BlockManager)); 13976 13977 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/manage-blocks-modal/index.js 13978 13979 13980 /** 13981 * WordPress dependencies 13982 */ 13983 13984 13985 13986 13987 /** 13988 * Internal dependencies 13989 */ 13990 13991 13992 13993 /** 13994 * Unique identifier for Manage Blocks modal. 13995 * 13996 * @type {string} 13997 */ 13998 13999 const manage_blocks_modal_MODAL_NAME = 'edit-post/manage-blocks'; 14000 function ManageBlocksModal({ 14001 isActive, 14002 closeModal 14003 }) { 14004 if (!isActive) { 14005 return null; 14006 } 14007 14008 return Object(external_wp_element_["createElement"])(external_wp_components_["Modal"], { 14009 className: "edit-post-manage-blocks-modal", 14010 title: Object(external_wp_i18n_["__"])('Block Manager'), 14011 closeLabel: Object(external_wp_i18n_["__"])('Close'), 14012 onRequestClose: closeModal 14013 }, Object(external_wp_element_["createElement"])(manage_blocks_modal_manager, null)); 14014 } 14015 /* harmony default export */ var manage_blocks_modal = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])(select => { 14016 const { 14017 isModalActive 14018 } = select(store["a" /* store */]); 14019 return { 14020 isActive: isModalActive(manage_blocks_modal_MODAL_NAME) 14021 }; 14022 }), Object(external_wp_data_["withDispatch"])(dispatch => { 14023 const { 14024 closeModal 14025 } = dispatch(store["a" /* store */]); 14026 return { 14027 closeModal 14028 }; 14029 })])(ManageBlocksModal)); 14030 14031 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/section.js 14032 14033 14034 const Section = ({ 14035 description, 14036 title, 14037 children 14038 }) => Object(external_wp_element_["createElement"])("section", { 14039 className: "edit-post-preferences-modal__section" 14040 }, Object(external_wp_element_["createElement"])("h2", { 14041 className: "edit-post-preferences-modal__section-title" 14042 }, title), description && Object(external_wp_element_["createElement"])("p", { 14043 className: "edit-post-preferences-modal__section-description" 14044 }, description), children); 14045 14046 /* harmony default export */ var preferences_modal_section = (Section); 14047 14048 // EXTERNAL MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/index.js + 6 modules 14049 var preferences_modal_options = __webpack_require__("Y5n4"); 14050 14051 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/meta-boxes-section.js 14052 14053 14054 /** 14055 * External dependencies 14056 */ 14057 14058 /** 14059 * WordPress dependencies 14060 */ 14061 14062 14063 14064 /** 14065 * Internal dependencies 14066 */ 14067 14068 14069 14070 14071 function MetaBoxesSection({ 14072 areCustomFieldsRegistered, 14073 metaBoxes, 14074 ...sectionProps 14075 }) { 14076 // The 'Custom Fields' meta box is a special case that we handle separately. 14077 const thirdPartyMetaBoxes = Object(external_lodash_["filter"])(metaBoxes, ({ 14078 id 14079 }) => id !== 'postcustom'); 14080 14081 if (!areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0) { 14082 return null; 14083 } 14084 14085 return Object(external_wp_element_["createElement"])(preferences_modal_section, sectionProps, areCustomFieldsRegistered && Object(external_wp_element_["createElement"])(preferences_modal_options["a" /* EnableCustomFieldsOption */], { 14086 label: Object(external_wp_i18n_["__"])('Custom fields') 14087 }), Object(external_lodash_["map"])(thirdPartyMetaBoxes, ({ 14088 id, 14089 title 14090 }) => Object(external_wp_element_["createElement"])(preferences_modal_options["c" /* EnablePanelOption */], { 14091 key: id, 14092 label: title, 14093 panelName: `meta-box-${id}` 14094 }))); 14095 } 14096 /* harmony default export */ var meta_boxes_section = (Object(external_wp_data_["withSelect"])(select => { 14097 const { 14098 getEditorSettings 14099 } = select('core/editor'); 14100 const { 14101 getAllMetaBoxes 14102 } = select(store["a" /* store */]); 14103 return { 14104 // This setting should not live in the block editor's store. 14105 areCustomFieldsRegistered: getEditorSettings().enableCustomFields !== undefined, 14106 metaBoxes: getAllMetaBoxes() 14107 }; 14108 })(MetaBoxesSection)); 14109 14110 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/index.js 14111 14112 14113 /** 14114 * External dependencies 14115 */ 14116 14117 /** 14118 * WordPress dependencies 14119 */ 14120 14121 14122 14123 14124 14125 14126 14127 14128 /** 14129 * Internal dependencies 14130 */ 14131 14132 14133 14134 14135 14136 const preferences_modal_MODAL_NAME = 'edit-post/preferences'; 14137 const PREFERENCES_MENU = 'preferences-menu'; 14138 function PreferencesModal() { 14139 const isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('medium'); 14140 const { 14141 closeModal 14142 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 14143 const { 14144 isModalActive, 14145 isViewable 14146 } = Object(external_wp_data_["useSelect"])(select => { 14147 const { 14148 getEditedPostAttribute 14149 } = select(external_wp_editor_["store"]); 14150 const { 14151 getPostType 14152 } = select(external_wp_coreData_["store"]); 14153 const postType = getPostType(getEditedPostAttribute('type')); 14154 return { 14155 isModalActive: select(store["a" /* store */]).isModalActive(preferences_modal_MODAL_NAME), 14156 isViewable: Object(external_lodash_["get"])(postType, ['viewable'], false) 14157 }; 14158 }, []); 14159 const showBlockBreadcrumbsOption = Object(external_wp_data_["useSelect"])(select => { 14160 const { 14161 getEditorSettings 14162 } = select(external_wp_editor_["store"]); 14163 const { 14164 getEditorMode, 14165 isFeatureActive 14166 } = select(store["a" /* store */]); 14167 const mode = getEditorMode(); 14168 const isRichEditingEnabled = getEditorSettings().richEditingEnabled; 14169 const hasReducedUI = isFeatureActive('reducedUI'); 14170 return !hasReducedUI && isLargeViewport && isRichEditingEnabled && mode === 'visual'; 14171 }, [isLargeViewport]); 14172 const sections = Object(external_wp_element_["useMemo"])(() => [{ 14173 name: 'general', 14174 tabLabel: Object(external_wp_i18n_["__"])('General'), 14175 content: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, isLargeViewport && Object(external_wp_element_["createElement"])(preferences_modal_section, { 14176 title: Object(external_wp_i18n_["__"])('Choose your own experience') 14177 }, Object(external_wp_element_["createElement"])(preferences_modal_options["e" /* EnablePublishSidebarOption */], { 14178 help: Object(external_wp_i18n_["__"])('Review settings such as categories and tags.'), 14179 label: Object(external_wp_i18n_["__"])('Include pre-publish checklist') 14180 })), Object(external_wp_element_["createElement"])(preferences_modal_section, { 14181 title: Object(external_wp_i18n_["__"])('Decide what to focus on') 14182 }, Object(external_wp_element_["createElement"])(preferences_modal_options["b" /* EnableFeature */], { 14183 featureName: "reducedUI", 14184 help: Object(external_wp_i18n_["__"])('Compacts options and outlines in the toolbar.'), 14185 label: Object(external_wp_i18n_["__"])('Reduce the interface') 14186 }), Object(external_wp_element_["createElement"])(preferences_modal_options["b" /* EnableFeature */], { 14187 featureName: "focusMode", 14188 help: Object(external_wp_i18n_["__"])('Highlights the current block and fades other content.'), 14189 label: Object(external_wp_i18n_["__"])('Spotlight mode') 14190 }), showBlockBreadcrumbsOption && Object(external_wp_element_["createElement"])(preferences_modal_options["b" /* EnableFeature */], { 14191 featureName: "showBlockBreadcrumbs", 14192 help: Object(external_wp_i18n_["__"])('Shows block breadcrumbs at the bottom of the editor.'), 14193 label: Object(external_wp_i18n_["__"])('Display block breadcrumbs') 14194 }))) 14195 }, { 14196 name: 'appearance', 14197 tabLabel: Object(external_wp_i18n_["__"])('Appearance'), 14198 content: Object(external_wp_element_["createElement"])(preferences_modal_section, { 14199 title: Object(external_wp_i18n_["__"])('Choose the way it looks') 14200 }, Object(external_wp_element_["createElement"])(preferences_modal_options["b" /* EnableFeature */], { 14201 featureName: "showIconLabels", 14202 help: Object(external_wp_i18n_["__"])('Shows text instead of icons in toolbar.'), 14203 label: Object(external_wp_i18n_["__"])('Display button labels') 14204 }), Object(external_wp_element_["createElement"])(preferences_modal_options["b" /* EnableFeature */], { 14205 featureName: "themeStyles", 14206 help: Object(external_wp_i18n_["__"])('Make the editor look like your theme.'), 14207 label: Object(external_wp_i18n_["__"])('Use theme styles') 14208 })) 14209 }, { 14210 name: 'blocks', 14211 tabLabel: Object(external_wp_i18n_["__"])('Blocks'), 14212 content: Object(external_wp_element_["createElement"])(preferences_modal_section, { 14213 title: Object(external_wp_i18n_["__"])('Choose how you interact with blocks') 14214 }, Object(external_wp_element_["createElement"])(preferences_modal_options["b" /* EnableFeature */], { 14215 featureName: "mostUsedBlocks", 14216 help: Object(external_wp_i18n_["__"])('Places the most frequent blocks in the block library.'), 14217 label: Object(external_wp_i18n_["__"])('Show most used blocks') 14218 }), Object(external_wp_element_["createElement"])(preferences_modal_options["b" /* EnableFeature */], { 14219 featureName: "keepCaretInsideBlock", 14220 help: Object(external_wp_i18n_["__"])('Aids screen readers by stopping text caret from leaving blocks.'), 14221 label: Object(external_wp_i18n_["__"])('Contain text cursor inside block') 14222 })) 14223 }, { 14224 name: 'panels', 14225 tabLabel: Object(external_wp_i18n_["__"])('Panels'), 14226 content: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(preferences_modal_section, { 14227 title: Object(external_wp_i18n_["__"])('Document settings'), 14228 description: Object(external_wp_i18n_["__"])('Choose what displays in the panel.') 14229 }, Object(external_wp_element_["createElement"])(preferences_modal_options["d" /* EnablePluginDocumentSettingPanelOption */].Slot, null), isViewable && Object(external_wp_element_["createElement"])(preferences_modal_options["c" /* EnablePanelOption */], { 14230 label: Object(external_wp_i18n_["__"])('Permalink'), 14231 panelName: "post-link" 14232 }), isViewable && Object(external_wp_element_["createElement"])(preferences_modal_options["c" /* EnablePanelOption */], { 14233 label: Object(external_wp_i18n_["__"])('Template'), 14234 panelName: "template" 14235 }), Object(external_wp_element_["createElement"])(external_wp_editor_["PostTaxonomies"], { 14236 taxonomyWrapper: (content, taxonomy) => Object(external_wp_element_["createElement"])(preferences_modal_options["c" /* EnablePanelOption */], { 14237 label: Object(external_lodash_["get"])(taxonomy, ['labels', 'menu_name']), 14238 panelName: `taxonomy-panel-${taxonomy.slug}` 14239 }) 14240 }), Object(external_wp_element_["createElement"])(external_wp_editor_["PostFeaturedImageCheck"], null, Object(external_wp_element_["createElement"])(preferences_modal_options["c" /* EnablePanelOption */], { 14241 label: Object(external_wp_i18n_["__"])('Featured image'), 14242 panelName: "featured-image" 14243 })), Object(external_wp_element_["createElement"])(external_wp_editor_["PostExcerptCheck"], null, Object(external_wp_element_["createElement"])(preferences_modal_options["c" /* EnablePanelOption */], { 14244 label: Object(external_wp_i18n_["__"])('Excerpt'), 14245 panelName: "post-excerpt" 14246 })), Object(external_wp_element_["createElement"])(external_wp_editor_["PostTypeSupportCheck"], { 14247 supportKeys: ['comments', 'trackbacks'] 14248 }, Object(external_wp_element_["createElement"])(preferences_modal_options["c" /* EnablePanelOption */], { 14249 label: Object(external_wp_i18n_["__"])('Discussion'), 14250 panelName: "discussion-panel" 14251 })), Object(external_wp_element_["createElement"])(external_wp_editor_["PageAttributesCheck"], null, Object(external_wp_element_["createElement"])(preferences_modal_options["c" /* EnablePanelOption */], { 14252 label: Object(external_wp_i18n_["__"])('Page attributes'), 14253 panelName: "page-attributes" 14254 }))), Object(external_wp_element_["createElement"])(preferences_modal_section, { 14255 title: Object(external_wp_i18n_["__"])('Additional'), 14256 description: Object(external_wp_i18n_["__"])('Add extra areas to the editor.') 14257 }, Object(external_wp_element_["createElement"])(meta_boxes_section, null))) 14258 }], [isViewable, isLargeViewport, showBlockBreadcrumbsOption]); // This is also used to sync the two different rendered components 14259 // between small and large viewports. 14260 14261 const [activeMenu, setActiveMenu] = Object(external_wp_element_["useState"])(PREFERENCES_MENU); 14262 /** 14263 * Create helper objects from `sections` for easier data handling. 14264 * `tabs` is used for creating the `TabPanel` and `sectionsContentMap` 14265 * is used for easier access to active tab's content. 14266 */ 14267 14268 const { 14269 tabs, 14270 sectionsContentMap 14271 } = Object(external_wp_element_["useMemo"])(() => sections.reduce((accumulator, { 14272 name, 14273 tabLabel: title, 14274 content 14275 }) => { 14276 accumulator.tabs.push({ 14277 name, 14278 title 14279 }); 14280 accumulator.sectionsContentMap[name] = content; 14281 return accumulator; 14282 }, { 14283 tabs: [], 14284 sectionsContentMap: {} 14285 }), [sections]); 14286 const getCurrentTab = Object(external_wp_element_["useCallback"])(tab => sectionsContentMap[tab.name] || null, [sectionsContentMap]); 14287 14288 if (!isModalActive) { 14289 return null; 14290 } 14291 14292 let modalContent; // We render different components based on the viewport size. 14293 14294 if (isLargeViewport) { 14295 modalContent = Object(external_wp_element_["createElement"])(external_wp_components_["TabPanel"], { 14296 className: "edit-post-preferences__tabs", 14297 tabs: tabs, 14298 initialTabName: activeMenu !== PREFERENCES_MENU ? activeMenu : undefined, 14299 onSelect: setActiveMenu, 14300 orientation: "vertical" 14301 }, getCurrentTab); 14302 } else { 14303 modalContent = Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalNavigation"], { 14304 activeMenu: activeMenu, 14305 onActivateMenu: setActiveMenu 14306 }, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalNavigationMenu"], { 14307 menu: PREFERENCES_MENU 14308 }, tabs.map(tab => { 14309 return Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalNavigationItem"], { 14310 key: tab.name, 14311 title: tab.title, 14312 navigateToMenu: tab.name 14313 }); 14314 })), sections.map(section => { 14315 return Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalNavigationMenu"], { 14316 key: `${section.name}-menu`, 14317 menu: section.name, 14318 title: section.tabLabel, 14319 parentMenu: PREFERENCES_MENU 14320 }, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalNavigationItem"], null, section.content)); 14321 })); 14322 } 14323 14324 return Object(external_wp_element_["createElement"])(external_wp_components_["Modal"], { 14325 className: "edit-post-preferences-modal", 14326 title: Object(external_wp_i18n_["__"])('Preferences'), 14327 closeLabel: Object(external_wp_i18n_["__"])('Close'), 14328 onRequestClose: closeModal 14329 }, modalContent); 14330 } 14331 14332 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/browser-url/index.js 14333 /** 14334 * WordPress dependencies 14335 */ 14336 14337 14338 14339 /** 14340 * Returns the Post's Edit URL. 14341 * 14342 * @param {number} postId Post ID. 14343 * 14344 * @return {string} Post edit URL. 14345 */ 14346 14347 function getPostEditURL(postId) { 14348 return Object(external_wp_url_["addQueryArgs"])('post.php', { 14349 post: postId, 14350 action: 'edit' 14351 }); 14352 } 14353 /** 14354 * Returns the Post's Trashed URL. 14355 * 14356 * @param {number} postId Post ID. 14357 * @param {string} postType Post Type. 14358 * 14359 * @return {string} Post trashed URL. 14360 */ 14361 14362 function getPostTrashedURL(postId, postType) { 14363 return Object(external_wp_url_["addQueryArgs"])('edit.php', { 14364 trashed: 1, 14365 post_type: postType, 14366 ids: postId 14367 }); 14368 } 14369 class browser_url_BrowserURL extends external_wp_element_["Component"] { 14370 constructor() { 14371 super(...arguments); 14372 this.state = { 14373 historyId: null 14374 }; 14375 } 14376 14377 componentDidUpdate(prevProps) { 14378 const { 14379 postId, 14380 postStatus, 14381 postType, 14382 isSavingPost 14383 } = this.props; 14384 const { 14385 historyId 14386 } = this.state; // Posts are still dirty while saving so wait for saving to finish 14387 // to avoid the unsaved changes warning when trashing posts. 14388 14389 if (postStatus === 'trash' && !isSavingPost) { 14390 this.setTrashURL(postId, postType); 14391 return; 14392 } 14393 14394 if ((postId !== prevProps.postId || postId !== historyId) && postStatus !== 'auto-draft' && postId) { 14395 this.setBrowserURL(postId); 14396 } 14397 } 14398 /** 14399 * Navigates the browser to the post trashed URL to show a notice about the trashed post. 14400 * 14401 * @param {number} postId Post ID. 14402 * @param {string} postType Post Type. 14403 */ 14404 14405 14406 setTrashURL(postId, postType) { 14407 window.location.href = getPostTrashedURL(postId, postType); 14408 } 14409 /** 14410 * Replaces the browser URL with a post editor link for the given post ID. 14411 * 14412 * Note it is important that, since this function may be called when the 14413 * editor first loads, the result generated `getPostEditURL` matches that 14414 * produced by the server. Otherwise, the URL will change unexpectedly. 14415 * 14416 * @param {number} postId Post ID for which to generate post editor URL. 14417 */ 14418 14419 14420 setBrowserURL(postId) { 14421 window.history.replaceState({ 14422 id: postId 14423 }, 'Post ' + postId, getPostEditURL(postId)); 14424 this.setState(() => ({ 14425 historyId: postId 14426 })); 14427 } 14428 14429 render() { 14430 return null; 14431 } 14432 14433 } 14434 /* harmony default export */ var browser_url = (Object(external_wp_data_["withSelect"])(select => { 14435 const { 14436 getCurrentPost, 14437 isSavingPost 14438 } = select('core/editor'); 14439 const post = getCurrentPost(); 14440 let { 14441 id, 14442 status, 14443 type 14444 } = post; 14445 const isTemplate = ['wp_template', 'wp_template_part'].includes(type); 14446 14447 if (isTemplate) { 14448 id = post.wp_id; 14449 } 14450 14451 return { 14452 postId: id, 14453 postStatus: status, 14454 postType: type, 14455 isSavingPost: isSavingPost() 14456 }; 14457 })(browser_url_BrowserURL)); 14458 14459 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/wordpress.js 14460 var wordpress = __webpack_require__("wduq"); 14461 14462 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/fullscreen-mode-close/index.js 14463 14464 14465 /** 14466 * External dependencies 14467 */ 14468 14469 /** 14470 * WordPress dependencies 14471 */ 14472 14473 14474 14475 14476 14477 14478 /** 14479 * Internal dependencies 14480 */ 14481 14482 14483 14484 function FullscreenModeClose({ 14485 showTooltip, 14486 icon, 14487 href 14488 }) { 14489 const { 14490 isActive, 14491 isRequestingSiteIcon, 14492 postType, 14493 siteIconUrl 14494 } = Object(external_wp_data_["useSelect"])(select => { 14495 const { 14496 getCurrentPostType 14497 } = select('core/editor'); 14498 const { 14499 isFeatureActive 14500 } = select(store["a" /* store */]); 14501 const { 14502 isResolving 14503 } = select('core/data'); 14504 const { 14505 getEntityRecord, 14506 getPostType 14507 } = select('core'); 14508 const siteData = getEntityRecord('root', '__unstableBase', undefined) || {}; 14509 return { 14510 isActive: isFeatureActive('fullscreenMode'), 14511 isRequestingSiteIcon: isResolving('core', 'getEntityRecord', ['root', '__unstableBase', undefined]), 14512 postType: getPostType(getCurrentPostType()), 14513 siteIconUrl: siteData.site_icon_url 14514 }; 14515 }, []); 14516 14517 if (!isActive || !postType) { 14518 return null; 14519 } 14520 14521 let buttonIcon = Object(external_wp_element_["createElement"])(external_wp_components_["Icon"], { 14522 size: "36px", 14523 icon: wordpress["a" /* default */] 14524 }); 14525 14526 if (siteIconUrl) { 14527 buttonIcon = Object(external_wp_element_["createElement"])("img", { 14528 alt: Object(external_wp_i18n_["__"])('Site Icon'), 14529 className: "edit-post-fullscreen-mode-close_site-icon", 14530 src: siteIconUrl 14531 }); 14532 } 14533 14534 if (isRequestingSiteIcon) { 14535 buttonIcon = null; 14536 } // Override default icon if custom icon is provided via props. 14537 14538 14539 if (icon) { 14540 buttonIcon = Object(external_wp_element_["createElement"])(external_wp_components_["Icon"], { 14541 size: "36px", 14542 icon: icon 14543 }); 14544 } 14545 14546 return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 14547 className: "edit-post-fullscreen-mode-close has-icon", 14548 href: href !== null && href !== void 0 ? href : Object(external_wp_url_["addQueryArgs"])('edit.php', { 14549 post_type: postType.slug 14550 }), 14551 label: Object(external_lodash_["get"])(postType, ['labels', 'view_items'], Object(external_wp_i18n_["__"])('Back')), 14552 showTooltip: showTooltip 14553 }, buttonIcon); 14554 } 14555 14556 /* harmony default export */ var fullscreen_mode_close = (FullscreenModeClose); 14557 14558 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/list-view.js 14559 var list_view = __webpack_require__("OzlF"); 14560 14561 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js 14562 var plus = __webpack_require__("Q4Sy"); 14563 14564 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/header-toolbar/index.js 14565 14566 14567 /** 14568 * WordPress dependencies 14569 */ 14570 14571 14572 14573 14574 14575 14576 14577 14578 14579 /** 14580 * Internal dependencies 14581 */ 14582 14583 14584 14585 function HeaderToolbar() { 14586 const inserterButton = Object(external_wp_element_["useRef"])(); 14587 const { 14588 setIsInserterOpened, 14589 setIsListViewOpened 14590 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 14591 const { 14592 isInserterEnabled, 14593 isInserterOpened, 14594 isTextModeEnabled, 14595 showIconLabels, 14596 isListViewOpen, 14597 listViewShortcut 14598 } = Object(external_wp_data_["useSelect"])(select => { 14599 const { 14600 hasInserterItems, 14601 getBlockRootClientId, 14602 getBlockSelectionEnd 14603 } = select(external_wp_blockEditor_["store"]); 14604 const { 14605 getEditorSettings 14606 } = select(external_wp_editor_["store"]); 14607 const { 14608 getEditorMode, 14609 isFeatureActive, 14610 isListViewOpened 14611 } = select(store["a" /* store */]); 14612 const { 14613 getShortcutRepresentation 14614 } = select(external_wp_keyboardShortcuts_["store"]); 14615 return { 14616 // This setting (richEditingEnabled) should not live in the block editor's setting. 14617 isInserterEnabled: getEditorMode() === 'visual' && getEditorSettings().richEditingEnabled && hasInserterItems(getBlockRootClientId(getBlockSelectionEnd())), 14618 isInserterOpened: select(store["a" /* store */]).isInserterOpened(), 14619 isTextModeEnabled: getEditorMode() === 'text', 14620 showIconLabels: isFeatureActive('showIconLabels'), 14621 isListViewOpen: isListViewOpened(), 14622 listViewShortcut: getShortcutRepresentation('core/edit-post/toggle-block-navigation') 14623 }; 14624 }, []); 14625 const isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('medium'); 14626 const isWideViewport = Object(external_wp_compose_["useViewportMatch"])('wide'); 14627 /* translators: accessibility text for the editor toolbar */ 14628 14629 const toolbarAriaLabel = Object(external_wp_i18n_["__"])('Document tools'); 14630 14631 const overflowItems = Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarItem"], { 14632 as: external_wp_editor_["TableOfContents"], 14633 hasOutlineItemsDisabled: isTextModeEnabled, 14634 repositionDropdown: showIconLabels && !isWideViewport, 14635 showTooltip: !showIconLabels, 14636 isTertiary: showIconLabels 14637 }), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarItem"], { 14638 as: external_wp_components_["Button"], 14639 className: "edit-post-header-toolbar__list-view-toggle", 14640 icon: list_view["a" /* default */], 14641 disabled: isTextModeEnabled, 14642 isPressed: isListViewOpen 14643 /* translators: button label text should, if possible, be under 16 characters. */ 14644 , 14645 label: Object(external_wp_i18n_["__"])('List View'), 14646 onClick: () => setIsListViewOpened(!isListViewOpen), 14647 shortcut: listViewShortcut, 14648 showTooltip: !showIconLabels 14649 })); 14650 return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["NavigableToolbar"], { 14651 className: "edit-post-header-toolbar", 14652 "aria-label": toolbarAriaLabel 14653 }, Object(external_wp_element_["createElement"])("div", { 14654 className: "edit-post-header-toolbar__left" 14655 }, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarItem"], { 14656 ref: inserterButton, 14657 as: external_wp_components_["Button"], 14658 className: "edit-post-header-toolbar__inserter-toggle", 14659 isPrimary: true, 14660 isPressed: isInserterOpened, 14661 onMouseDown: event => { 14662 event.preventDefault(); 14663 }, 14664 onClick: () => { 14665 if (isInserterOpened) { 14666 // Focusing the inserter button closes the inserter popover 14667 inserterButton.current.focus(); 14668 } else { 14669 setIsInserterOpened(true); 14670 } 14671 }, 14672 disabled: !isInserterEnabled, 14673 icon: plus["a" /* default */] 14674 /* translators: button label text should, if possible, be under 16 14675 characters. */ 14676 , 14677 label: Object(external_wp_i18n_["_x"])('Toggle block inserter', 'Generic label for block inserter button'), 14678 showTooltip: !showIconLabels 14679 }, showIconLabels && Object(external_wp_i18n_["__"])('Add')), (isWideViewport || !showIconLabels) && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, isLargeViewport && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarItem"], { 14680 as: external_wp_blockEditor_["ToolSelector"], 14681 showTooltip: !showIconLabels, 14682 isTertiary: showIconLabels, 14683 disabled: isTextModeEnabled 14684 }), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarItem"], { 14685 as: external_wp_editor_["EditorHistoryUndo"], 14686 showTooltip: !showIconLabels, 14687 isTertiary: showIconLabels 14688 }), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarItem"], { 14689 as: external_wp_editor_["EditorHistoryRedo"], 14690 showTooltip: !showIconLabels, 14691 isTertiary: showIconLabels 14692 }), overflowItems))); 14693 } 14694 14695 /* harmony default export */ var header_toolbar = (HeaderToolbar); 14696 14697 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js 14698 var more_vertical = __webpack_require__("VKE3"); 14699 14700 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/mode-switcher/index.js 14701 14702 14703 /** 14704 * WordPress dependencies 14705 */ 14706 14707 14708 14709 14710 /** 14711 * Internal dependencies 14712 */ 14713 14714 14715 /** 14716 * Set of available mode options. 14717 * 14718 * @type {Array} 14719 */ 14720 14721 const MODES = [{ 14722 value: 'visual', 14723 label: Object(external_wp_i18n_["__"])('Visual editor') 14724 }, { 14725 value: 'text', 14726 label: Object(external_wp_i18n_["__"])('Code editor') 14727 }]; 14728 14729 function ModeSwitcher() { 14730 const { 14731 shortcut, 14732 isRichEditingEnabled, 14733 isCodeEditingEnabled, 14734 mode 14735 } = Object(external_wp_data_["useSelect"])(select => ({ 14736 shortcut: select(external_wp_keyboardShortcuts_["store"]).getShortcutRepresentation('core/edit-post/toggle-mode'), 14737 isRichEditingEnabled: select('core/editor').getEditorSettings().richEditingEnabled, 14738 isCodeEditingEnabled: select('core/editor').getEditorSettings().codeEditingEnabled, 14739 mode: select(store["a" /* store */]).getEditorMode() 14740 }), []); 14741 const { 14742 switchEditorMode 14743 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 14744 14745 if (!isRichEditingEnabled || !isCodeEditingEnabled) { 14746 return null; 14747 } 14748 14749 const choices = MODES.map(choice => { 14750 if (choice.value !== mode) { 14751 return { ...choice, 14752 shortcut 14753 }; 14754 } 14755 14756 return choice; 14757 }); 14758 return Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], { 14759 label: Object(external_wp_i18n_["__"])('Editor') 14760 }, Object(external_wp_element_["createElement"])(external_wp_components_["MenuItemsChoice"], { 14761 choices: choices, 14762 value: mode, 14763 onSelect: switchEditorMode 14764 })); 14765 } 14766 14767 /* harmony default export */ var mode_switcher = (ModeSwitcher); 14768 14769 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/preferences-menu-item/index.js 14770 14771 14772 /** 14773 * WordPress dependencies 14774 */ 14775 14776 14777 14778 /** 14779 * Internal dependencies 14780 */ 14781 14782 14783 function PreferencesMenuItem() { 14784 const { 14785 openModal 14786 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 14787 return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { 14788 onClick: () => { 14789 openModal('edit-post/preferences'); 14790 } 14791 }, Object(external_wp_i18n_["__"])('Preferences')); 14792 } 14793 14794 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js 14795 var check = __webpack_require__("RMJe"); 14796 14797 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/feature-toggle/index.js 14798 14799 14800 /** 14801 * External dependencies 14802 */ 14803 14804 /** 14805 * WordPress dependencies 14806 */ 14807 14808 14809 14810 14811 14812 14813 14814 /** 14815 * Internal dependencies 14816 */ 14817 14818 14819 14820 function FeatureToggle({ 14821 onToggle, 14822 isActive, 14823 label, 14824 info, 14825 messageActivated, 14826 messageDeactivated, 14827 shortcut 14828 }) { 14829 const speakMessage = () => { 14830 if (isActive) { 14831 Object(external_wp_a11y_["speak"])(messageDeactivated || Object(external_wp_i18n_["__"])('Feature deactivated')); 14832 } else { 14833 Object(external_wp_a11y_["speak"])(messageActivated || Object(external_wp_i18n_["__"])('Feature activated')); 14834 } 14835 }; 14836 14837 return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { 14838 icon: isActive && check["a" /* default */], 14839 isSelected: isActive, 14840 onClick: Object(external_lodash_["flow"])(onToggle, speakMessage), 14841 role: "menuitemcheckbox", 14842 info: info, 14843 shortcut: shortcut 14844 }, label); 14845 } 14846 14847 /* harmony default export */ var feature_toggle = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])((select, { 14848 feature 14849 }) => ({ 14850 isActive: select(store["a" /* store */]).isFeatureActive(feature) 14851 })), Object(external_wp_data_["withDispatch"])((dispatch, ownProps) => ({ 14852 onToggle() { 14853 dispatch(store["a" /* store */]).toggleFeature(ownProps.feature); 14854 } 14855 14856 }))])(FeatureToggle)); 14857 14858 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/writing-menu/index.js 14859 14860 14861 /** 14862 * WordPress dependencies 14863 */ 14864 14865 14866 14867 14868 /** 14869 * Internal dependencies 14870 */ 14871 14872 14873 14874 function WritingMenu() { 14875 const isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('medium'); 14876 14877 if (!isLargeViewport) { 14878 return null; 14879 } 14880 14881 return Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], { 14882 label: Object(external_wp_i18n_["_x"])('View', 'noun') 14883 }, Object(external_wp_element_["createElement"])(feature_toggle, { 14884 feature: "fixedToolbar", 14885 label: Object(external_wp_i18n_["__"])('Top toolbar'), 14886 info: Object(external_wp_i18n_["__"])('Access all block and document tools in a single place'), 14887 messageActivated: Object(external_wp_i18n_["__"])('Top toolbar activated'), 14888 messageDeactivated: Object(external_wp_i18n_["__"])('Top toolbar deactivated') 14889 }), Object(external_wp_element_["createElement"])(feature_toggle, { 14890 feature: "focusMode", 14891 label: Object(external_wp_i18n_["__"])('Spotlight mode'), 14892 info: Object(external_wp_i18n_["__"])('Focus on one block at a time'), 14893 messageActivated: Object(external_wp_i18n_["__"])('Spotlight mode activated'), 14894 messageDeactivated: Object(external_wp_i18n_["__"])('Spotlight mode deactivated') 14895 }), Object(external_wp_element_["createElement"])(feature_toggle, { 14896 feature: "fullscreenMode", 14897 label: Object(external_wp_i18n_["__"])('Fullscreen mode'), 14898 info: Object(external_wp_i18n_["__"])('Work without distraction'), 14899 messageActivated: Object(external_wp_i18n_["__"])('Fullscreen mode activated'), 14900 messageDeactivated: Object(external_wp_i18n_["__"])('Fullscreen mode deactivated'), 14901 shortcut: external_wp_keycodes_["displayShortcut"].secondary('f') 14902 })); 14903 } 14904 14905 /* harmony default export */ var writing_menu = (WritingMenu); 14906 14907 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/more-menu/index.js 14908 14909 14910 /** 14911 * WordPress dependencies 14912 */ 14913 14914 14915 14916 14917 14918 /** 14919 * Internal dependencies 14920 */ 14921 14922 14923 14924 14925 14926 const POPOVER_PROPS = { 14927 className: 'edit-post-more-menu__content', 14928 position: 'bottom left' 14929 }; 14930 const TOGGLE_PROPS = { 14931 tooltipPosition: 'bottom' 14932 }; 14933 14934 const MoreMenu = ({ 14935 showIconLabels 14936 }) => { 14937 const isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('large'); 14938 return Object(external_wp_element_["createElement"])(external_wp_components_["DropdownMenu"], { 14939 className: "edit-post-more-menu", 14940 icon: more_vertical["a" /* default */] 14941 /* translators: button label text should, if possible, be under 16 characters. */ 14942 , 14943 label: Object(external_wp_i18n_["__"])('Options'), 14944 popoverProps: POPOVER_PROPS, 14945 toggleProps: { 14946 showTooltip: !showIconLabels, 14947 isTertiary: showIconLabels, 14948 ...TOGGLE_PROPS 14949 } 14950 }, ({ 14951 onClose 14952 }) => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, showIconLabels && !isLargeViewport && Object(external_wp_element_["createElement"])(build_module["f" /* PinnedItems */].Slot, { 14953 className: showIconLabels && 'show-icon-labels', 14954 scope: "core/edit-post" 14955 }), Object(external_wp_element_["createElement"])(writing_menu, null), Object(external_wp_element_["createElement"])(mode_switcher, null), Object(external_wp_element_["createElement"])(build_module["a" /* ActionItem */].Slot, { 14956 name: "core/edit-post/plugin-more-menu", 14957 label: Object(external_wp_i18n_["__"])('Plugins'), 14958 as: external_wp_components_["MenuGroup"], 14959 fillProps: { 14960 onClick: onClose 14961 } 14962 }), Object(external_wp_element_["createElement"])(tools_more_menu_group.Slot, { 14963 fillProps: { 14964 onClose 14965 } 14966 }), Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], null, Object(external_wp_element_["createElement"])(PreferencesMenuItem, null)))); 14967 }; 14968 14969 /* harmony default export */ var more_menu = (MoreMenu); 14970 14971 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/post-publish-button-or-toggle.js 14972 14973 14974 /** 14975 * External dependencies 14976 */ 14977 14978 /** 14979 * WordPress dependencies 14980 */ 14981 14982 14983 14984 14985 /** 14986 * Internal dependencies 14987 */ 14988 14989 14990 function PostPublishButtonOrToggle({ 14991 forceIsDirty, 14992 forceIsSaving, 14993 hasPublishAction, 14994 isBeingScheduled, 14995 isPending, 14996 isPublished, 14997 isPublishSidebarEnabled, 14998 isPublishSidebarOpened, 14999 isScheduled, 15000 togglePublishSidebar, 15001 setEntitiesSavedStatesCallback 15002 }) { 15003 const IS_TOGGLE = 'toggle'; 15004 const IS_BUTTON = 'button'; 15005 const isSmallerThanMediumViewport = Object(external_wp_compose_["useViewportMatch"])('medium', '<'); 15006 let component; 15007 /** 15008 * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar): 15009 * 15010 * 1) We want to show a BUTTON when the post status is at the _final stage_ 15011 * for a particular role (see https://wordpress.org/support/article/post-status/): 15012 * 15013 * - is published 15014 * - is scheduled to be published 15015 * - is pending and can't be published (but only for viewports >= medium). 15016 * Originally, we considered showing a button for pending posts that couldn't be published 15017 * (for example, for an author with the contributor role). Some languages can have 15018 * long translations for "Submit for review", so given the lack of UI real estate available 15019 * we decided to take into account the viewport in that case. 15020 * See: https://github.com/WordPress/gutenberg/issues/10475 15021 * 15022 * 2) Then, in small viewports, we'll show a TOGGLE. 15023 * 15024 * 3) Finally, we'll use the publish sidebar status to decide: 15025 * 15026 * - if it is enabled, we show a TOGGLE 15027 * - if it is disabled, we show a BUTTON 15028 */ 15029 15030 if (isPublished || isScheduled && isBeingScheduled || isPending && !hasPublishAction && !isSmallerThanMediumViewport) { 15031 component = IS_BUTTON; 15032 } else if (isSmallerThanMediumViewport) { 15033 component = IS_TOGGLE; 15034 } else if (isPublishSidebarEnabled) { 15035 component = IS_TOGGLE; 15036 } else { 15037 component = IS_BUTTON; 15038 } 15039 15040 return Object(external_wp_element_["createElement"])(external_wp_editor_["PostPublishButton"], { 15041 forceIsDirty: forceIsDirty, 15042 forceIsSaving: forceIsSaving, 15043 isOpen: isPublishSidebarOpened, 15044 isToggle: component === IS_TOGGLE, 15045 onToggle: togglePublishSidebar, 15046 setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback 15047 }); 15048 } 15049 /* harmony default export */ var post_publish_button_or_toggle = (Object(external_wp_compose_["compose"])(Object(external_wp_data_["withSelect"])(select => ({ 15050 hasPublishAction: Object(external_lodash_["get"])(select('core/editor').getCurrentPost(), ['_links', 'wp:action-publish'], false), 15051 isBeingScheduled: select('core/editor').isEditedPostBeingScheduled(), 15052 isPending: select('core/editor').isCurrentPostPending(), 15053 isPublished: select('core/editor').isCurrentPostPublished(), 15054 isPublishSidebarEnabled: select('core/editor').isPublishSidebarEnabled(), 15055 isPublishSidebarOpened: select(store["a" /* store */]).isPublishSidebarOpened(), 15056 isScheduled: select('core/editor').isCurrentPostScheduled() 15057 })), Object(external_wp_data_["withDispatch"])(dispatch => { 15058 const { 15059 togglePublishSidebar 15060 } = dispatch(store["a" /* store */]); 15061 return { 15062 togglePublishSidebar 15063 }; 15064 }))(PostPublishButtonOrToggle)); 15065 15066 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/device-preview/index.js 15067 15068 15069 /** 15070 * WordPress dependencies 15071 */ 15072 15073 15074 15075 15076 15077 15078 /** 15079 * Internal dependencies 15080 */ 15081 15082 15083 function DevicePreview() { 15084 const { 15085 hasActiveMetaboxes, 15086 isPostSaveable, 15087 isSaving, 15088 deviceType 15089 } = Object(external_wp_data_["useSelect"])(select => ({ 15090 hasActiveMetaboxes: select(store["a" /* store */]).hasMetaBoxes(), 15091 isSaving: select(store["a" /* store */]).isSavingMetaBoxes(), 15092 isPostSaveable: select('core/editor').isEditedPostSaveable(), 15093 deviceType: select(store["a" /* store */]).__experimentalGetPreviewDeviceType() 15094 }), []); 15095 const { 15096 __experimentalSetPreviewDeviceType: setPreviewDeviceType 15097 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 15098 return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalPreviewOptions"], { 15099 isEnabled: isPostSaveable, 15100 className: "edit-post-post-preview-dropdown", 15101 deviceType: deviceType, 15102 setDeviceType: setPreviewDeviceType 15103 }, Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], null, Object(external_wp_element_["createElement"])("div", { 15104 className: "edit-post-header-preview__grouping-external" 15105 }, Object(external_wp_element_["createElement"])(external_wp_editor_["PostPreviewButton"], { 15106 className: 'edit-post-header-preview__button-external', 15107 role: "menuitem", 15108 forceIsAutosaveable: hasActiveMetaboxes, 15109 forcePreviewLink: isSaving ? null : undefined, 15110 textContent: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_i18n_["__"])('Preview in new tab'), Object(external_wp_element_["createElement"])(external_wp_components_["Icon"], { 15111 icon: external["a" /* default */] 15112 })) 15113 })))); 15114 } 15115 15116 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/main-dashboard-button/index.js 15117 15118 15119 /** 15120 * WordPress dependencies 15121 */ 15122 15123 const slotName = '__experimentalMainDashboardButton'; 15124 const { 15125 Fill, 15126 Slot: MainDashboardButtonSlot 15127 } = Object(external_wp_components_["createSlotFill"])(slotName); 15128 const MainDashboardButton = Fill; 15129 15130 const main_dashboard_button_Slot = ({ 15131 children 15132 }) => { 15133 const slot = Object(external_wp_components_["__experimentalUseSlot"])(slotName); 15134 const hasFills = Boolean(slot.fills && slot.fills.length); 15135 15136 if (!hasFills) { 15137 return children; 15138 } 15139 15140 return Object(external_wp_element_["createElement"])(MainDashboardButtonSlot, { 15141 bubblesVirtually: true 15142 }); 15143 }; 15144 15145 MainDashboardButton.Slot = main_dashboard_button_Slot; 15146 /* harmony default export */ var main_dashboard_button = (MainDashboardButton); 15147 15148 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-down.js 15149 var chevron_down = __webpack_require__("NWDH"); 15150 15151 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/template-title/delete-template.js 15152 15153 15154 /** 15155 * External dependencies 15156 */ 15157 15158 /** 15159 * WordPress dependencies 15160 */ 15161 15162 15163 15164 15165 15166 15167 15168 /** 15169 * Internal dependencies 15170 */ 15171 15172 15173 function DeleteTemplate() { 15174 const { 15175 clearSelectedBlock 15176 } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]); 15177 const { 15178 setIsEditingTemplate 15179 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 15180 const { 15181 getEditorSettings 15182 } = Object(external_wp_data_["useSelect"])(external_wp_editor_["store"]); 15183 const { 15184 updateEditorSettings, 15185 editPost 15186 } = Object(external_wp_data_["useDispatch"])(external_wp_editor_["store"]); 15187 const { 15188 deleteEntityRecord 15189 } = Object(external_wp_data_["useDispatch"])(external_wp_coreData_["store"]); 15190 const { 15191 template 15192 } = Object(external_wp_data_["useSelect"])(select => { 15193 const { 15194 isEditingTemplate, 15195 getEditedPostTemplate 15196 } = select(store["a" /* store */]); 15197 15198 const _isEditing = isEditingTemplate(); 15199 15200 return { 15201 template: _isEditing ? getEditedPostTemplate() : null 15202 }; 15203 }, []); 15204 15205 if (!template || !template.wp_id) { 15206 return null; 15207 } 15208 15209 let templateTitle = template.slug; 15210 15211 if (template !== null && template !== void 0 && template.title) { 15212 templateTitle = template.title; 15213 } 15214 15215 return Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], { 15216 className: "edit-post-template-top-area__second-menu-group" 15217 }, Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { 15218 className: "edit-post-template-top-area__delete-template-button", 15219 isDestructive: true, 15220 isSecondary: true, 15221 "aria-label": Object(external_wp_i18n_["__"])('Delete template'), 15222 onClick: () => { 15223 if ( // eslint-disable-next-line no-alert 15224 window.confirm(Object(external_wp_i18n_["sprintf"])( 15225 /* translators: %s: template name */ 15226 Object(external_wp_i18n_["__"])('Are you sure you want to delete the %s template? It may be used by other pages or posts.'), templateTitle))) { 15227 clearSelectedBlock(); 15228 setIsEditingTemplate(false); 15229 editPost({ 15230 template: '' 15231 }); 15232 const settings = getEditorSettings(); 15233 const newAvailableTemplates = Object(external_lodash_["pickBy"])(settings.availableTemplates, (_title, id) => { 15234 return id !== template.slug; 15235 }); 15236 updateEditorSettings({ ...settings, 15237 availableTemplates: newAvailableTemplates 15238 }); 15239 deleteEntityRecord('postType', 'wp_template', template.id); 15240 } 15241 } 15242 }, Object(external_wp_i18n_["__"])('Delete template'))); 15243 } 15244 15245 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/template-title/edit-template-title.js 15246 15247 15248 /** 15249 * External dependencies 15250 */ 15251 15252 /** 15253 * WordPress dependencies 15254 */ 15255 15256 15257 15258 15259 15260 15261 /** 15262 * Internal dependencies 15263 */ 15264 15265 15266 function EditTemplateTitle() { 15267 const { 15268 template 15269 } = Object(external_wp_data_["useSelect"])(select => { 15270 const { 15271 getEditedPostTemplate 15272 } = select(store["a" /* store */]); 15273 return { 15274 template: getEditedPostTemplate() 15275 }; 15276 }, []); 15277 const { 15278 editEntityRecord 15279 } = Object(external_wp_data_["useDispatch"])(external_wp_coreData_["store"]); 15280 const { 15281 getEditorSettings 15282 } = Object(external_wp_data_["useSelect"])(external_wp_editor_["store"]); 15283 const { 15284 updateEditorSettings 15285 } = Object(external_wp_data_["useDispatch"])(external_wp_editor_["store"]); 15286 15287 let templateTitle = Object(external_wp_i18n_["__"])('Default'); 15288 15289 if (template !== null && template !== void 0 && template.title) { 15290 templateTitle = template.title; 15291 } else if (!!template) { 15292 templateTitle = template.slug; 15293 } 15294 15295 return Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], { 15296 label: Object(external_wp_i18n_["__"])('Title'), 15297 value: templateTitle, 15298 help: Object(external_wp_i18n_["__"])('Give the template a title that indicates its purpose, e.g. "Full Width".'), 15299 onChange: newTitle => { 15300 const settings = getEditorSettings(); 15301 const newAvailableTemplates = Object(external_lodash_["mapValues"])(settings.availableTemplates, (existingTitle, id) => { 15302 if (id !== template.slug) { 15303 return existingTitle; 15304 } 15305 15306 return newTitle; 15307 }); 15308 updateEditorSettings({ ...settings, 15309 availableTemplates: newAvailableTemplates 15310 }); 15311 editEntityRecord('postType', 'wp_template', template.id, { 15312 title: newTitle 15313 }); 15314 } 15315 }); 15316 } 15317 15318 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/template-title/template-description.js 15319 15320 15321 /** 15322 * WordPress dependencies 15323 */ 15324 15325 15326 /** 15327 * Internal dependencies 15328 */ 15329 15330 15331 function TemplateDescription() { 15332 const { 15333 description 15334 } = Object(external_wp_data_["useSelect"])(select => { 15335 const { 15336 getEditedPostTemplate 15337 } = select(store["a" /* store */]); 15338 return { 15339 description: getEditedPostTemplate().description 15340 }; 15341 }, []); 15342 15343 if (!description) { 15344 return null; 15345 } 15346 15347 return Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalText"], { 15348 size: "body" 15349 }, description); 15350 } 15351 15352 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/template-title/index.js 15353 15354 15355 /** 15356 * WordPress dependencies 15357 */ 15358 15359 15360 15361 15362 /** 15363 * Internal dependencies 15364 */ 15365 15366 15367 15368 15369 15370 15371 15372 15373 function TemplateTitle() { 15374 const { 15375 template, 15376 isEditing, 15377 title 15378 } = Object(external_wp_data_["useSelect"])(select => { 15379 const { 15380 isEditingTemplate, 15381 getEditedPostTemplate 15382 } = select(store["a" /* store */]); 15383 const { 15384 getEditedPostAttribute 15385 } = select(external_wp_editor_["store"]); 15386 15387 const _isEditing = isEditingTemplate(); 15388 15389 return { 15390 template: _isEditing ? getEditedPostTemplate() : null, 15391 isEditing: _isEditing, 15392 title: getEditedPostAttribute('title') 15393 }; 15394 }, []); 15395 const { 15396 clearSelectedBlock 15397 } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]); 15398 const { 15399 setIsEditingTemplate 15400 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 15401 15402 if (!isEditing || !template) { 15403 return null; 15404 } 15405 15406 let templateTitle = Object(external_wp_i18n_["__"])('Default'); 15407 15408 if (template !== null && template !== void 0 && template.title) { 15409 templateTitle = template.title; 15410 } else if (!!template) { 15411 templateTitle = template.slug; 15412 } 15413 15414 return Object(external_wp_element_["createElement"])("div", { 15415 className: "edit-post-template-top-area" 15416 }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 15417 className: "edit-post-template-post-title", 15418 isLink: true, 15419 showTooltip: true, 15420 label: Object(external_wp_i18n_["sprintf"])( 15421 /* translators: %s: Title of the referring post, e.g: "Hello World!" */ 15422 Object(external_wp_i18n_["__"])('Edit %s'), title), 15423 onClick: () => { 15424 clearSelectedBlock(); 15425 setIsEditingTemplate(false); 15426 } 15427 }, title), Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], { 15428 position: "bottom center", 15429 contentClassName: "edit-post-template-top-area__popover", 15430 renderToggle: ({ 15431 onToggle 15432 }) => Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 15433 className: "edit-post-template-title", 15434 isLink: true, 15435 icon: chevron_down["a" /* default */], 15436 showTooltip: true, 15437 onClick: onToggle, 15438 label: Object(external_wp_i18n_["__"])('Template Options') 15439 }, templateTitle), 15440 renderContent: () => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, template.has_theme_file ? Object(external_wp_element_["createElement"])(TemplateDescription, null) : Object(external_wp_element_["createElement"])(EditTemplateTitle, null), Object(external_wp_element_["createElement"])(DeleteTemplate, null)) 15441 })); 15442 } 15443 15444 /* harmony default export */ var template_title = (TemplateTitle); 15445 15446 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/index.js 15447 15448 15449 /** 15450 * External dependencies 15451 */ 15452 15453 /** 15454 * WordPress dependencies 15455 */ 15456 15457 15458 15459 15460 15461 /** 15462 * Internal dependencies 15463 */ 15464 15465 15466 15467 15468 15469 15470 15471 15472 15473 15474 function Header({ 15475 setEntitiesSavedStatesCallback 15476 }) { 15477 const { 15478 hasActiveMetaboxes, 15479 isPublishSidebarOpened, 15480 isSaving, 15481 showIconLabels, 15482 hasReducedUI 15483 } = Object(external_wp_data_["useSelect"])(select => ({ 15484 hasActiveMetaboxes: select(store["a" /* store */]).hasMetaBoxes(), 15485 isPublishSidebarOpened: select(store["a" /* store */]).isPublishSidebarOpened(), 15486 isSaving: select(store["a" /* store */]).isSavingMetaBoxes(), 15487 showIconLabels: select(store["a" /* store */]).isFeatureActive('showIconLabels'), 15488 hasReducedUI: select(store["a" /* store */]).isFeatureActive('reducedUI') 15489 }), []); 15490 const isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('large'); 15491 const classes = classnames_default()('edit-post-header', { 15492 'has-reduced-ui': hasReducedUI 15493 }); 15494 return Object(external_wp_element_["createElement"])("div", { 15495 className: classes 15496 }, Object(external_wp_element_["createElement"])(main_dashboard_button.Slot, null, Object(external_wp_element_["createElement"])(fullscreen_mode_close, null)), Object(external_wp_element_["createElement"])("div", { 15497 className: "edit-post-header__toolbar" 15498 }, Object(external_wp_element_["createElement"])(header_toolbar, null), Object(external_wp_element_["createElement"])(template_title, null)), Object(external_wp_element_["createElement"])("div", { 15499 className: "edit-post-header__settings" 15500 }, !isPublishSidebarOpened && // This button isn't completely hidden by the publish sidebar. 15501 // We can't hide the whole toolbar when the publish sidebar is open because 15502 // we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node. 15503 // We track that DOM node to return focus to the PostPublishButtonOrToggle 15504 // when the publish sidebar has been closed. 15505 Object(external_wp_element_["createElement"])(external_wp_editor_["PostSavedState"], { 15506 forceIsDirty: hasActiveMetaboxes, 15507 forceIsSaving: isSaving, 15508 showIconLabels: showIconLabels 15509 }), Object(external_wp_element_["createElement"])(DevicePreview, null), Object(external_wp_element_["createElement"])(external_wp_editor_["PostPreviewButton"], { 15510 forceIsAutosaveable: hasActiveMetaboxes, 15511 forcePreviewLink: isSaving ? null : undefined 15512 }), Object(external_wp_element_["createElement"])(post_publish_button_or_toggle, { 15513 forceIsDirty: hasActiveMetaboxes, 15514 forceIsSaving: isSaving, 15515 setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback 15516 }), (isLargeViewport || !showIconLabels) && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(build_module["f" /* PinnedItems */].Slot, { 15517 scope: "core/edit-post" 15518 }), Object(external_wp_element_["createElement"])(more_menu, { 15519 showIconLabels: showIconLabels 15520 })), showIconLabels && !isLargeViewport && Object(external_wp_element_["createElement"])(more_menu, { 15521 showIconLabels: showIconLabels 15522 }))); 15523 } 15524 15525 /* harmony default export */ var header = (Header); 15526 15527 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js 15528 var library_close = __webpack_require__("w95h"); 15529 15530 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/secondary-sidebar/inserter-sidebar.js 15531 15532 15533 15534 /** 15535 * WordPress dependencies 15536 */ 15537 15538 15539 15540 15541 15542 /** 15543 * Internal dependencies 15544 */ 15545 15546 15547 function InserterSidebar() { 15548 const { 15549 insertionPoint, 15550 showMostUsedBlocks 15551 } = Object(external_wp_data_["useSelect"])(select => { 15552 const { 15553 isFeatureActive, 15554 __experimentalGetInsertionPoint 15555 } = select(store["a" /* store */]); 15556 return { 15557 insertionPoint: __experimentalGetInsertionPoint(), 15558 showMostUsedBlocks: isFeatureActive('mostUsedBlocks') 15559 }; 15560 }, []); 15561 const { 15562 setIsInserterOpened 15563 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 15564 const isMobileViewport = Object(external_wp_compose_["useViewportMatch"])('medium', '<'); 15565 const [inserterDialogRef, inserterDialogProps] = Object(external_wp_compose_["__experimentalUseDialog"])({ 15566 onClose: () => setIsInserterOpened(false) 15567 }); 15568 return Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({ 15569 ref: inserterDialogRef 15570 }, inserterDialogProps, { 15571 className: "edit-post-editor__inserter-panel" 15572 }), Object(external_wp_element_["createElement"])("div", { 15573 className: "edit-post-editor__inserter-panel-header" 15574 }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 15575 icon: library_close["a" /* default */], 15576 onClick: () => setIsInserterOpened(false) 15577 })), Object(external_wp_element_["createElement"])("div", { 15578 className: "edit-post-editor__inserter-panel-content" 15579 }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalLibrary"], { 15580 showMostUsedBlocks: showMostUsedBlocks, 15581 showInserterHelpPanel: true, 15582 shouldFocusBlock: isMobileViewport, 15583 rootClientId: insertionPoint.rootClientId, 15584 __experimentalInsertionIndex: insertionPoint.insertionIndex 15585 }))); 15586 } 15587 15588 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js 15589 var close_small = __webpack_require__("bWcr"); 15590 15591 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/secondary-sidebar/list-view-sidebar.js 15592 15593 15594 /** 15595 * WordPress dependencies 15596 */ 15597 15598 15599 15600 15601 15602 15603 15604 /** 15605 * Internal dependencies 15606 */ 15607 15608 15609 function ListViewSidebar() { 15610 const { 15611 setIsListViewOpened 15612 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 15613 const { 15614 clearSelectedBlock, 15615 selectBlock 15616 } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]); 15617 15618 async function selectEditorBlock(clientId) { 15619 await clearSelectedBlock(); 15620 selectBlock(clientId, -1); 15621 } 15622 15623 const focusOnMountRef = Object(external_wp_compose_["useFocusOnMount"])('firstElement'); 15624 const focusReturnRef = Object(external_wp_compose_["useFocusReturn"])(); 15625 15626 function closeOnEscape(event) { 15627 if (event.keyCode === external_wp_keycodes_["ESCAPE"]) { 15628 event.stopPropagation(); 15629 setIsListViewOpened(false); 15630 } 15631 } 15632 15633 const instanceId = Object(external_wp_compose_["useInstanceId"])(ListViewSidebar); 15634 const labelId = `edit-post-editor__list-view-panel-label-${instanceId}`; 15635 return (// eslint-disable-next-line jsx-a11y/no-static-element-interactions 15636 Object(external_wp_element_["createElement"])("div", { 15637 "aria-labelledby": labelId, 15638 className: "edit-post-editor__list-view-panel", 15639 onKeyDown: closeOnEscape 15640 }, Object(external_wp_element_["createElement"])("div", { 15641 className: "edit-post-editor__list-view-panel-header" 15642 }, Object(external_wp_element_["createElement"])("strong", { 15643 id: labelId 15644 }, Object(external_wp_i18n_["__"])('List view')), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 15645 icon: close_small["a" /* default */], 15646 label: Object(external_wp_i18n_["__"])('Close list view sidebar'), 15647 onClick: () => setIsListViewOpened(false) 15648 })), Object(external_wp_element_["createElement"])("div", { 15649 className: "edit-post-editor__list-view-panel-content", 15650 ref: Object(external_wp_compose_["useMergeRefs"])([focusReturnRef, focusOnMountRef]) 15651 }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalBlockNavigationTree"], { 15652 onSelect: selectEditorBlock, 15653 showNestedBlocks: true, 15654 __experimentalPersistentListViewFeatures: true 15655 }))) 15656 ); 15657 } 15658 15659 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/cog.js 15660 var cog = __webpack_require__("Cg8A"); 15661 15662 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/settings-header/index.js 15663 15664 15665 /** 15666 * WordPress dependencies 15667 */ 15668 15669 15670 15671 /** 15672 * Internal dependencies 15673 */ 15674 15675 15676 15677 const SettingsHeader = ({ 15678 sidebarName 15679 }) => { 15680 const { 15681 openGeneralSidebar 15682 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 15683 15684 const openDocumentSettings = () => openGeneralSidebar('edit-post/document'); 15685 15686 const openBlockSettings = () => openGeneralSidebar('edit-post/block'); 15687 15688 const { 15689 documentLabel, 15690 isTemplateMode 15691 } = Object(external_wp_data_["useSelect"])(select => { 15692 var _postType$labels$sing, _postType$labels; 15693 15694 const currentPostType = select('core/editor').getCurrentPostType(); 15695 const postType = select('core').getPostType(currentPostType); 15696 return { 15697 documentLabel: // Disable reason: Post type labels object is shaped like this. 15698 // eslint-disable-next-line camelcase 15699 (_postType$labels$sing = postType === null || postType === void 0 ? void 0 : (_postType$labels = postType.labels) === null || _postType$labels === void 0 ? void 0 : _postType$labels.singular_name) !== null && _postType$labels$sing !== void 0 ? _postType$labels$sing : // translators: Default label for the Document sidebar tab, not selected. 15700 Object(external_wp_i18n_["__"])('Document'), 15701 isTemplateMode: select(store["a" /* store */]).isEditingTemplate() 15702 }; 15703 }, []); 15704 const [documentAriaLabel, documentActiveClass] = sidebarName === 'edit-post/document' ? // translators: ARIA label for the Document sidebar tab, selected. %s: Document label. 15705 [Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('%s (selected)'), documentLabel), 'is-active'] : [documentLabel, '']; 15706 const [blockAriaLabel, blockActiveClass] = sidebarName === 'edit-post/block' ? // translators: ARIA label for the Block Settings Sidebar tab, selected. 15707 [Object(external_wp_i18n_["__"])('Block (selected)'), 'is-active'] : // translators: ARIA label for the Block Settings Sidebar tab, not selected. 15708 [Object(external_wp_i18n_["__"])('Block'), '']; 15709 const [templateAriaLabel, templateActiveClass] = sidebarName === 'edit-post/document' ? [Object(external_wp_i18n_["__"])('Template (selected)'), 'is-active'] : [Object(external_wp_i18n_["__"])('Template'), '']; 15710 /* Use a list so screen readers will announce how many tabs there are. */ 15711 15712 return Object(external_wp_element_["createElement"])("ul", null, !isTemplateMode && Object(external_wp_element_["createElement"])("li", null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 15713 onClick: openDocumentSettings, 15714 className: `edit-post-sidebar__panel-tab ${documentActiveClass}`, 15715 "aria-label": documentAriaLabel, 15716 "data-label": documentLabel 15717 }, documentLabel)), isTemplateMode && Object(external_wp_element_["createElement"])("li", null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 15718 onClick: openDocumentSettings, 15719 className: `edit-post-sidebar__panel-tab ${templateActiveClass}`, 15720 "aria-label": templateAriaLabel, 15721 "data-label": Object(external_wp_i18n_["__"])('Template') 15722 }, Object(external_wp_i18n_["__"])('Template'))), Object(external_wp_element_["createElement"])("li", null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 15723 onClick: openBlockSettings, 15724 className: `edit-post-sidebar__panel-tab ${blockActiveClass}`, 15725 "aria-label": blockAriaLabel // translators: Data label for the Block Settings Sidebar tab. 15726 , 15727 "data-label": Object(external_wp_i18n_["__"])('Block') 15728 }, // translators: Text label for the Block Settings Sidebar tab. 15729 Object(external_wp_i18n_["__"])('Block')))); 15730 }; 15731 15732 /* harmony default export */ var settings_header = (SettingsHeader); 15733 15734 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-visibility/index.js 15735 15736 15737 /** 15738 * WordPress dependencies 15739 */ 15740 15741 15742 15743 function PostVisibility() { 15744 return Object(external_wp_element_["createElement"])(external_wp_editor_["PostVisibilityCheck"], { 15745 render: ({ 15746 canEdit 15747 }) => Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], { 15748 className: "edit-post-post-visibility" 15749 }, Object(external_wp_element_["createElement"])("span", null, Object(external_wp_i18n_["__"])('Visibility')), !canEdit && Object(external_wp_element_["createElement"])("span", null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostVisibilityLabel"], null)), canEdit && Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], { 15750 position: "bottom left", 15751 contentClassName: "edit-post-post-visibility__dialog", 15752 renderToggle: ({ 15753 isOpen, 15754 onToggle 15755 }) => Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 15756 "aria-expanded": isOpen, 15757 className: "edit-post-post-visibility__toggle", 15758 onClick: onToggle, 15759 isTertiary: true 15760 }, Object(external_wp_element_["createElement"])(external_wp_editor_["PostVisibilityLabel"], null)), 15761 renderContent: () => Object(external_wp_element_["createElement"])(external_wp_editor_["PostVisibility"], null) 15762 })) 15763 }); 15764 } 15765 /* harmony default export */ var post_visibility = (PostVisibility); 15766 15767 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-trash/index.js 15768 15769 15770 /** 15771 * WordPress dependencies 15772 */ 15773 15774 15775 function PostTrash() { 15776 return Object(external_wp_element_["createElement"])(external_wp_editor_["PostTrashCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostTrash"], null))); 15777 } 15778 15779 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-schedule/index.js 15780 15781 15782 /** 15783 * WordPress dependencies 15784 */ 15785 15786 15787 15788 15789 function PostSchedule() { 15790 const anchorRef = Object(external_wp_element_["useRef"])(); 15791 return Object(external_wp_element_["createElement"])(external_wp_editor_["PostScheduleCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], { 15792 className: "edit-post-post-schedule", 15793 ref: anchorRef 15794 }, Object(external_wp_element_["createElement"])("span", null, Object(external_wp_i18n_["__"])('Publish')), Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], { 15795 popoverProps: { 15796 anchorRef: anchorRef.current 15797 }, 15798 position: "bottom left", 15799 contentClassName: "edit-post-post-schedule__dialog", 15800 renderToggle: ({ 15801 onToggle, 15802 isOpen 15803 }) => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 15804 className: "edit-post-post-schedule__toggle", 15805 onClick: onToggle, 15806 "aria-expanded": isOpen, 15807 isTertiary: true 15808 }, Object(external_wp_element_["createElement"])(external_wp_editor_["PostScheduleLabel"], null))), 15809 renderContent: () => Object(external_wp_element_["createElement"])(external_wp_editor_["PostSchedule"], null) 15810 }))); 15811 } 15812 /* harmony default export */ var post_schedule = (PostSchedule); 15813 15814 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-sticky/index.js 15815 15816 15817 /** 15818 * WordPress dependencies 15819 */ 15820 15821 15822 function PostSticky() { 15823 return Object(external_wp_element_["createElement"])(external_wp_editor_["PostStickyCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostSticky"], null))); 15824 } 15825 /* harmony default export */ var post_sticky = (PostSticky); 15826 15827 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-author/index.js 15828 15829 15830 /** 15831 * WordPress dependencies 15832 */ 15833 15834 15835 function PostAuthor() { 15836 return Object(external_wp_element_["createElement"])(external_wp_editor_["PostAuthorCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostAuthor"], null))); 15837 } 15838 /* harmony default export */ var post_author = (PostAuthor); 15839 15840 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-slug/index.js 15841 15842 15843 /** 15844 * WordPress dependencies 15845 */ 15846 15847 15848 function PostSlug() { 15849 return Object(external_wp_element_["createElement"])(external_wp_editor_["PostSlugCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostSlug"], null))); 15850 } 15851 /* harmony default export */ var post_slug = (PostSlug); 15852 15853 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-format/index.js 15854 15855 15856 /** 15857 * WordPress dependencies 15858 */ 15859 15860 15861 function PostFormat() { 15862 return Object(external_wp_element_["createElement"])(external_wp_editor_["PostFormatCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostFormat"], null))); 15863 } 15864 /* harmony default export */ var post_format = (PostFormat); 15865 15866 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-pending-status/index.js 15867 15868 15869 /** 15870 * WordPress dependencies 15871 */ 15872 15873 15874 function PostPendingStatus() { 15875 return Object(external_wp_element_["createElement"])(external_wp_editor_["PostPendingStatusCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostPendingStatus"], null))); 15876 } 15877 /* harmony default export */ var post_pending_status = (PostPendingStatus); 15878 15879 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-post-status-info/index.js 15880 15881 15882 /** 15883 * Defines as extensibility slot for the Status & visibility panel. 15884 */ 15885 15886 /** 15887 * WordPress dependencies 15888 */ 15889 15890 const { 15891 Fill: plugin_post_status_info_Fill, 15892 Slot: plugin_post_status_info_Slot 15893 } = Object(external_wp_components_["createSlotFill"])('PluginPostStatusInfo'); 15894 /** 15895 * Renders a row in the Status & visibility panel of the Document sidebar. 15896 * It should be noted that this is named and implemented around the function it serves 15897 * and not its location, which may change in future iterations. 15898 * 15899 * @param {Object} props Component properties. 15900 * @param {string} [props.className] An optional class name added to the row. 15901 * @param {WPElement} props.children Children to be rendered. 15902 * 15903 * @example 15904 * ```js 15905 * // Using ES5 syntax 15906 * var __ = wp.i18n.__; 15907 * var PluginPostStatusInfo = wp.editPost.PluginPostStatusInfo; 15908 * 15909 * function MyPluginPostStatusInfo() { 15910 * return wp.element.createElement( 15911 * PluginPostStatusInfo, 15912 * { 15913 * className: 'my-plugin-post-status-info', 15914 * }, 15915 * __( 'My post status info' ) 15916 * ) 15917 * } 15918 * ``` 15919 * 15920 * @example 15921 * ```jsx 15922 * // Using ESNext syntax 15923 * import { __ } from '@wordpress/i18n'; 15924 * import { PluginPostStatusInfo } from '@wordpress/edit-post'; 15925 * 15926 * const MyPluginPostStatusInfo = () => ( 15927 * <PluginPostStatusInfo 15928 * className="my-plugin-post-status-info" 15929 * > 15930 * { __( 'My post status info' ) } 15931 * </PluginPostStatusInfo> 15932 * ); 15933 * ``` 15934 * 15935 * @return {WPComponent} The component to be rendered. 15936 */ 15937 15938 const PluginPostStatusInfo = ({ 15939 children, 15940 className 15941 }) => Object(external_wp_element_["createElement"])(plugin_post_status_info_Fill, null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], { 15942 className: className 15943 }, children)); 15944 15945 PluginPostStatusInfo.Slot = plugin_post_status_info_Slot; 15946 /* harmony default export */ var plugin_post_status_info = (PluginPostStatusInfo); 15947 15948 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-status/index.js 15949 15950 15951 /** 15952 * WordPress dependencies 15953 */ 15954 15955 15956 15957 15958 /** 15959 * Internal dependencies 15960 */ 15961 15962 15963 15964 15965 15966 15967 15968 15969 15970 15971 15972 /** 15973 * Module Constants 15974 */ 15975 15976 const PANEL_NAME = 'post-status'; 15977 15978 function PostStatus({ 15979 isOpened, 15980 onTogglePanel 15981 }) { 15982 return Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { 15983 className: "edit-post-post-status", 15984 title: Object(external_wp_i18n_["__"])('Status & visibility'), 15985 opened: isOpened, 15986 onToggle: onTogglePanel 15987 }, Object(external_wp_element_["createElement"])(plugin_post_status_info.Slot, null, fills => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(post_visibility, null), Object(external_wp_element_["createElement"])(post_schedule, null), Object(external_wp_element_["createElement"])(post_format, null), Object(external_wp_element_["createElement"])(post_sticky, null), Object(external_wp_element_["createElement"])(post_pending_status, null), Object(external_wp_element_["createElement"])(post_slug, null), Object(external_wp_element_["createElement"])(post_author, null), fills, Object(external_wp_element_["createElement"])(PostTrash, null)))); 15988 } 15989 15990 /* harmony default export */ var post_status = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])(select => { 15991 // We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do 15992 // not use isEditorPanelEnabled since this panel should not be disabled through the UI. 15993 const { 15994 isEditorPanelRemoved, 15995 isEditorPanelOpened 15996 } = select(store["a" /* store */]); 15997 return { 15998 isRemoved: isEditorPanelRemoved(PANEL_NAME), 15999 isOpened: isEditorPanelOpened(PANEL_NAME) 16000 }; 16001 }), Object(external_wp_compose_["ifCondition"])(({ 16002 isRemoved 16003 }) => !isRemoved), Object(external_wp_data_["withDispatch"])(dispatch => ({ 16004 onTogglePanel() { 16005 return dispatch(store["a" /* store */]).toggleEditorPanelOpened(PANEL_NAME); 16006 } 16007 16008 }))])(PostStatus)); 16009 16010 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/last-revision/index.js 16011 16012 16013 /** 16014 * WordPress dependencies 16015 */ 16016 16017 16018 16019 function LastRevision() { 16020 return Object(external_wp_element_["createElement"])(external_wp_editor_["PostLastRevisionCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { 16021 className: "edit-post-last-revision__panel" 16022 }, Object(external_wp_element_["createElement"])(external_wp_editor_["PostLastRevision"], null))); 16023 } 16024 16025 /* harmony default export */ var last_revision = (LastRevision); 16026 16027 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js 16028 16029 16030 /** 16031 * External dependencies 16032 */ 16033 16034 /** 16035 * WordPress dependencies 16036 */ 16037 16038 16039 16040 16041 /** 16042 * Internal dependencies 16043 */ 16044 16045 16046 16047 function TaxonomyPanel({ 16048 isEnabled, 16049 taxonomy, 16050 isOpened, 16051 onTogglePanel, 16052 children 16053 }) { 16054 if (!isEnabled) { 16055 return null; 16056 } 16057 16058 const taxonomyMenuName = Object(external_lodash_["get"])(taxonomy, ['labels', 'menu_name']); 16059 16060 if (!taxonomyMenuName) { 16061 return null; 16062 } 16063 16064 return Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { 16065 title: taxonomyMenuName, 16066 opened: isOpened, 16067 onToggle: onTogglePanel 16068 }, children); 16069 } 16070 16071 /* harmony default export */ var taxonomy_panel = (Object(external_wp_compose_["compose"])(Object(external_wp_data_["withSelect"])((select, ownProps) => { 16072 const slug = Object(external_lodash_["get"])(ownProps.taxonomy, ['slug']); 16073 const panelName = slug ? `taxonomy-panel-${slug}` : ''; 16074 return { 16075 panelName, 16076 isEnabled: slug ? select(store["a" /* store */]).isEditorPanelEnabled(panelName) : false, 16077 isOpened: slug ? select(store["a" /* store */]).isEditorPanelOpened(panelName) : false 16078 }; 16079 }), Object(external_wp_data_["withDispatch"])((dispatch, ownProps) => ({ 16080 onTogglePanel: () => { 16081 dispatch(store["a" /* store */]).toggleEditorPanelOpened(ownProps.panelName); 16082 } 16083 })))(TaxonomyPanel)); 16084 16085 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-taxonomies/index.js 16086 16087 16088 /** 16089 * WordPress dependencies 16090 */ 16091 16092 /** 16093 * Internal dependencies 16094 */ 16095 16096 16097 16098 function PostTaxonomies() { 16099 return Object(external_wp_element_["createElement"])(external_wp_editor_["PostTaxonomiesCheck"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostTaxonomies"], { 16100 taxonomyWrapper: (content, taxonomy) => { 16101 return Object(external_wp_element_["createElement"])(taxonomy_panel, { 16102 taxonomy: taxonomy 16103 }, content); 16104 } 16105 })); 16106 } 16107 16108 /* harmony default export */ var post_taxonomies = (PostTaxonomies); 16109 16110 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/featured-image/index.js 16111 16112 16113 /** 16114 * External dependencies 16115 */ 16116 16117 /** 16118 * WordPress dependencies 16119 */ 16120 16121 16122 16123 16124 16125 16126 /** 16127 * Internal dependencies 16128 */ 16129 16130 16131 /** 16132 * Module Constants 16133 */ 16134 16135 const featured_image_PANEL_NAME = 'featured-image'; 16136 16137 function FeaturedImage({ 16138 isEnabled, 16139 isOpened, 16140 postType, 16141 onTogglePanel 16142 }) { 16143 if (!isEnabled) { 16144 return null; 16145 } 16146 16147 return Object(external_wp_element_["createElement"])(external_wp_editor_["PostFeaturedImageCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { 16148 title: Object(external_lodash_["get"])(postType, ['labels', 'featured_image'], Object(external_wp_i18n_["__"])('Featured image')), 16149 opened: isOpened, 16150 onToggle: onTogglePanel 16151 }, Object(external_wp_element_["createElement"])(external_wp_editor_["PostFeaturedImage"], null))); 16152 } 16153 16154 const applyWithSelect = Object(external_wp_data_["withSelect"])(select => { 16155 const { 16156 getEditedPostAttribute 16157 } = select('core/editor'); 16158 const { 16159 getPostType 16160 } = select('core'); 16161 const { 16162 isEditorPanelEnabled, 16163 isEditorPanelOpened 16164 } = select(store["a" /* store */]); 16165 return { 16166 postType: getPostType(getEditedPostAttribute('type')), 16167 isEnabled: isEditorPanelEnabled(featured_image_PANEL_NAME), 16168 isOpened: isEditorPanelOpened(featured_image_PANEL_NAME) 16169 }; 16170 }); 16171 const applyWithDispatch = Object(external_wp_data_["withDispatch"])(dispatch => { 16172 const { 16173 toggleEditorPanelOpened 16174 } = dispatch(store["a" /* store */]); 16175 return { 16176 onTogglePanel: Object(external_lodash_["partial"])(toggleEditorPanelOpened, featured_image_PANEL_NAME) 16177 }; 16178 }); 16179 /* harmony default export */ var featured_image = (Object(external_wp_compose_["compose"])(applyWithSelect, applyWithDispatch)(FeaturedImage)); 16180 16181 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-excerpt/index.js 16182 16183 16184 /** 16185 * WordPress dependencies 16186 */ 16187 16188 16189 16190 16191 16192 /** 16193 * Internal dependencies 16194 */ 16195 16196 16197 /** 16198 * Module Constants 16199 */ 16200 16201 const post_excerpt_PANEL_NAME = 'post-excerpt'; 16202 16203 function PostExcerpt({ 16204 isEnabled, 16205 isOpened, 16206 onTogglePanel 16207 }) { 16208 if (!isEnabled) { 16209 return null; 16210 } 16211 16212 return Object(external_wp_element_["createElement"])(external_wp_editor_["PostExcerptCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { 16213 title: Object(external_wp_i18n_["__"])('Excerpt'), 16214 opened: isOpened, 16215 onToggle: onTogglePanel 16216 }, Object(external_wp_element_["createElement"])(external_wp_editor_["PostExcerpt"], null))); 16217 } 16218 16219 /* harmony default export */ var post_excerpt = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])(select => { 16220 return { 16221 isEnabled: select(store["a" /* store */]).isEditorPanelEnabled(post_excerpt_PANEL_NAME), 16222 isOpened: select(store["a" /* store */]).isEditorPanelOpened(post_excerpt_PANEL_NAME) 16223 }; 16224 }), Object(external_wp_data_["withDispatch"])(dispatch => ({ 16225 onTogglePanel() { 16226 return dispatch(store["a" /* store */]).toggleEditorPanelOpened(post_excerpt_PANEL_NAME); 16227 } 16228 16229 }))])(PostExcerpt)); 16230 16231 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-link/index.js 16232 16233 16234 /** 16235 * External dependencies 16236 */ 16237 16238 /** 16239 * WordPress dependencies 16240 */ 16241 16242 16243 16244 16245 16246 16247 16248 /** 16249 * Internal dependencies 16250 */ 16251 16252 16253 /** 16254 * Module Constants 16255 */ 16256 16257 const post_link_PANEL_NAME = 'post-link'; 16258 16259 function PostLink({ 16260 isOpened, 16261 onTogglePanel, 16262 isEditable, 16263 postLink, 16264 permalinkPrefix, 16265 permalinkSuffix, 16266 editPermalink, 16267 forceEmptyField, 16268 setState, 16269 postSlug, 16270 postTypeLabel 16271 }) { 16272 let prefixElement, postNameElement, suffixElement; 16273 16274 if (isEditable) { 16275 prefixElement = permalinkPrefix && Object(external_wp_element_["createElement"])("span", { 16276 className: "edit-post-post-link__link-prefix" 16277 }, permalinkPrefix); 16278 postNameElement = postSlug && Object(external_wp_element_["createElement"])("span", { 16279 className: "edit-post-post-link__link-post-name" 16280 }, postSlug); 16281 suffixElement = permalinkSuffix && Object(external_wp_element_["createElement"])("span", { 16282 className: "edit-post-post-link__link-suffix" 16283 }, permalinkSuffix); 16284 } 16285 16286 return Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { 16287 title: Object(external_wp_i18n_["__"])('Permalink'), 16288 opened: isOpened, 16289 onToggle: onTogglePanel 16290 }, isEditable && Object(external_wp_element_["createElement"])("div", { 16291 className: "editor-post-link" 16292 }, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], { 16293 label: Object(external_wp_i18n_["__"])('URL Slug'), 16294 value: forceEmptyField ? '' : postSlug, 16295 onChange: newValue => { 16296 editPermalink(newValue); // When we delete the field the permalink gets 16297 // reverted to the original value. 16298 // The forceEmptyField logic allows the user to have 16299 // the field temporarily empty while typing. 16300 16301 if (!newValue) { 16302 if (!forceEmptyField) { 16303 setState({ 16304 forceEmptyField: true 16305 }); 16306 } 16307 16308 return; 16309 } 16310 16311 if (forceEmptyField) { 16312 setState({ 16313 forceEmptyField: false 16314 }); 16315 } 16316 }, 16317 onBlur: event => { 16318 editPermalink(Object(external_wp_editor_["cleanForSlug"])(event.target.value)); 16319 16320 if (forceEmptyField) { 16321 setState({ 16322 forceEmptyField: false 16323 }); 16324 } 16325 } 16326 }), Object(external_wp_element_["createElement"])("p", null, Object(external_wp_i18n_["__"])('The last part of the URL.'), ' ', Object(external_wp_element_["createElement"])(external_wp_components_["ExternalLink"], { 16327 href: "https://wordpress.org/support/article/writing-posts/#post-field-descriptions" 16328 }, Object(external_wp_i18n_["__"])('Read about permalinks')))), Object(external_wp_element_["createElement"])("h3", { 16329 className: "edit-post-post-link__preview-label" 16330 }, postTypeLabel || Object(external_wp_i18n_["__"])('View post')), Object(external_wp_element_["createElement"])("div", { 16331 className: "edit-post-post-link__preview-link-container" 16332 }, Object(external_wp_element_["createElement"])(external_wp_components_["ExternalLink"], { 16333 className: "edit-post-post-link__link", 16334 href: postLink, 16335 target: "_blank" 16336 }, isEditable ? Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, prefixElement, postNameElement, suffixElement) : postLink))); 16337 } 16338 16339 /* harmony default export */ var post_link = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])(select => { 16340 const { 16341 isPermalinkEditable, 16342 getCurrentPost, 16343 isCurrentPostPublished, 16344 getPermalinkParts, 16345 getEditedPostAttribute, 16346 getEditedPostSlug 16347 } = select('core/editor'); 16348 const { 16349 isEditorPanelEnabled, 16350 isEditorPanelOpened 16351 } = select(store["a" /* store */]); 16352 const { 16353 getPostType 16354 } = select('core'); 16355 const { 16356 link 16357 } = getCurrentPost(); 16358 const postTypeName = getEditedPostAttribute('type'); 16359 const postType = getPostType(postTypeName); 16360 const permalinkParts = getPermalinkParts(); 16361 return { 16362 postLink: link, 16363 isEditable: isPermalinkEditable(), 16364 isPublished: isCurrentPostPublished(), 16365 isOpened: isEditorPanelOpened(post_link_PANEL_NAME), 16366 isEnabled: isEditorPanelEnabled(post_link_PANEL_NAME), 16367 isViewable: Object(external_lodash_["get"])(postType, ['viewable'], false), 16368 postSlug: Object(external_wp_url_["safeDecodeURIComponent"])(getEditedPostSlug()), 16369 postTypeLabel: Object(external_lodash_["get"])(postType, ['labels', 'view_item']), 16370 hasPermalinkParts: !!permalinkParts, 16371 permalinkPrefix: permalinkParts === null || permalinkParts === void 0 ? void 0 : permalinkParts.prefix, 16372 permalinkSuffix: permalinkParts === null || permalinkParts === void 0 ? void 0 : permalinkParts.suffix 16373 }; 16374 }), Object(external_wp_compose_["ifCondition"])(({ 16375 isEnabled, 16376 postLink, 16377 isViewable, 16378 hasPermalinkParts 16379 }) => { 16380 return isEnabled && postLink && isViewable && hasPermalinkParts; 16381 }), Object(external_wp_data_["withDispatch"])(dispatch => { 16382 const { 16383 toggleEditorPanelOpened 16384 } = dispatch(store["a" /* store */]); 16385 const { 16386 editPost 16387 } = dispatch('core/editor'); 16388 return { 16389 onTogglePanel: () => toggleEditorPanelOpened(post_link_PANEL_NAME), 16390 editPermalink: newSlug => { 16391 editPost({ 16392 slug: newSlug 16393 }); 16394 } 16395 }; 16396 }), Object(external_wp_compose_["withState"])({ 16397 forceEmptyField: false 16398 })])(PostLink)); 16399 16400 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/discussion-panel/index.js 16401 16402 16403 /** 16404 * WordPress dependencies 16405 */ 16406 16407 16408 16409 16410 16411 /** 16412 * Internal dependencies 16413 */ 16414 16415 16416 /** 16417 * Module Constants 16418 */ 16419 16420 const discussion_panel_PANEL_NAME = 'discussion-panel'; 16421 16422 function DiscussionPanel({ 16423 isEnabled, 16424 isOpened, 16425 onTogglePanel 16426 }) { 16427 if (!isEnabled) { 16428 return null; 16429 } 16430 16431 return Object(external_wp_element_["createElement"])(external_wp_editor_["PostTypeSupportCheck"], { 16432 supportKeys: ['comments', 'trackbacks'] 16433 }, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { 16434 title: Object(external_wp_i18n_["__"])('Discussion'), 16435 opened: isOpened, 16436 onToggle: onTogglePanel 16437 }, Object(external_wp_element_["createElement"])(external_wp_editor_["PostTypeSupportCheck"], { 16438 supportKeys: "comments" 16439 }, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostComments"], null))), Object(external_wp_element_["createElement"])(external_wp_editor_["PostTypeSupportCheck"], { 16440 supportKeys: "trackbacks" 16441 }, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostPingbacks"], null))))); 16442 } 16443 16444 /* harmony default export */ var discussion_panel = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])(select => { 16445 return { 16446 isEnabled: select(store["a" /* store */]).isEditorPanelEnabled(discussion_panel_PANEL_NAME), 16447 isOpened: select(store["a" /* store */]).isEditorPanelOpened(discussion_panel_PANEL_NAME) 16448 }; 16449 }), Object(external_wp_data_["withDispatch"])(dispatch => ({ 16450 onTogglePanel() { 16451 return dispatch(store["a" /* store */]).toggleEditorPanelOpened(discussion_panel_PANEL_NAME); 16452 } 16453 16454 }))])(DiscussionPanel)); 16455 16456 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/page-attributes/index.js 16457 16458 16459 /** 16460 * External dependencies 16461 */ 16462 16463 /** 16464 * WordPress dependencies 16465 */ 16466 16467 16468 16469 16470 16471 16472 /** 16473 * Internal dependencies 16474 */ 16475 16476 16477 /** 16478 * Module Constants 16479 */ 16480 16481 const page_attributes_PANEL_NAME = 'page-attributes'; 16482 function PageAttributes() { 16483 const { 16484 isEnabled, 16485 isOpened, 16486 postType 16487 } = Object(external_wp_data_["useSelect"])(select => { 16488 const { 16489 getEditedPostAttribute 16490 } = select(external_wp_editor_["store"]); 16491 const { 16492 isEditorPanelEnabled, 16493 isEditorPanelOpened 16494 } = select(store["a" /* store */]); 16495 const { 16496 getPostType 16497 } = select(external_wp_coreData_["store"]); 16498 return { 16499 isEnabled: isEditorPanelEnabled(page_attributes_PANEL_NAME), 16500 isOpened: isEditorPanelOpened(page_attributes_PANEL_NAME), 16501 postType: getPostType(getEditedPostAttribute('type')) 16502 }; 16503 }, []); 16504 const { 16505 toggleEditorPanelOpened 16506 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 16507 16508 if (!isEnabled || !postType) { 16509 return null; 16510 } 16511 16512 const onTogglePanel = Object(external_lodash_["partial"])(toggleEditorPanelOpened, page_attributes_PANEL_NAME); 16513 return Object(external_wp_element_["createElement"])(external_wp_editor_["PageAttributesCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { 16514 title: Object(external_lodash_["get"])(postType, ['labels', 'attributes'], Object(external_wp_i18n_["__"])('Page attributes')), 16515 opened: isOpened, 16516 onToggle: onTogglePanel 16517 }, Object(external_wp_element_["createElement"])(external_wp_editor_["PageAttributesParent"], null), Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PageAttributesOrder"], null)))); 16518 } 16519 /* harmony default export */ var page_attributes = (PageAttributes); 16520 16521 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-boxes-area/index.js 16522 16523 16524 /** 16525 * External dependencies 16526 */ 16527 16528 /** 16529 * WordPress dependencies 16530 */ 16531 16532 16533 16534 16535 /** 16536 * Internal dependencies 16537 */ 16538 16539 16540 16541 class meta_boxes_area_MetaBoxesArea extends external_wp_element_["Component"] { 16542 /** 16543 * @inheritdoc 16544 */ 16545 constructor() { 16546 super(...arguments); 16547 this.bindContainerNode = this.bindContainerNode.bind(this); 16548 } 16549 /** 16550 * @inheritdoc 16551 */ 16552 16553 16554 componentDidMount() { 16555 this.form = document.querySelector('.metabox-location-' + this.props.location); 16556 16557 if (this.form) { 16558 this.container.appendChild(this.form); 16559 } 16560 } 16561 /** 16562 * Get the meta box location form from the original location. 16563 */ 16564 16565 16566 componentWillUnmount() { 16567 if (this.form) { 16568 document.querySelector('#metaboxes').appendChild(this.form); 16569 } 16570 } 16571 /** 16572 * Binds the metabox area container node. 16573 * 16574 * @param {Element} node DOM Node. 16575 */ 16576 16577 16578 bindContainerNode(node) { 16579 this.container = node; 16580 } 16581 /** 16582 * @inheritdoc 16583 */ 16584 16585 16586 render() { 16587 const { 16588 location, 16589 isSaving 16590 } = this.props; 16591 const classes = classnames_default()('edit-post-meta-boxes-area', `is-${location}`, { 16592 'is-loading': isSaving 16593 }); 16594 return Object(external_wp_element_["createElement"])("div", { 16595 className: classes 16596 }, isSaving && Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null), Object(external_wp_element_["createElement"])("div", { 16597 className: "edit-post-meta-boxes-area__container", 16598 ref: this.bindContainerNode 16599 }), Object(external_wp_element_["createElement"])("div", { 16600 className: "edit-post-meta-boxes-area__clear" 16601 })); 16602 } 16603 16604 } 16605 16606 /* harmony default export */ var meta_boxes_area = (Object(external_wp_data_["withSelect"])(select => { 16607 return { 16608 isSaving: select(store["a" /* store */]).isSavingMetaBoxes() 16609 }; 16610 })(meta_boxes_area_MetaBoxesArea)); 16611 16612 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-box-visibility.js 16613 /** 16614 * WordPress dependencies 16615 */ 16616 16617 16618 /** 16619 * Internal dependencies 16620 */ 16621 16622 16623 16624 class meta_box_visibility_MetaBoxVisibility extends external_wp_element_["Component"] { 16625 componentDidMount() { 16626 this.updateDOM(); 16627 } 16628 16629 componentDidUpdate(prevProps) { 16630 if (this.props.isVisible !== prevProps.isVisible) { 16631 this.updateDOM(); 16632 } 16633 } 16634 16635 updateDOM() { 16636 const { 16637 id, 16638 isVisible 16639 } = this.props; 16640 const element = document.getElementById(id); 16641 16642 if (!element) { 16643 return; 16644 } 16645 16646 if (isVisible) { 16647 element.classList.remove('is-hidden'); 16648 } else { 16649 element.classList.add('is-hidden'); 16650 } 16651 } 16652 16653 render() { 16654 return null; 16655 } 16656 16657 } 16658 16659 /* harmony default export */ var meta_box_visibility = (Object(external_wp_data_["withSelect"])((select, { 16660 id 16661 }) => ({ 16662 isVisible: select(store["a" /* store */]).isEditorPanelEnabled(`meta-box-${id}`) 16663 }))(meta_box_visibility_MetaBoxVisibility)); 16664 16665 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/index.js 16666 16667 16668 /** 16669 * External dependencies 16670 */ 16671 16672 /** 16673 * WordPress dependencies 16674 */ 16675 16676 16677 16678 16679 /** 16680 * Internal dependencies 16681 */ 16682 16683 16684 16685 16686 function MetaBoxes({ 16687 location 16688 }) { 16689 const registry = Object(external_wp_data_["useRegistry"])(); 16690 const { 16691 metaBoxes, 16692 isVisible, 16693 areMetaBoxesInitialized, 16694 isEditorReady 16695 } = Object(external_wp_data_["useSelect"])(select => { 16696 const { 16697 __unstableIsEditorReady 16698 } = select(external_wp_editor_["store"]); 16699 const { 16700 isMetaBoxLocationVisible, 16701 getMetaBoxesPerLocation, 16702 areMetaBoxesInitialized: _areMetaBoxesInitialized 16703 } = select(store["a" /* store */]); 16704 return { 16705 metaBoxes: getMetaBoxesPerLocation(location), 16706 isVisible: isMetaBoxLocationVisible(location), 16707 areMetaBoxesInitialized: _areMetaBoxesInitialized(), 16708 isEditorReady: __unstableIsEditorReady() 16709 }; 16710 }, [location]); // When editor is ready, initialize postboxes (wp core script) and metabox 16711 // saving. This initializes all meta box locations, not just this specific 16712 // one. 16713 16714 Object(external_wp_element_["useEffect"])(() => { 16715 if (isEditorReady && !areMetaBoxesInitialized) { 16716 registry.dispatch(store["a" /* store */]).initializeMetaBoxes(); 16717 } 16718 }, [isEditorReady, areMetaBoxesInitialized]); 16719 16720 if (!areMetaBoxesInitialized) { 16721 return null; 16722 } 16723 16724 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_lodash_["map"])(metaBoxes, ({ 16725 id 16726 }) => Object(external_wp_element_["createElement"])(meta_box_visibility, { 16727 key: id, 16728 id: id 16729 })), isVisible && Object(external_wp_element_["createElement"])(meta_boxes_area, { 16730 location: location 16731 })); 16732 } 16733 16734 // EXTERNAL MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-document-setting-panel/index.js 16735 var plugin_document_setting_panel = __webpack_require__("xrib"); 16736 16737 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-sidebar/index.js 16738 16739 16740 16741 /** 16742 * WordPress dependencies 16743 */ 16744 16745 16746 16747 16748 /** 16749 * Internal dependencies 16750 */ 16751 16752 16753 /** 16754 * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar. 16755 * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`. 16756 * If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API: 16757 * 16758 * ```js 16759 * wp.data.dispatch( 'core/edit-post' ).openGeneralSidebar( 'plugin-name/sidebar-name' ); 16760 * ``` 16761 * 16762 * @see PluginSidebarMoreMenuItem 16763 * 16764 * @param {Object} props Element props. 16765 * @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin. 16766 * @param {string} [props.className] An optional class name added to the sidebar body. 16767 * @param {string} props.title Title displayed at the top of the sidebar. 16768 * @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item. 16769 * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar. 16770 * 16771 * @example 16772 * ```js 16773 * // Using ES5 syntax 16774 * var __ = wp.i18n.__; 16775 * var el = wp.element.createElement; 16776 * var PanelBody = wp.components.PanelBody; 16777 * var PluginSidebar = wp.editPost.PluginSidebar; 16778 * var moreIcon = wp.element.createElement( 'svg' ); //... svg element. 16779 * 16780 * function MyPluginSidebar() { 16781 * return el( 16782 * PluginSidebar, 16783 * { 16784 * name: 'my-sidebar', 16785 * title: 'My sidebar title', 16786 * icon: moreIcon, 16787 * }, 16788 * el( 16789 * PanelBody, 16790 * {}, 16791 * __( 'My sidebar content' ) 16792 * ) 16793 * ); 16794 * } 16795 * ``` 16796 * 16797 * @example 16798 * ```jsx 16799 * // Using ESNext syntax 16800 * import { __ } from '@wordpress/i18n'; 16801 * import { PanelBody } from '@wordpress/components'; 16802 * import { PluginSidebar } from '@wordpress/edit-post'; 16803 * import { more } from '@wordpress/icons'; 16804 * 16805 * const MyPluginSidebar = () => ( 16806 * <PluginSidebar 16807 * name="my-sidebar" 16808 * title="My sidebar title" 16809 * icon={ more } 16810 * > 16811 * <PanelBody> 16812 * { __( 'My sidebar content' ) } 16813 * </PanelBody> 16814 * </PluginSidebar> 16815 * ); 16816 * ``` 16817 */ 16818 16819 function PluginSidebarEditPost({ 16820 className, 16821 ...props 16822 }) { 16823 const { 16824 postTitle, 16825 shortcut, 16826 showIconLabels 16827 } = Object(external_wp_data_["useSelect"])(select => { 16828 return { 16829 postTitle: select('core/editor').getEditedPostAttribute('title'), 16830 shortcut: select(external_wp_keyboardShortcuts_["store"]).getShortcutRepresentation('core/edit-post/toggle-sidebar'), 16831 showIconLabels: select(store["a" /* store */]).isFeatureActive('showIconLabels') 16832 }; 16833 }); 16834 return Object(external_wp_element_["createElement"])(build_module["b" /* ComplementaryArea */], Object(esm_extends["a" /* default */])({ 16835 panelClassName: className, 16836 className: "edit-post-sidebar", 16837 smallScreenTitle: postTitle || Object(external_wp_i18n_["__"])('(no title)'), 16838 scope: "core/edit-post", 16839 toggleShortcut: shortcut, 16840 showIconLabels: showIconLabels 16841 }, props)); 16842 } 16843 16844 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/template/actions.js 16845 16846 16847 /** 16848 * External dependencies 16849 */ 16850 16851 /** 16852 * WordPress dependencies 16853 */ 16854 16855 16856 16857 16858 16859 16860 16861 /** 16862 * Internal dependencies 16863 */ 16864 16865 16866 16867 16868 function PostTemplateActions() { 16869 const [isModalOpen, setIsModalOpen] = Object(external_wp_element_["useState"])(false); 16870 const [title, setTitle] = Object(external_wp_element_["useState"])(''); 16871 const { 16872 template, 16873 supportsTemplateMode, 16874 defaultTemplate 16875 } = Object(external_wp_data_["useSelect"])(select => { 16876 var _getPostType$viewable, _getPostType; 16877 16878 const { 16879 getCurrentPostType, 16880 getEditorSettings 16881 } = select(external_wp_editor_["store"]); 16882 const { 16883 getPostType 16884 } = select(external_wp_coreData_["store"]); 16885 const { 16886 getEditedPostTemplate 16887 } = select(store["a" /* store */]); 16888 const isViewable = (_getPostType$viewable = (_getPostType = getPostType(getCurrentPostType())) === null || _getPostType === void 0 ? void 0 : _getPostType.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false; 16889 16890 const _supportsTemplateMode = getEditorSettings().supportsTemplateMode && isViewable; 16891 16892 return { 16893 template: _supportsTemplateMode && getEditedPostTemplate(), 16894 supportsTemplateMode: _supportsTemplateMode, 16895 defaultTemplate: getEditorSettings().defaultBlockTemplate 16896 }; 16897 }, []); 16898 const { 16899 __unstableSwitchToTemplateMode 16900 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 16901 16902 if (!supportsTemplateMode) { 16903 return null; 16904 } 16905 16906 const defaultTitle = Object(external_wp_i18n_["__"])('Custom Template'); 16907 16908 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("div", { 16909 className: "edit-post-template__actions" 16910 }, !!template && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 16911 isLink: true, 16912 onClick: () => __unstableSwitchToTemplateMode() 16913 }, Object(external_wp_i18n_["__"])('Edit')), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 16914 isLink: true, 16915 onClick: () => setIsModalOpen(true) 16916 }, Object(external_wp_i18n_["__"])('New'))), isModalOpen && Object(external_wp_element_["createElement"])(external_wp_components_["Modal"], { 16917 title: Object(external_wp_i18n_["__"])('Create custom template'), 16918 closeLabel: Object(external_wp_i18n_["__"])('Close'), 16919 onRequestClose: () => { 16920 setIsModalOpen(false); 16921 setTitle(''); 16922 }, 16923 overlayClassName: "edit-post-template__modal" 16924 }, Object(external_wp_element_["createElement"])("form", { 16925 onSubmit: event => { 16926 event.preventDefault(); 16927 const newTemplateContent = defaultTemplate !== null && defaultTemplate !== void 0 ? defaultTemplate : Object(external_wp_blocks_["serialize"])([Object(external_wp_blocks_["createBlock"])('core/group', { 16928 tagName: 'header', 16929 layout: { 16930 inherit: true 16931 } 16932 }, [Object(external_wp_blocks_["createBlock"])('core/site-title'), Object(external_wp_blocks_["createBlock"])('core/site-tagline')]), Object(external_wp_blocks_["createBlock"])('core/separator'), Object(external_wp_blocks_["createBlock"])('core/group', { 16933 tagName: 'main' 16934 }, [Object(external_wp_blocks_["createBlock"])('core/group', { 16935 layout: { 16936 inherit: true 16937 } 16938 }, [Object(external_wp_blocks_["createBlock"])('core/post-title')]), Object(external_wp_blocks_["createBlock"])('core/post-content', { 16939 layout: { 16940 inherit: true 16941 } 16942 })])]); 16943 16944 __unstableSwitchToTemplateMode({ 16945 slug: 'wp-custom-template-' + Object(external_lodash_["kebabCase"])(title || defaultTitle), 16946 content: newTemplateContent, 16947 title: title || defaultTitle 16948 }); 16949 16950 setIsModalOpen(false); 16951 } 16952 }, Object(external_wp_element_["createElement"])(external_wp_components_["Flex"], { 16953 align: "flex-start", 16954 gap: 8 16955 }, Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], { 16956 label: Object(external_wp_i18n_["__"])('Name'), 16957 value: title, 16958 onChange: setTitle, 16959 placeholder: defaultTitle, 16960 help: Object(external_wp_i18n_["__"])('Describe the purpose of the template, e.g. "Full Width". Custom templates can be applied to any post or page.') 16961 }))), Object(external_wp_element_["createElement"])(external_wp_components_["Flex"], { 16962 className: "edit-post-template__modal-actions", 16963 justify: "flex-end", 16964 expanded: false 16965 }, Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 16966 isTertiary: true, 16967 onClick: () => { 16968 setIsModalOpen(false); 16969 setTitle(''); 16970 } 16971 }, Object(external_wp_i18n_["__"])('Cancel'))), Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 16972 isPrimary: true, 16973 type: "submit" 16974 }, Object(external_wp_i18n_["__"])('Create'))))))); 16975 } 16976 16977 /* harmony default export */ var actions = (PostTemplateActions); 16978 16979 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/template/index.js 16980 16981 16982 /** 16983 * External dependencies 16984 */ 16985 16986 /** 16987 * WordPress dependencies 16988 */ 16989 16990 16991 16992 16993 16994 16995 16996 /** 16997 * Internal dependencies 16998 */ 16999 17000 17001 17002 /** 17003 * Module Constants 17004 */ 17005 17006 const template_PANEL_NAME = 'template'; 17007 function TemplatePanel() { 17008 const { 17009 isEnabled, 17010 isOpened, 17011 selectedTemplate, 17012 availableTemplates, 17013 fetchedTemplates, 17014 isViewable, 17015 template, 17016 supportsTemplateMode 17017 } = Object(external_wp_data_["useSelect"])(select => { 17018 var _getPostType$viewable, _getPostType; 17019 17020 const { 17021 isEditorPanelEnabled, 17022 isEditorPanelOpened, 17023 getEditedPostTemplate 17024 } = select(store["a" /* store */]); 17025 const { 17026 getEditedPostAttribute, 17027 getEditorSettings, 17028 getCurrentPostType 17029 } = select(external_wp_editor_["store"]); 17030 const { 17031 getPostType, 17032 getEntityRecords 17033 } = select(external_wp_coreData_["store"]); 17034 17035 const _isViewable = (_getPostType$viewable = (_getPostType = getPostType(getCurrentPostType())) === null || _getPostType === void 0 ? void 0 : _getPostType.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false; 17036 17037 const _supportsTemplateMode = select(external_wp_editor_["store"]).getEditorSettings().supportsTemplateMode && _isViewable; 17038 17039 const wpTemplates = getEntityRecords('postType', 'wp_template', { 17040 per_page: -1 17041 }); 17042 const newAvailableTemplates = Object(external_lodash_["fromPairs"])((wpTemplates || []).map(({ 17043 slug, 17044 title 17045 }) => [slug, title.rendered])); 17046 return { 17047 isEnabled: isEditorPanelEnabled(template_PANEL_NAME), 17048 isOpened: isEditorPanelOpened(template_PANEL_NAME), 17049 selectedTemplate: getEditedPostAttribute('template'), 17050 availableTemplates: getEditorSettings().availableTemplates, 17051 fetchedTemplates: newAvailableTemplates, 17052 template: _supportsTemplateMode && getEditedPostTemplate(), 17053 isViewable: _isViewable, 17054 supportsTemplateMode: _supportsTemplateMode 17055 }; 17056 }, []); 17057 const templates = Object(external_wp_element_["useMemo"])(() => { 17058 return { ...availableTemplates, 17059 ...fetchedTemplates 17060 }; 17061 }, [availableTemplates, fetchedTemplates]); 17062 const { 17063 toggleEditorPanelOpened 17064 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 17065 const { 17066 editPost 17067 } = Object(external_wp_data_["useDispatch"])(external_wp_editor_["store"]); 17068 17069 if (!isEnabled || !isViewable || Object(external_lodash_["isEmpty"])(availableTemplates) && !supportsTemplateMode) { 17070 return null; 17071 } 17072 17073 const onTogglePanel = Object(external_lodash_["partial"])(toggleEditorPanelOpened, template_PANEL_NAME); 17074 17075 let panelTitle = Object(external_wp_i18n_["__"])('Template'); 17076 17077 if (!!template) { 17078 var _template$title; 17079 17080 panelTitle = Object(external_wp_i18n_["sprintf"])( 17081 /* translators: %s: template title */ 17082 Object(external_wp_i18n_["__"])('Template: %s'), (_template$title = template === null || template === void 0 ? void 0 : template.title) !== null && _template$title !== void 0 ? _template$title : template.slug); 17083 } 17084 17085 return Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { 17086 title: panelTitle, 17087 opened: isOpened, 17088 onToggle: onTogglePanel 17089 }, Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], { 17090 hideLabelFromVision: true, 17091 label: Object(external_wp_i18n_["__"])('Template:'), 17092 value: Object.keys(templates).includes(selectedTemplate) ? selectedTemplate : '', 17093 onChange: templateSlug => { 17094 editPost({ 17095 template: templateSlug || '' 17096 }); 17097 }, 17098 options: Object(external_lodash_["map"])(templates, (templateName, templateSlug) => ({ 17099 value: templateSlug, 17100 label: templateName 17101 })) 17102 }), Object(external_wp_element_["createElement"])(actions, null)); 17103 } 17104 /* harmony default export */ var sidebar_template = (TemplatePanel); 17105 17106 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js 17107 var build_module_icon = __webpack_require__("iClF"); 17108 17109 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js 17110 var library_layout = __webpack_require__("Civd"); 17111 17112 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/template-summary/index.js 17113 17114 17115 /** 17116 * WordPress dependencies 17117 */ 17118 17119 17120 17121 /** 17122 * Internal dependencies 17123 */ 17124 17125 17126 17127 function TemplateSummary() { 17128 const template = Object(external_wp_data_["useSelect"])(select => { 17129 const { 17130 getEditedPostTemplate 17131 } = select(store["a" /* store */]); 17132 return getEditedPostTemplate(); 17133 }, []); 17134 17135 if (!template) { 17136 return null; 17137 } 17138 17139 return Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Flex"], { 17140 align: "flex-start" 17141 }, Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { 17142 icon: library_layout["a" /* default */] 17143 })), Object(external_wp_element_["createElement"])(external_wp_components_["FlexBlock"], null, Object(external_wp_element_["createElement"])("h2", { 17144 className: "edit-post-template-summary__title" 17145 }, (template === null || template === void 0 ? void 0 : template.title) || (template === null || template === void 0 ? void 0 : template.slug)), Object(external_wp_element_["createElement"])("p", null, template === null || template === void 0 ? void 0 : template.description)))); 17146 } 17147 17148 /* harmony default export */ var template_summary = (TemplateSummary); 17149 17150 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/settings-sidebar/index.js 17151 17152 17153 /** 17154 * WordPress dependencies 17155 */ 17156 17157 17158 17159 17160 17161 /** 17162 * Internal dependencies 17163 */ 17164 17165 17166 17167 17168 17169 17170 17171 17172 17173 17174 17175 17176 17177 17178 17179 17180 17181 17182 const SIDEBAR_ACTIVE_BY_DEFAULT = external_wp_element_["Platform"].select({ 17183 web: true, 17184 native: false 17185 }); 17186 17187 const SettingsSidebar = () => { 17188 const { 17189 sidebarName, 17190 keyboardShortcut, 17191 isTemplateMode 17192 } = Object(external_wp_data_["useSelect"])(select => { 17193 // The settings sidebar is used by the edit-post/document and edit-post/block sidebars. 17194 // sidebarName represents the sidebar that is active or that should be active when the SettingsSidebar toggle button is pressed. 17195 // If one of the two sidebars is active the component will contain the content of that sidebar. 17196 // When neither of the the two sidebars is active we can not simply return null, because the PluginSidebarEditPost 17197 // component, besides being used to render the sidebar, also renders the toggle button. In that case sidebarName 17198 // should contain the sidebar that will be active when the toggle button is pressed. If a block 17199 // is selected, that should be edit-post/block otherwise it's edit-post/document. 17200 let sidebar = select(build_module["g" /* store */]).getActiveComplementaryArea(store["a" /* store */].name); 17201 17202 if (!['edit-post/document', 'edit-post/block'].includes(sidebar)) { 17203 if (select(external_wp_blockEditor_["store"]).getBlockSelectionStart()) { 17204 sidebar = 'edit-post/block'; 17205 } 17206 17207 sidebar = 'edit-post/document'; 17208 } 17209 17210 const shortcut = select(external_wp_keyboardShortcuts_["store"]).getShortcutRepresentation('core/edit-post/toggle-sidebar'); 17211 return { 17212 sidebarName: sidebar, 17213 keyboardShortcut: shortcut, 17214 isTemplateMode: select(store["a" /* store */]).isEditingTemplate() 17215 }; 17216 }, []); 17217 return Object(external_wp_element_["createElement"])(PluginSidebarEditPost, { 17218 identifier: sidebarName, 17219 header: Object(external_wp_element_["createElement"])(settings_header, { 17220 sidebarName: sidebarName 17221 }), 17222 closeLabel: Object(external_wp_i18n_["__"])('Close settings'), 17223 headerClassName: "edit-post-sidebar__panel-tabs" 17224 /* translators: button label text should, if possible, be under 16 characters. */ 17225 , 17226 title: Object(external_wp_i18n_["__"])('Settings'), 17227 toggleShortcut: keyboardShortcut, 17228 icon: cog["a" /* default */], 17229 isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT 17230 }, !isTemplateMode && sidebarName === 'edit-post/document' && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(post_status, null), Object(external_wp_element_["createElement"])(sidebar_template, null), Object(external_wp_element_["createElement"])(plugin_document_setting_panel["a" /* default */].Slot, null), Object(external_wp_element_["createElement"])(last_revision, null), Object(external_wp_element_["createElement"])(post_link, null), Object(external_wp_element_["createElement"])(post_taxonomies, null), Object(external_wp_element_["createElement"])(featured_image, null), Object(external_wp_element_["createElement"])(post_excerpt, null), Object(external_wp_element_["createElement"])(discussion_panel, null), Object(external_wp_element_["createElement"])(page_attributes, null), Object(external_wp_element_["createElement"])(MetaBoxes, { 17231 location: "side" 17232 })), isTemplateMode && sidebarName === 'edit-post/document' && Object(external_wp_element_["createElement"])(template_summary, null), sidebarName === 'edit-post/block' && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockInspector"], null)); 17233 }; 17234 17235 /* harmony default export */ var settings_sidebar = (SettingsSidebar); 17236 17237 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/image.js 17238 17239 function WelcomeGuideImage({ 17240 nonAnimatedSrc, 17241 animatedSrc 17242 }) { 17243 return Object(external_wp_element_["createElement"])("picture", { 17244 className: "edit-post-welcome-guide__image" 17245 }, Object(external_wp_element_["createElement"])("source", { 17246 srcSet: nonAnimatedSrc, 17247 media: "(prefers-reduced-motion: reduce)" 17248 }), Object(external_wp_element_["createElement"])("img", { 17249 src: animatedSrc, 17250 width: "312", 17251 height: "240", 17252 alt: "" 17253 })); 17254 } 17255 17256 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/default.js 17257 17258 17259 /** 17260 * WordPress dependencies 17261 */ 17262 17263 17264 17265 17266 /** 17267 * Internal dependencies 17268 */ 17269 17270 17271 17272 function WelcomeGuideDefault() { 17273 const { 17274 toggleFeature 17275 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 17276 return Object(external_wp_element_["createElement"])(external_wp_components_["Guide"], { 17277 className: "edit-post-welcome-guide", 17278 contentLabel: Object(external_wp_i18n_["__"])('Welcome to the block editor'), 17279 finishButtonText: Object(external_wp_i18n_["__"])('Get started'), 17280 onFinish: () => toggleFeature('welcomeGuide'), 17281 pages: [{ 17282 image: Object(external_wp_element_["createElement"])(WelcomeGuideImage, { 17283 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg", 17284 animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif" 17285 }), 17286 content: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("h1", { 17287 className: "edit-post-welcome-guide__heading" 17288 }, Object(external_wp_i18n_["__"])('Welcome to the block editor')), Object(external_wp_element_["createElement"])("p", { 17289 className: "edit-post-welcome-guide__text" 17290 }, Object(external_wp_i18n_["__"])('In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.'))) 17291 }, { 17292 image: Object(external_wp_element_["createElement"])(WelcomeGuideImage, { 17293 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg", 17294 animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif" 17295 }), 17296 content: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("h1", { 17297 className: "edit-post-welcome-guide__heading" 17298 }, Object(external_wp_i18n_["__"])('Make each block your own')), Object(external_wp_element_["createElement"])("p", { 17299 className: "edit-post-welcome-guide__text" 17300 }, Object(external_wp_i18n_["__"])('Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.'))) 17301 }, { 17302 image: Object(external_wp_element_["createElement"])(WelcomeGuideImage, { 17303 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg", 17304 animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif" 17305 }), 17306 content: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("h1", { 17307 className: "edit-post-welcome-guide__heading" 17308 }, Object(external_wp_i18n_["__"])('Get to know the block library')), Object(external_wp_element_["createElement"])("p", { 17309 className: "edit-post-welcome-guide__text" 17310 }, Object(external_wp_element_["createInterpolateElement"])(Object(external_wp_i18n_["__"])('All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'), { 17311 InserterIconImage: Object(external_wp_element_["createElement"])("img", { 17312 alt: Object(external_wp_i18n_["__"])('inserter'), 17313 src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A" 17314 }) 17315 }))) 17316 }, { 17317 image: Object(external_wp_element_["createElement"])(WelcomeGuideImage, { 17318 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg", 17319 animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif" 17320 }), 17321 content: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("h1", { 17322 className: "edit-post-welcome-guide__heading" 17323 }, Object(external_wp_i18n_["__"])('Learn how to use the block editor')), Object(external_wp_element_["createElement"])("p", { 17324 className: "edit-post-welcome-guide__text" 17325 }, Object(external_wp_i18n_["__"])('New to the block editor? Want to learn more about using it? '), Object(external_wp_element_["createElement"])(external_wp_components_["ExternalLink"], { 17326 href: Object(external_wp_i18n_["__"])('https://wordpress.org/support/article/wordpress-editor/') 17327 }, Object(external_wp_i18n_["__"])("Here's a detailed guide.")))) 17328 }] 17329 }); 17330 } 17331 17332 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/template.js 17333 17334 17335 /** 17336 * WordPress dependencies 17337 */ 17338 17339 17340 17341 /** 17342 * Internal dependencies 17343 */ 17344 17345 17346 17347 function WelcomeGuideTemplate() { 17348 const { 17349 toggleFeature 17350 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 17351 return Object(external_wp_element_["createElement"])(external_wp_components_["Guide"], { 17352 className: "edit-post-welcome-guide", 17353 contentLabel: Object(external_wp_i18n_["__"])('Welcome to the template editor'), 17354 finishButtonText: Object(external_wp_i18n_["__"])('Get started'), 17355 onFinish: () => toggleFeature('welcomeGuideTemplate'), 17356 pages: [{ 17357 image: Object(external_wp_element_["createElement"])(WelcomeGuideImage, { 17358 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.svg", 17359 animatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.gif" 17360 }), 17361 content: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("h1", { 17362 className: "edit-post-welcome-guide__heading" 17363 }, Object(external_wp_i18n_["__"])('Welcome to the template editor')), Object(external_wp_element_["createElement"])("p", { 17364 className: "edit-post-welcome-guide__text" 17365 }, Object(external_wp_i18n_["__"])('Templates express the layout of the site. Customize all aspects of your posts and pages using the tools of blocks and patterns.'))) 17366 }] 17367 }); 17368 } 17369 17370 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/index.js 17371 17372 17373 /** 17374 * WordPress dependencies 17375 */ 17376 17377 /** 17378 * Internal dependencies 17379 */ 17380 17381 17382 17383 17384 function WelcomeGuide() { 17385 const { 17386 isActive, 17387 isTemplateMode 17388 } = Object(external_wp_data_["useSelect"])(select => { 17389 const { 17390 isFeatureActive, 17391 isEditingTemplate 17392 } = select(store["a" /* store */]); 17393 17394 const _isTemplateMode = isEditingTemplate(); 17395 17396 const feature = _isTemplateMode ? 'welcomeGuideTemplate' : 'welcomeGuide'; 17397 return { 17398 isActive: isFeatureActive(feature), 17399 isTemplateMode: _isTemplateMode 17400 }; 17401 }, []); 17402 17403 if (!isActive) { 17404 return null; 17405 } 17406 17407 return isTemplateMode ? Object(external_wp_element_["createElement"])(WelcomeGuideTemplate, null) : Object(external_wp_element_["createElement"])(WelcomeGuideDefault, null); 17408 } 17409 17410 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-post-publish-panel/index.js 17411 17412 17413 /** 17414 * WordPress dependencies 17415 */ 17416 17417 17418 17419 const { 17420 Fill: plugin_post_publish_panel_Fill, 17421 Slot: plugin_post_publish_panel_Slot 17422 } = Object(external_wp_components_["createSlotFill"])('PluginPostPublishPanel'); 17423 17424 const PluginPostPublishPanelFill = ({ 17425 children, 17426 className, 17427 title, 17428 initialOpen = false, 17429 icon 17430 }) => Object(external_wp_element_["createElement"])(plugin_post_publish_panel_Fill, null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { 17431 className: className, 17432 initialOpen: initialOpen || !title, 17433 title: title, 17434 icon: icon 17435 }, children)); 17436 /** 17437 * Renders provided content to the post-publish panel in the publish flow 17438 * (side panel that opens after a user publishes the post). 17439 * 17440 * @param {Object} props Component properties. 17441 * @param {string} [props.className] An optional class name added to the panel. 17442 * @param {string} [props.title] Title displayed at the top of the panel. 17443 * @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. When no title is provided it is always opened. 17444 * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar. 17445 * 17446 * @example 17447 * ```js 17448 * // Using ES5 syntax 17449 * var __ = wp.i18n.__; 17450 * var PluginPostPublishPanel = wp.editPost.PluginPostPublishPanel; 17451 * 17452 * function MyPluginPostPublishPanel() { 17453 * return wp.element.createElement( 17454 * PluginPostPublishPanel, 17455 * { 17456 * className: 'my-plugin-post-publish-panel', 17457 * title: __( 'My panel title' ), 17458 * initialOpen: true, 17459 * }, 17460 * __( 'My panel content' ) 17461 * ); 17462 * } 17463 * ``` 17464 * 17465 * @example 17466 * ```jsx 17467 * // Using ESNext syntax 17468 * import { __ } from '@wordpress/i18n'; 17469 * import { PluginPostPublishPanel } from '@wordpress/edit-post'; 17470 * 17471 * const MyPluginPostPublishPanel = () => ( 17472 * <PluginPostPublishPanel 17473 * className="my-plugin-post-publish-panel" 17474 * title={ __( 'My panel title' ) } 17475 * initialOpen={ true } 17476 * > 17477 * { __( 'My panel content' ) } 17478 * </PluginPostPublishPanel> 17479 * ); 17480 * ``` 17481 * 17482 * @return {WPComponent} The component to be rendered. 17483 */ 17484 17485 17486 const PluginPostPublishPanel = Object(external_wp_compose_["compose"])(Object(external_wp_plugins_["withPluginContext"])((context, ownProps) => { 17487 return { 17488 icon: ownProps.icon || context.icon 17489 }; 17490 }))(PluginPostPublishPanelFill); 17491 PluginPostPublishPanel.Slot = plugin_post_publish_panel_Slot; 17492 /* harmony default export */ var plugin_post_publish_panel = (PluginPostPublishPanel); 17493 17494 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-pre-publish-panel/index.js 17495 17496 17497 /** 17498 * WordPress dependencies 17499 */ 17500 17501 17502 17503 const { 17504 Fill: plugin_pre_publish_panel_Fill, 17505 Slot: plugin_pre_publish_panel_Slot 17506 } = Object(external_wp_components_["createSlotFill"])('PluginPrePublishPanel'); 17507 17508 const PluginPrePublishPanelFill = ({ 17509 children, 17510 className, 17511 title, 17512 initialOpen = false, 17513 icon 17514 }) => Object(external_wp_element_["createElement"])(plugin_pre_publish_panel_Fill, null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { 17515 className: className, 17516 initialOpen: initialOpen || !title, 17517 title: title, 17518 icon: icon 17519 }, children)); 17520 /** 17521 * Renders provided content to the pre-publish side panel in the publish flow 17522 * (side panel that opens when a user first pushes "Publish" from the main editor). 17523 * 17524 * @param {Object} props Component props. 17525 * @param {string} [props.className] An optional class name added to the panel. 17526 * @param {string} [props.title] Title displayed at the top of the panel. 17527 * @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. 17528 * When no title is provided it is always opened. 17529 * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) 17530 * icon slug string, or an SVG WP element, to be rendered when 17531 * the sidebar is pinned to toolbar. 17532 * 17533 * @example 17534 * ```js 17535 * // Using ES5 syntax 17536 * var __ = wp.i18n.__; 17537 * var PluginPrePublishPanel = wp.editPost.PluginPrePublishPanel; 17538 * 17539 * function MyPluginPrePublishPanel() { 17540 * return wp.element.createElement( 17541 * PluginPrePublishPanel, 17542 * { 17543 * className: 'my-plugin-pre-publish-panel', 17544 * title: __( 'My panel title' ), 17545 * initialOpen: true, 17546 * }, 17547 * __( 'My panel content' ) 17548 * ); 17549 * } 17550 * ``` 17551 * 17552 * @example 17553 * ```jsx 17554 * // Using ESNext syntax 17555 * import { __ } from '@wordpress/i18n'; 17556 * import { PluginPrePublishPanel } from '@wordpress/edit-post'; 17557 * 17558 * const MyPluginPrePublishPanel = () => ( 17559 * <PluginPrePublishPanel 17560 * className="my-plugin-pre-publish-panel" 17561 * title={ __( 'My panel title' ) } 17562 * initialOpen={ true } 17563 * > 17564 * { __( 'My panel content' ) } 17565 * </PluginPrePublishPanel> 17566 * ); 17567 * ``` 17568 * 17569 * @return {WPComponent} The component to be rendered. 17570 */ 17571 17572 17573 const PluginPrePublishPanel = Object(external_wp_compose_["compose"])(Object(external_wp_plugins_["withPluginContext"])((context, ownProps) => { 17574 return { 17575 icon: ownProps.icon || context.icon 17576 }; 17577 }))(PluginPrePublishPanelFill); 17578 PluginPrePublishPanel.Slot = plugin_pre_publish_panel_Slot; 17579 /* harmony default export */ var plugin_pre_publish_panel = (PluginPrePublishPanel); 17580 17581 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/layout/actions-panel.js 17582 17583 17584 /** 17585 * WordPress dependencies 17586 */ 17587 17588 17589 17590 17591 17592 /** 17593 * Internal dependencies 17594 */ 17595 17596 17597 17598 17599 const { 17600 Fill: actions_panel_Fill, 17601 Slot: actions_panel_Slot 17602 } = Object(external_wp_components_["createSlotFill"])('ActionsPanel'); 17603 const ActionsPanelFill = actions_panel_Fill; 17604 function ActionsPanel({ 17605 setEntitiesSavedStatesCallback, 17606 closeEntitiesSavedStates, 17607 isEntitiesSavedStatesOpen 17608 }) { 17609 const { 17610 closePublishSidebar, 17611 togglePublishSidebar 17612 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 17613 const { 17614 publishSidebarOpened, 17615 hasActiveMetaboxes, 17616 isSavingMetaBoxes, 17617 hasNonPostEntityChanges 17618 } = Object(external_wp_data_["useSelect"])(select => { 17619 return { 17620 publishSidebarOpened: select(store["a" /* store */]).isPublishSidebarOpened(), 17621 hasActiveMetaboxes: select(store["a" /* store */]).hasMetaBoxes(), 17622 isSavingMetaBoxes: select(store["a" /* store */]).isSavingMetaBoxes(), 17623 hasNonPostEntityChanges: select('core/editor').hasNonPostEntityChanges() 17624 }; 17625 }, []); 17626 const openEntitiesSavedStates = Object(external_wp_element_["useCallback"])(() => setEntitiesSavedStatesCallback(true), []); // It is ok for these components to be unmounted when not in visual use. 17627 // We don't want more than one present at a time, decide which to render. 17628 17629 let unmountableContent; 17630 17631 if (publishSidebarOpened) { 17632 unmountableContent = Object(external_wp_element_["createElement"])(external_wp_editor_["PostPublishPanel"], { 17633 onClose: closePublishSidebar, 17634 forceIsDirty: hasActiveMetaboxes, 17635 forceIsSaving: isSavingMetaBoxes, 17636 PrePublishExtension: plugin_pre_publish_panel.Slot, 17637 PostPublishExtension: plugin_post_publish_panel.Slot 17638 }); 17639 } else if (hasNonPostEntityChanges) { 17640 unmountableContent = Object(external_wp_element_["createElement"])("div", { 17641 className: "edit-post-layout__toggle-entities-saved-states-panel" 17642 }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 17643 isSecondary: true, 17644 className: "edit-post-layout__toggle-entities-saved-states-panel-button", 17645 onClick: openEntitiesSavedStates, 17646 "aria-expanded": false 17647 }, Object(external_wp_i18n_["__"])('Open save panel'))); 17648 } else { 17649 unmountableContent = Object(external_wp_element_["createElement"])("div", { 17650 className: "edit-post-layout__toggle-publish-panel" 17651 }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 17652 isSecondary: true, 17653 className: "edit-post-layout__toggle-publish-panel-button", 17654 onClick: togglePublishSidebar, 17655 "aria-expanded": false 17656 }, Object(external_wp_i18n_["__"])('Open publish panel'))); 17657 } // Since EntitiesSavedStates controls its own panel, we can keep it 17658 // always mounted to retain its own component state (such as checkboxes). 17659 17660 17661 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, isEntitiesSavedStatesOpen && Object(external_wp_element_["createElement"])(external_wp_editor_["EntitiesSavedStates"], { 17662 close: closeEntitiesSavedStates 17663 }), Object(external_wp_element_["createElement"])(actions_panel_Slot, { 17664 bubblesVirtually: true 17665 }), !isEntitiesSavedStatesOpen && unmountableContent); 17666 } 17667 17668 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/layout/index.js 17669 17670 17671 /** 17672 * External dependencies 17673 */ 17674 17675 /** 17676 * WordPress dependencies 17677 */ 17678 17679 17680 17681 17682 17683 17684 17685 17686 17687 17688 17689 /** 17690 * Internal dependencies 17691 */ 17692 17693 17694 17695 17696 17697 17698 17699 17700 17701 17702 17703 17704 17705 17706 17707 17708 const interfaceLabels = { 17709 secondarySidebar: Object(external_wp_i18n_["__"])('Block library'), 17710 17711 /* translators: accessibility text for the editor top bar landmark region. */ 17712 header: Object(external_wp_i18n_["__"])('Editor top bar'), 17713 17714 /* translators: accessibility text for the editor content landmark region. */ 17715 body: Object(external_wp_i18n_["__"])('Editor content'), 17716 17717 /* translators: accessibility text for the editor settings landmark region. */ 17718 sidebar: Object(external_wp_i18n_["__"])('Editor settings'), 17719 17720 /* translators: accessibility text for the editor publish landmark region. */ 17721 actions: Object(external_wp_i18n_["__"])('Editor publish'), 17722 17723 /* translators: accessibility text for the editor footer landmark region. */ 17724 footer: Object(external_wp_i18n_["__"])('Editor footer') 17725 }; 17726 17727 function Layout({ 17728 styles 17729 }) { 17730 const isMobileViewport = Object(external_wp_compose_["useViewportMatch"])('medium', '<'); 17731 const isHugeViewport = Object(external_wp_compose_["useViewportMatch"])('huge', '>='); 17732 const { 17733 openGeneralSidebar, 17734 closeGeneralSidebar, 17735 setIsInserterOpened 17736 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 17737 const { 17738 mode, 17739 isFullscreenActive, 17740 isRichEditingEnabled, 17741 sidebarIsOpened, 17742 hasActiveMetaboxes, 17743 hasFixedToolbar, 17744 previousShortcut, 17745 nextShortcut, 17746 hasBlockSelected, 17747 isInserterOpened, 17748 isListViewOpened, 17749 showIconLabels, 17750 hasReducedUI, 17751 showBlockBreadcrumbs, 17752 isTemplateMode 17753 } = Object(external_wp_data_["useSelect"])(select => { 17754 const editorSettings = select(external_wp_editor_["store"]).getEditorSettings(); 17755 return { 17756 isTemplateMode: select(store["a" /* store */]).isEditingTemplate(), 17757 hasFixedToolbar: select(store["a" /* store */]).isFeatureActive('fixedToolbar'), 17758 sidebarIsOpened: !!(select(build_module["g" /* store */]).getActiveComplementaryArea(store["a" /* store */].name) || select(store["a" /* store */]).isPublishSidebarOpened()), 17759 isFullscreenActive: select(store["a" /* store */]).isFeatureActive('fullscreenMode'), 17760 isInserterOpened: select(store["a" /* store */]).isInserterOpened(), 17761 isListViewOpened: select(store["a" /* store */]).isListViewOpened(), 17762 mode: select(store["a" /* store */]).getEditorMode(), 17763 isRichEditingEnabled: editorSettings.richEditingEnabled, 17764 hasActiveMetaboxes: select(store["a" /* store */]).hasMetaBoxes(), 17765 previousShortcut: select(external_wp_keyboardShortcuts_["store"]).getAllShortcutRawKeyCombinations('core/edit-post/previous-region'), 17766 nextShortcut: select(external_wp_keyboardShortcuts_["store"]).getAllShortcutRawKeyCombinations('core/edit-post/next-region'), 17767 showIconLabels: select(store["a" /* store */]).isFeatureActive('showIconLabels'), 17768 hasReducedUI: select(store["a" /* store */]).isFeatureActive('reducedUI'), 17769 showBlockBreadcrumbs: select(store["a" /* store */]).isFeatureActive('showBlockBreadcrumbs') 17770 }; 17771 }, []); 17772 const className = classnames_default()('edit-post-layout', 'is-mode-' + mode, { 17773 'is-sidebar-opened': sidebarIsOpened, 17774 'has-fixed-toolbar': hasFixedToolbar, 17775 'has-metaboxes': hasActiveMetaboxes, 17776 'show-icon-labels': showIconLabels 17777 }); 17778 17779 const openSidebarPanel = () => openGeneralSidebar(hasBlockSelected ? 'edit-post/block' : 'edit-post/document'); // Inserter and Sidebars are mutually exclusive 17780 17781 17782 Object(external_wp_element_["useEffect"])(() => { 17783 if (sidebarIsOpened && !isHugeViewport) { 17784 setIsInserterOpened(false); 17785 } 17786 }, [sidebarIsOpened, isHugeViewport]); 17787 Object(external_wp_element_["useEffect"])(() => { 17788 if (isInserterOpened && !isHugeViewport) { 17789 closeGeneralSidebar(); 17790 } 17791 }, [isInserterOpened, isHugeViewport]); // Local state for save panel. 17792 // Note 'truthy' callback implies an open panel. 17793 17794 const [entitiesSavedStatesCallback, setEntitiesSavedStatesCallback] = Object(external_wp_element_["useState"])(false); 17795 const closeEntitiesSavedStates = Object(external_wp_element_["useCallback"])(arg => { 17796 if (typeof entitiesSavedStatesCallback === 'function') { 17797 entitiesSavedStatesCallback(arg); 17798 } 17799 17800 setEntitiesSavedStatesCallback(false); 17801 }, [entitiesSavedStatesCallback]); 17802 17803 const secondarySidebar = () => { 17804 if (mode === 'visual' && isInserterOpened) { 17805 return Object(external_wp_element_["createElement"])(InserterSidebar, null); 17806 } 17807 17808 if (mode === 'visual' && isListViewOpened) { 17809 return Object(external_wp_element_["createElement"])(external_wp_data_["AsyncModeProvider"], { 17810 value: "true" 17811 }, Object(external_wp_element_["createElement"])(ListViewSidebar, null)); 17812 } 17813 17814 return null; 17815 }; 17816 17817 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(build_module["d" /* FullscreenMode */], { 17818 isActive: isFullscreenActive 17819 }), Object(external_wp_element_["createElement"])(browser_url, null), Object(external_wp_element_["createElement"])(external_wp_editor_["UnsavedChangesWarning"], null), Object(external_wp_element_["createElement"])(external_wp_editor_["AutosaveMonitor"], null), Object(external_wp_element_["createElement"])(external_wp_editor_["LocalAutosaveMonitor"], null), Object(external_wp_element_["createElement"])(keyboard_shortcuts, null), Object(external_wp_element_["createElement"])(external_wp_editor_["EditorKeyboardShortcutsRegister"], null), Object(external_wp_element_["createElement"])(settings_sidebar, null), Object(external_wp_element_["createElement"])(build_module["e" /* InterfaceSkeleton */], { 17820 className: className, 17821 labels: interfaceLabels, 17822 header: Object(external_wp_element_["createElement"])(header, { 17823 setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback 17824 }), 17825 secondarySidebar: secondarySidebar(), 17826 sidebar: (!isMobileViewport || sidebarIsOpened) && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, !isMobileViewport && !sidebarIsOpened && Object(external_wp_element_["createElement"])("div", { 17827 className: "edit-post-layout__toggle-sidebar-panel" 17828 }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { 17829 isSecondary: true, 17830 className: "edit-post-layout__toggle-sidebar-panel-button", 17831 onClick: openSidebarPanel, 17832 "aria-expanded": false 17833 }, hasBlockSelected ? Object(external_wp_i18n_["__"])('Open block settings') : Object(external_wp_i18n_["__"])('Open document settings'))), Object(external_wp_element_["createElement"])(build_module["b" /* ComplementaryArea */].Slot, { 17834 scope: "core/edit-post" 17835 })), 17836 notices: Object(external_wp_element_["createElement"])(external_wp_editor_["EditorSnackbars"], null), 17837 content: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["EditorNotices"], null), (mode === 'text' || !isRichEditingEnabled) && Object(external_wp_element_["createElement"])(text_editor, null), isRichEditingEnabled && mode === 'visual' && Object(external_wp_element_["createElement"])(VisualEditor, { 17838 styles: styles 17839 }), !isTemplateMode && Object(external_wp_element_["createElement"])("div", { 17840 className: "edit-post-layout__metaboxes" 17841 }, Object(external_wp_element_["createElement"])(MetaBoxes, { 17842 location: "normal" 17843 }), Object(external_wp_element_["createElement"])(MetaBoxes, { 17844 location: "advanced" 17845 })), isMobileViewport && sidebarIsOpened && Object(external_wp_element_["createElement"])(external_wp_components_["ScrollLock"], null)), 17846 footer: !hasReducedUI && showBlockBreadcrumbs && !isMobileViewport && isRichEditingEnabled && mode === 'visual' && Object(external_wp_element_["createElement"])("div", { 17847 className: "edit-post-layout__footer" 17848 }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockBreadcrumb"], null)), 17849 actions: Object(external_wp_element_["createElement"])(ActionsPanel, { 17850 closeEntitiesSavedStates: closeEntitiesSavedStates, 17851 isEntitiesSavedStatesOpen: entitiesSavedStatesCallback, 17852 setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback 17853 }), 17854 shortcuts: { 17855 previous: previousShortcut, 17856 next: nextShortcut 17857 } 17858 }), Object(external_wp_element_["createElement"])(manage_blocks_modal, null), Object(external_wp_element_["createElement"])(PreferencesModal, null), Object(external_wp_element_["createElement"])(keyboard_shortcut_help_modal, null), Object(external_wp_element_["createElement"])(WelcomeGuide, null), Object(external_wp_element_["createElement"])(external_wp_components_["Popover"].Slot, null), Object(external_wp_element_["createElement"])(external_wp_plugins_["PluginArea"], null)); 17859 } 17860 17861 /* harmony default export */ var components_layout = (Layout); 17862 17863 // EXTERNAL MODULE: ./node_modules/@wordpress/edit-post/build-module/store/constants.js 17864 var constants = __webpack_require__("0dt7"); 17865 17866 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/listener-hooks.js 17867 /** 17868 * WordPress dependencies 17869 */ 17870 17871 17872 /** 17873 * Internal dependencies 17874 */ 17875 17876 17877 /** 17878 * This listener hook monitors for block selection and triggers the appropriate 17879 * sidebar state. 17880 * 17881 * @param {number} postId The current post id. 17882 */ 17883 17884 const useBlockSelectionListener = postId => { 17885 const { 17886 hasBlockSelection, 17887 isEditorSidebarOpened 17888 } = Object(external_wp_data_["useSelect"])(select => ({ 17889 hasBlockSelection: !!select('core/block-editor').getBlockSelectionStart(), 17890 isEditorSidebarOpened: select(constants["a" /* STORE_NAME */]).isEditorSidebarOpened() 17891 }), [postId]); 17892 const { 17893 openGeneralSidebar 17894 } = Object(external_wp_data_["useDispatch"])(constants["a" /* STORE_NAME */]); 17895 Object(external_wp_element_["useEffect"])(() => { 17896 if (!isEditorSidebarOpened) { 17897 return; 17898 } 17899 17900 if (hasBlockSelection) { 17901 openGeneralSidebar('edit-post/block'); 17902 } else { 17903 openGeneralSidebar('edit-post/document'); 17904 } 17905 }, [hasBlockSelection, isEditorSidebarOpened]); 17906 }; 17907 /** 17908 * This listener hook monitors any change in permalink and updates the view 17909 * post link in the admin bar. 17910 * 17911 * @param {number} postId 17912 */ 17913 17914 const useUpdatePostLinkListener = postId => { 17915 const { 17916 newPermalink 17917 } = Object(external_wp_data_["useSelect"])(select => ({ 17918 newPermalink: select('core/editor').getCurrentPost().link 17919 }), [postId]); 17920 const nodeToUpdate = Object(external_wp_element_["useRef"])(); 17921 Object(external_wp_element_["useEffect"])(() => { 17922 nodeToUpdate.current = document.querySelector(constants["c" /* VIEW_AS_PREVIEW_LINK_SELECTOR */]) || document.querySelector(constants["b" /* VIEW_AS_LINK_SELECTOR */]); 17923 }, [postId]); 17924 Object(external_wp_element_["useEffect"])(() => { 17925 if (!newPermalink || !nodeToUpdate.current) { 17926 return; 17927 } 17928 17929 nodeToUpdate.current.setAttribute('href', newPermalink); 17930 }, [newPermalink]); 17931 }; 17932 17933 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/index.js 17934 /** 17935 * Internal dependencies 17936 */ 17937 17938 /** 17939 * Data component used for initializing the editor and re-initializes 17940 * when postId changes or on unmount. 17941 * 17942 * @param {number} postId The id of the post. 17943 * @return {null} This is a data component so does not render any ui. 17944 */ 17945 17946 function EditorInitialization({ 17947 postId 17948 }) { 17949 useBlockSelectionListener(postId); 17950 useUpdatePostLinkListener(postId); 17951 return null; 17952 } 17953 17954 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/editor.js 17955 17956 17957 17958 /** 17959 * External dependencies 17960 */ 17961 17962 /** 17963 * WordPress dependencies 17964 */ 17965 17966 17967 17968 17969 17970 17971 /** 17972 * Internal dependencies 17973 */ 17974 17975 17976 17977 17978 17979 17980 17981 function Editor({ 17982 postId, 17983 postType, 17984 settings, 17985 initialEdits, 17986 onError, 17987 ...props 17988 }) { 17989 const { 17990 hasFixedToolbar, 17991 focusMode, 17992 hasReducedUI, 17993 hasThemeStyles, 17994 post, 17995 preferredStyleVariations, 17996 hiddenBlockTypes, 17997 blockTypes, 17998 __experimentalLocalAutosaveInterval, 17999 keepCaretInsideBlock, 18000 isTemplateMode, 18001 template 18002 } = Object(external_wp_data_["useSelect"])(select => { 18003 var _getPostType$viewable, _getPostType; 18004 18005 const { 18006 isFeatureActive, 18007 getPreference, 18008 __experimentalGetPreviewDeviceType, 18009 isEditingTemplate, 18010 getEditedPostTemplate 18011 } = select(store["a" /* store */]); 18012 const { 18013 getEntityRecord, 18014 getPostType, 18015 getEntityRecords 18016 } = select('core'); 18017 const { 18018 getEditorSettings 18019 } = select('core/editor'); 18020 const { 18021 getBlockTypes 18022 } = select(external_wp_blocks_["store"]); 18023 const isTemplate = ['wp_template', 'wp_template_part'].includes(postType); // Ideally the initializeEditor function should be called using the ID of the REST endpoint. 18024 // to avoid the special case. 18025 18026 let postObject; 18027 18028 if (isTemplate) { 18029 const posts = getEntityRecords('postType', postType, { 18030 wp_id: postId 18031 }); 18032 postObject = posts === null || posts === void 0 ? void 0 : posts[0]; 18033 } else { 18034 postObject = getEntityRecord('postType', postType, postId); 18035 } 18036 18037 const supportsTemplateMode = getEditorSettings().supportsTemplateMode; 18038 const isViewable = (_getPostType$viewable = (_getPostType = getPostType(postType)) === null || _getPostType === void 0 ? void 0 : _getPostType.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false; 18039 return { 18040 hasFixedToolbar: isFeatureActive('fixedToolbar') || __experimentalGetPreviewDeviceType() !== 'Desktop', 18041 focusMode: isFeatureActive('focusMode'), 18042 hasReducedUI: isFeatureActive('reducedUI'), 18043 hasThemeStyles: isFeatureActive('themeStyles'), 18044 preferredStyleVariations: getPreference('preferredStyleVariations'), 18045 hiddenBlockTypes: getPreference('hiddenBlockTypes'), 18046 blockTypes: getBlockTypes(), 18047 __experimentalLocalAutosaveInterval: getPreference('localAutosaveInterval'), 18048 keepCaretInsideBlock: isFeatureActive('keepCaretInsideBlock'), 18049 isTemplateMode: isEditingTemplate(), 18050 template: supportsTemplateMode && isViewable ? getEditedPostTemplate() : null, 18051 post: postObject 18052 }; 18053 }); 18054 const { 18055 updatePreferredStyleVariations, 18056 setIsInserterOpened 18057 } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]); 18058 const editorSettings = Object(external_wp_element_["useMemo"])(() => { 18059 const result = { ...Object(external_lodash_["omit"])(settings, ['styles']), 18060 __experimentalPreferredStyleVariations: { 18061 value: preferredStyleVariations, 18062 onChange: updatePreferredStyleVariations 18063 }, 18064 hasFixedToolbar, 18065 focusMode, 18066 hasReducedUI, 18067 __experimentalLocalAutosaveInterval, 18068 // This is marked as experimental to give time for the quick inserter to mature. 18069 __experimentalSetIsInserterOpened: setIsInserterOpened, 18070 keepCaretInsideBlock 18071 }; // Omit hidden block types if exists and non-empty. 18072 18073 if (Object(external_lodash_["size"])(hiddenBlockTypes) > 0) { 18074 // Defer to passed setting for `allowedBlockTypes` if provided as 18075 // anything other than `true` (where `true` is equivalent to allow 18076 // all block types). 18077 const defaultAllowedBlockTypes = true === settings.allowedBlockTypes ? Object(external_lodash_["map"])(blockTypes, 'name') : settings.allowedBlockTypes || []; 18078 result.allowedBlockTypes = Object(external_lodash_["without"])(defaultAllowedBlockTypes, ...hiddenBlockTypes); 18079 } 18080 18081 return result; 18082 }, [settings, hasFixedToolbar, focusMode, hasReducedUI, hiddenBlockTypes, blockTypes, preferredStyleVariations, __experimentalLocalAutosaveInterval, setIsInserterOpened, updatePreferredStyleVariations, keepCaretInsideBlock]); 18083 const styles = Object(external_wp_element_["useMemo"])(() => { 18084 return hasThemeStyles ? settings.styles : []; 18085 }, [settings, hasThemeStyles]); 18086 18087 if (!post) { 18088 return null; 18089 } 18090 18091 return Object(external_wp_element_["createElement"])(external_wp_element_["StrictMode"], null, Object(external_wp_element_["createElement"])(edit_post_settings.Provider, { 18092 value: settings 18093 }, Object(external_wp_element_["createElement"])(external_wp_components_["SlotFillProvider"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["EditorProvider"], Object(esm_extends["a" /* default */])({ 18094 settings: editorSettings, 18095 post: post, 18096 initialEdits: initialEdits, 18097 useSubRegistry: false, 18098 __unstableTemplate: isTemplateMode ? template : undefined 18099 }, props), Object(external_wp_element_["createElement"])(external_wp_editor_["ErrorBoundary"], { 18100 onError: onError 18101 }, Object(external_wp_element_["createElement"])(EditorInitialization, { 18102 postId: postId 18103 }), Object(external_wp_element_["createElement"])(components_layout, { 18104 styles: styles 18105 }), Object(external_wp_element_["createElement"])(external_wp_components_["KeyboardShortcuts"], { 18106 shortcuts: prevent_event_discovery 18107 })), Object(external_wp_element_["createElement"])(external_wp_editor_["PostLockedModal"], null))))); 18108 } 18109 18110 /* harmony default export */ var editor = (Editor); 18111 18112 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js 18113 18114 18115 /** 18116 * External dependencies 18117 */ 18118 18119 /** 18120 * WordPress dependencies 18121 */ 18122 18123 18124 18125 18126 18127 const isEverySelectedBlockAllowed = (selected, allowed) => Object(external_lodash_["difference"])(selected, allowed).length === 0; 18128 /** 18129 * Plugins may want to add an item to the menu either for every block 18130 * or only for the specific ones provided in the `allowedBlocks` component property. 18131 * 18132 * If there are multiple blocks selected the item will be rendered if every block 18133 * is of one allowed type (not necessarily the same). 18134 * 18135 * @param {string[]} selectedBlocks Array containing the names of the blocks selected 18136 * @param {string[]} allowedBlocks Array containing the names of the blocks allowed 18137 * @return {boolean} Whether the item will be rendered or not. 18138 */ 18139 18140 18141 const shouldRenderItem = (selectedBlocks, allowedBlocks) => !Array.isArray(allowedBlocks) || isEverySelectedBlockAllowed(selectedBlocks, allowedBlocks); 18142 /** 18143 * Renders a new item in the block settings menu. 18144 * 18145 * @param {Object} props Component props. 18146 * @param {Array} [props.allowedBlocks] An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list. 18147 * @param {WPBlockTypeIconRender} [props.icon] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element. 18148 * @param {string} props.label The menu item text. 18149 * @param {Function} props.onClick Callback function to be executed when the user click the menu item. 18150 * @param {boolean} [props.small] Whether to render the label or not. 18151 * @param {string} [props.role] The ARIA role for the menu item. 18152 * 18153 * @example 18154 * ```js 18155 * // Using ES5 syntax 18156 * var __ = wp.i18n.__; 18157 * var PluginBlockSettingsMenuItem = wp.editPost.PluginBlockSettingsMenuItem; 18158 * 18159 * function doOnClick(){ 18160 * // To be called when the user clicks the menu item. 18161 * } 18162 * 18163 * function MyPluginBlockSettingsMenuItem() { 18164 * return wp.element.createElement( 18165 * PluginBlockSettingsMenuItem, 18166 * { 18167 * allowedBlocks: [ 'core/paragraph' ], 18168 * icon: 'dashicon-name', 18169 * label: __( 'Menu item text' ), 18170 * onClick: doOnClick, 18171 * } 18172 * ); 18173 * } 18174 * ``` 18175 * 18176 * @example 18177 * ```jsx 18178 * // Using ESNext syntax 18179 * import { __ } from '@wordpress/i18n'; 18180 * import { PluginBlockSettingsMenuItem } from '@wordpress/edit-post'; 18181 * 18182 * const doOnClick = ( ) => { 18183 * // To be called when the user clicks the menu item. 18184 * }; 18185 * 18186 * const MyPluginBlockSettingsMenuItem = () => ( 18187 * <PluginBlockSettingsMenuItem 18188 * allowedBlocks={ [ 'core/paragraph' ] } 18189 * icon='dashicon-name' 18190 * label={ __( 'Menu item text' ) } 18191 * onClick={ doOnClick } /> 18192 * ); 18193 * ``` 18194 * 18195 * @return {WPComponent} The component to be rendered. 18196 */ 18197 18198 18199 const PluginBlockSettingsMenuItem = ({ 18200 allowedBlocks, 18201 icon, 18202 label, 18203 onClick, 18204 small, 18205 role 18206 }) => Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockSettingsMenuControls"], null, ({ 18207 selectedBlocks, 18208 onClose 18209 }) => { 18210 if (!shouldRenderItem(selectedBlocks, allowedBlocks)) { 18211 return null; 18212 } 18213 18214 return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { 18215 onClick: Object(external_wp_compose_["compose"])(onClick, onClose), 18216 icon: icon, 18217 label: small ? label : undefined, 18218 role: role 18219 }, !small && label); 18220 }); 18221 18222 /* harmony default export */ var plugin_block_settings_menu_item = (PluginBlockSettingsMenuItem); 18223 18224 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/plugin-more-menu-item/index.js 18225 /** 18226 * WordPress dependencies 18227 */ 18228 18229 18230 18231 /** 18232 * Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to as a button or link depending on the props provided. 18233 * The text within the component appears as the menu item label. 18234 * 18235 * @param {Object} props Component properties. 18236 * @param {string} [props.href] When `href` is provided then the menu item is represented as an anchor rather than button. It corresponds to the `href` attribute of the anchor. 18237 * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label. 18238 * @param {Function} [props.onClick=noop] The callback function to be executed when the user clicks the menu item. 18239 * @param {...*} [props.other] Any additional props are passed through to the underlying [MenuItem](/packages/components/src/menu-item/README.md) component. 18240 * 18241 * @example 18242 * ```js 18243 * // Using ES5 syntax 18244 * var __ = wp.i18n.__; 18245 * var PluginMoreMenuItem = wp.editPost.PluginMoreMenuItem; 18246 * var moreIcon = wp.element.createElement( 'svg' ); //... svg element. 18247 * 18248 * function onButtonClick() { 18249 * alert( 'Button clicked.' ); 18250 * } 18251 * 18252 * function MyButtonMoreMenuItem() { 18253 * return wp.element.createElement( 18254 * PluginMoreMenuItem, 18255 * { 18256 * icon: moreIcon, 18257 * onClick: onButtonClick, 18258 * }, 18259 * __( 'My button title' ) 18260 * ); 18261 * } 18262 * ``` 18263 * 18264 * @example 18265 * ```jsx 18266 * // Using ESNext syntax 18267 * import { __ } from '@wordpress/i18n'; 18268 * import { PluginMoreMenuItem } from '@wordpress/edit-post'; 18269 * import { more } from '@wordpress/icons'; 18270 * 18271 * function onButtonClick() { 18272 * alert( 'Button clicked.' ); 18273 * } 18274 * 18275 * const MyButtonMoreMenuItem = () => ( 18276 * <PluginMoreMenuItem 18277 * icon={ more } 18278 * onClick={ onButtonClick } 18279 * > 18280 * { __( 'My button title' ) } 18281 * </PluginMoreMenuItem> 18282 * ); 18283 * ``` 18284 * 18285 * @return {WPComponent} The component to be rendered. 18286 */ 18287 18288 /* harmony default export */ var plugin_more_menu_item = (Object(external_wp_compose_["compose"])(Object(external_wp_plugins_["withPluginContext"])((context, ownProps) => { 18289 return { 18290 icon: ownProps.icon || context.icon, 18291 name: 'core/edit-post/plugin-more-menu' 18292 }; 18293 }))(build_module["a" /* ActionItem */])); 18294 18295 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/plugin-sidebar-more-menu-item/index.js 18296 18297 18298 18299 /** 18300 * WordPress dependencies 18301 */ 18302 18303 /** 18304 * Renders a menu item in `Plugins` group in `More Menu` drop down, 18305 * and can be used to activate the corresponding `PluginSidebar` component. 18306 * The text within the component appears as the menu item label. 18307 * 18308 * @param {Object} props Component props. 18309 * @param {string} props.target A string identifying the target sidebar you wish to be activated by this menu item. Must be the same as the `name` prop you have given to that sidebar. 18310 * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label. 18311 * 18312 * @example 18313 * ```js 18314 * // Using ES5 syntax 18315 * var __ = wp.i18n.__; 18316 * var PluginSidebarMoreMenuItem = wp.editPost.PluginSidebarMoreMenuItem; 18317 * var moreIcon = wp.element.createElement( 'svg' ); //... svg element. 18318 * 18319 * function MySidebarMoreMenuItem() { 18320 * return wp.element.createElement( 18321 * PluginSidebarMoreMenuItem, 18322 * { 18323 * target: 'my-sidebar', 18324 * icon: moreIcon, 18325 * }, 18326 * __( 'My sidebar title' ) 18327 * ) 18328 * } 18329 * ``` 18330 * 18331 * @example 18332 * ```jsx 18333 * // Using ESNext syntax 18334 * import { __ } from '@wordpress/i18n'; 18335 * import { PluginSidebarMoreMenuItem } from '@wordpress/edit-post'; 18336 * import { more } from '@wordpress/icons'; 18337 * 18338 * const MySidebarMoreMenuItem = () => ( 18339 * <PluginSidebarMoreMenuItem 18340 * target="my-sidebar" 18341 * icon={ more } 18342 * > 18343 * { __( 'My sidebar title' ) } 18344 * </PluginSidebarMoreMenuItem> 18345 * ); 18346 * ``` 18347 * 18348 * @return {WPComponent} The component to be rendered. 18349 */ 18350 18351 function PluginSidebarMoreMenuItem(props) { 18352 return Object(external_wp_element_["createElement"])(build_module["c" /* ComplementaryAreaMoreMenuItem */] // Menu item is marked with unstable prop for backward compatibility. 18353 // @see https://github.com/WordPress/gutenberg/issues/14457 18354 , Object(esm_extends["a" /* default */])({ 18355 __unstableExplicitMenuItem: true, 18356 scope: "core/edit-post" 18357 }, props)); 18358 } 18359 18360 // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/index.js 18361 18362 18363 /** 18364 * WordPress dependencies 18365 */ 18366 18367 18368 18369 18370 18371 /** 18372 * Internal dependencies 18373 */ 18374 18375 18376 18377 18378 /** 18379 * Reinitializes the editor after the user chooses to reboot the editor after 18380 * an unhandled error occurs, replacing previously mounted editor element using 18381 * an initial state from prior to the crash. 18382 * 18383 * @param {Object} postType Post type of the post to edit. 18384 * @param {Object} postId ID of the post to edit. 18385 * @param {Element} target DOM node in which editor is rendered. 18386 * @param {?Object} settings Editor settings object. 18387 * @param {Object} initialEdits Programmatic edits to apply initially, to be 18388 * considered as non-user-initiated (bypass for 18389 * unsaved changes prompt). 18390 */ 18391 18392 function reinitializeEditor(postType, postId, target, settings, initialEdits) { 18393 Object(external_wp_element_["unmountComponentAtNode"])(target); 18394 const reboot = reinitializeEditor.bind(null, postType, postId, target, settings, initialEdits); 18395 Object(external_wp_element_["render"])(Object(external_wp_element_["createElement"])(editor, { 18396 settings: settings, 18397 onError: reboot, 18398 postId: postId, 18399 postType: postType, 18400 initialEdits: initialEdits, 18401 recovery: true 18402 }), target); 18403 } 18404 /** 18405 * Initializes and returns an instance of Editor. 18406 * 18407 * @param {string} id Unique identifier for editor instance. 18408 * @param {string} postType Post type of the post to edit. 18409 * @param {Object} postId ID of the post to edit. 18410 * @param {?Object} settings Editor settings object. 18411 * @param {Object} initialEdits Programmatic edits to apply initially, to be 18412 * considered as non-user-initiated (bypass for 18413 * unsaved changes prompt). 18414 */ 18415 18416 function initializeEditor(id, postType, postId, settings, initialEdits) { 18417 const target = document.getElementById(id); 18418 const reboot = reinitializeEditor.bind(null, postType, postId, target, settings, initialEdits); 18419 Object(external_wp_blockLibrary_["registerCoreBlocks"])(); 18420 18421 if (false) {} // Show a console log warning if the browser is not in Standards rendering mode. 18422 18423 18424 const documentMode = document.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks'; 18425 18426 if (documentMode !== 'Standards') { 18427 // eslint-disable-next-line no-console 18428 console.warn("Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins."); 18429 } // This is a temporary fix for a couple of issues specific to Webkit on iOS. 18430 // Without this hack the browser scrolls the mobile toolbar off-screen. 18431 // Once supported in Safari we can replace this in favor of preventScroll. 18432 // For details see issue #18632 and PR #18686 18433 // Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar. 18434 // But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar. 18435 18436 18437 const isIphone = window.navigator.userAgent.indexOf('iPhone') !== -1; 18438 18439 if (isIphone) { 18440 window.addEventListener('scroll', event => { 18441 const editorScrollContainer = document.getElementsByClassName('interface-interface-skeleton__body')[0]; 18442 18443 if (event.target === document) { 18444 // Scroll element into view by scrolling the editor container by the same amount 18445 // that Mobile Safari tried to scroll the html element upwards. 18446 if (window.scrollY > 100) { 18447 editorScrollContainer.scrollTop = editorScrollContainer.scrollTop + window.scrollY; 18448 } // Undo unwanted scroll on html element, but only in the visual editor. 18449 18450 18451 if (document.getElementsByClassName('is-mode-visual')[0]) { 18452 window.scrollTo(0, 0); 18453 } 18454 } 18455 }); 18456 } 18457 18458 Object(external_wp_element_["render"])(Object(external_wp_element_["createElement"])(editor, { 18459 settings: settings, 18460 onError: reboot, 18461 postId: postId, 18462 postType: postType, 18463 initialEdits: initialEdits 18464 }), target); 18465 } 18466 18467 18468 18469 18470 18471 18472 18473 18474 18475 18476 18477 18478 18479 /***/ }), 18480 18481 /***/ "g56x": 18482 /***/ (function(module, exports) { 18483 18484 (function() { module.exports = window["wp"]["hooks"]; }()); 18485 18486 /***/ }), 18487 18488 /***/ "gdqT": 18489 /***/ (function(module, exports) { 18490 18491 (function() { module.exports = window["wp"]["a11y"]; }()); 18492 18493 /***/ }), 18494 18495 /***/ "hF7m": 18496 /***/ (function(module, exports) { 18497 18498 (function() { module.exports = window["wp"]["keyboardShortcuts"]; }()); 18499 18500 /***/ }), 18501 18502 /***/ "iClF": 18503 /***/ (function(module, __webpack_exports__, __webpack_require__) { 18504 18505 "use strict"; 18506 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 18507 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 18508 /** 18509 * WordPress dependencies 18510 */ 18511 18512 /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ 18513 18514 /** 18515 * Return an SVG icon. 18516 * 18517 * @param {IconProps} props icon is the SVG component to render 18518 * size is a number specifiying the icon size in pixels 18519 * Other props will be passed to wrapped SVG component 18520 * 18521 * @return {JSX.Element} Icon component 18522 */ 18523 18524 function Icon({ 18525 icon, 18526 size = 24, 18527 ...props 18528 }) { 18529 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["cloneElement"])(icon, { 18530 width: size, 18531 height: size, 18532 ...props 18533 }); 18534 } 18535 18536 /* harmony default export */ __webpack_exports__["a"] = (Icon); 18537 18538 18539 /***/ }), 18540 18541 /***/ "jSdM": 18542 /***/ (function(module, exports) { 18543 18544 (function() { module.exports = window["wp"]["editor"]; }()); 18545 18546 /***/ }), 18547 18548 /***/ "jZUy": 18549 /***/ (function(module, exports) { 18550 18551 (function() { module.exports = window["wp"]["coreData"]; }()); 18552 18553 /***/ }), 18554 18555 /***/ "l3Sj": 18556 /***/ (function(module, exports) { 18557 18558 (function() { module.exports = window["wp"]["i18n"]; }()); 18559 18560 /***/ }), 18561 18562 /***/ "onLe": 18563 /***/ (function(module, exports) { 18564 18565 (function() { module.exports = window["wp"]["notices"]; }()); 18566 18567 /***/ }), 18568 18569 /***/ "pPDe": 18570 /***/ (function(module, __webpack_exports__, __webpack_require__) { 18571 18572 "use strict"; 18573 18574 18575 var LEAF_KEY, hasWeakMap; 18576 18577 /** 18578 * Arbitrary value used as key for referencing cache object in WeakMap tree. 18579 * 18580 * @type {Object} 18581 */ 18582 LEAF_KEY = {}; 18583 18584 /** 18585 * Whether environment supports WeakMap. 18586 * 18587 * @type {boolean} 18588 */ 18589 hasWeakMap = typeof WeakMap !== 'undefined'; 18590 18591 /** 18592 * Returns the first argument as the sole entry in an array. 18593 * 18594 * @param {*} value Value to return. 18595 * 18596 * @return {Array} Value returned as entry in array. 18597 */ 18598 function arrayOf( value ) { 18599 return [ value ]; 18600 } 18601 18602 /** 18603 * Returns true if the value passed is object-like, or false otherwise. A value 18604 * is object-like if it can support property assignment, e.g. object or array. 18605 * 18606 * @param {*} value Value to test. 18607 * 18608 * @return {boolean} Whether value is object-like. 18609 */ 18610 function isObjectLike( value ) { 18611 return !! value && 'object' === typeof value; 18612 } 18613 18614 /** 18615 * Creates and returns a new cache object. 18616 * 18617 * @return {Object} Cache object. 18618 */ 18619 function createCache() { 18620 var cache = { 18621 clear: function() { 18622 cache.head = null; 18623 }, 18624 }; 18625 18626 return cache; 18627 } 18628 18629 /** 18630 * Returns true if entries within the two arrays are strictly equal by 18631 * reference from a starting index. 18632 * 18633 * @param {Array} a First array. 18634 * @param {Array} b Second array. 18635 * @param {number} fromIndex Index from which to start comparison. 18636 * 18637 * @return {boolean} Whether arrays are shallowly equal. 18638 */ 18639 function isShallowEqual( a, b, fromIndex ) { 18640 var i; 18641 18642 if ( a.length !== b.length ) { 18643 return false; 18644 } 18645 18646 for ( i = fromIndex; i < a.length; i++ ) { 18647 if ( a[ i ] !== b[ i ] ) { 18648 return false; 18649 } 18650 } 18651 18652 return true; 18653 } 18654 18655 /** 18656 * Returns a memoized selector function. The getDependants function argument is 18657 * called before the memoized selector and is expected to return an immutable 18658 * reference or array of references on which the selector depends for computing 18659 * its own return value. The memoize cache is preserved only as long as those 18660 * dependant references remain the same. If getDependants returns a different 18661 * reference(s), the cache is cleared and the selector value regenerated. 18662 * 18663 * @param {Function} selector Selector function. 18664 * @param {Function} getDependants Dependant getter returning an immutable 18665 * reference or array of reference used in 18666 * cache bust consideration. 18667 * 18668 * @return {Function} Memoized selector. 18669 */ 18670 /* harmony default export */ __webpack_exports__["a"] = (function( selector, getDependants ) { 18671 var rootCache, getCache; 18672 18673 // Use object source as dependant if getter not provided 18674 if ( ! getDependants ) { 18675 getDependants = arrayOf; 18676 } 18677 18678 /** 18679 * Returns the root cache. If WeakMap is supported, this is assigned to the 18680 * root WeakMap cache set, otherwise it is a shared instance of the default 18681 * cache object. 18682 * 18683 * @return {(WeakMap|Object)} Root cache object. 18684 */ 18685 function getRootCache() { 18686 return rootCache; 18687 } 18688 18689 /** 18690 * Returns the cache for a given dependants array. When possible, a WeakMap 18691 * will be used to create a unique cache for each set of dependants. This 18692 * is feasible due to the nature of WeakMap in allowing garbage collection 18693 * to occur on entries where the key object is no longer referenced. Since 18694 * WeakMap requires the key to be an object, this is only possible when the 18695 * dependant is object-like. The root cache is created as a hierarchy where 18696 * each top-level key is the first entry in a dependants set, the value a 18697 * WeakMap where each key is the next dependant, and so on. This continues 18698 * so long as the dependants are object-like. If no dependants are object- 18699 * like, then the cache is shared across all invocations. 18700 * 18701 * @see isObjectLike 18702 * 18703 * @param {Array} dependants Selector dependants. 18704 * 18705 * @return {Object} Cache object. 18706 */ 18707 function getWeakMapCache( dependants ) { 18708 var caches = rootCache, 18709 isUniqueByDependants = true, 18710 i, dependant, map, cache; 18711 18712 for ( i = 0; i < dependants.length; i++ ) { 18713 dependant = dependants[ i ]; 18714 18715 // Can only compose WeakMap from object-like key. 18716 if ( ! isObjectLike( dependant ) ) { 18717 isUniqueByDependants = false; 18718 break; 18719 } 18720 18721 // Does current segment of cache already have a WeakMap? 18722 if ( caches.has( dependant ) ) { 18723 // Traverse into nested WeakMap. 18724 caches = caches.get( dependant ); 18725 } else { 18726 // Create, set, and traverse into a new one. 18727 map = new WeakMap(); 18728 caches.set( dependant, map ); 18729 caches = map; 18730 } 18731 } 18732 18733 // We use an arbitrary (but consistent) object as key for the last item 18734 // in the WeakMap to serve as our running cache. 18735 if ( ! caches.has( LEAF_KEY ) ) { 18736 cache = createCache(); 18737 cache.isUniqueByDependants = isUniqueByDependants; 18738 caches.set( LEAF_KEY, cache ); 18739 } 18740 18741 return caches.get( LEAF_KEY ); 18742 } 18743 18744 // Assign cache handler by availability of WeakMap 18745 getCache = hasWeakMap ? getWeakMapCache : getRootCache; 18746 18747 /** 18748 * Resets root memoization cache. 18749 */ 18750 function clear() { 18751 rootCache = hasWeakMap ? new WeakMap() : createCache(); 18752 } 18753 18754 // eslint-disable-next-line jsdoc/check-param-names 18755 /** 18756 * The augmented selector call, considering first whether dependants have 18757 * changed before passing it to underlying memoize function. 18758 * 18759 * @param {Object} source Source object for derivation. 18760 * @param {...*} extraArgs Additional arguments to pass to selector. 18761 * 18762 * @return {*} Selector result. 18763 */ 18764 function callSelector( /* source, ...extraArgs */ ) { 18765 var len = arguments.length, 18766 cache, node, i, args, dependants; 18767 18768 // Create copy of arguments (avoid leaking deoptimization). 18769 args = new Array( len ); 18770 for ( i = 0; i < len; i++ ) { 18771 args[ i ] = arguments[ i ]; 18772 } 18773 18774 dependants = getDependants.apply( null, args ); 18775 cache = getCache( dependants ); 18776 18777 // If not guaranteed uniqueness by dependants (primitive type or lack 18778 // of WeakMap support), shallow compare against last dependants and, if 18779 // references have changed, destroy cache to recalculate result. 18780 if ( ! cache.isUniqueByDependants ) { 18781 if ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) { 18782 cache.clear(); 18783 } 18784 18785 cache.lastDependants = dependants; 18786 } 18787 18788 node = cache.head; 18789 while ( node ) { 18790 // Check whether node arguments match arguments 18791 if ( ! isShallowEqual( node.args, args, 1 ) ) { 18792 node = node.next; 18793 continue; 18794 } 18795 18796 // At this point we can assume we've found a match 18797 18798 // Surface matched node to head if not already 18799 if ( node !== cache.head ) { 18800 // Adjust siblings to point to each other. 18801 node.prev.next = node.next; 18802 if ( node.next ) { 18803 node.next.prev = node.prev; 18804 } 18805 18806 node.next = cache.head; 18807 node.prev = null; 18808 cache.head.prev = node; 18809 cache.head = node; 18810 } 18811 18812 // Return immediately 18813 return node.val; 18814 } 18815 18816 // No cached value found. Continue to insertion phase: 18817 18818 node = { 18819 // Generate the result from original function 18820 val: selector.apply( null, args ), 18821 }; 18822 18823 // Avoid including the source object in the cache. 18824 args[ 0 ] = null; 18825 node.args = args; 18826 18827 // Don't need to check whether node is already head, since it would 18828 // have been returned above already if it was 18829 18830 // Shift existing head down list 18831 if ( cache.head ) { 18832 cache.head.prev = node; 18833 node.next = cache.head; 18834 } 18835 18836 cache.head = node; 18837 18838 return node.val; 18839 } 18840 18841 callSelector.getDependants = getDependants; 18842 callSelector.clear = clear; 18843 clear(); 18844 18845 return callSelector; 18846 }); 18847 18848 18849 /***/ }), 18850 18851 /***/ "tI+e": 18852 /***/ (function(module, exports) { 18853 18854 (function() { module.exports = window["wp"]["components"]; }()); 18855 18856 /***/ }), 18857 18858 /***/ "w95h": 18859 /***/ (function(module, __webpack_exports__, __webpack_require__) { 18860 18861 "use strict"; 18862 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 18863 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 18864 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 18865 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 18866 18867 18868 /** 18869 * WordPress dependencies 18870 */ 18871 18872 const close = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 18873 xmlns: "http://www.w3.org/2000/svg", 18874 viewBox: "0 0 24 24" 18875 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 18876 d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z" 18877 })); 18878 /* harmony default export */ __webpack_exports__["a"] = (close); 18879 18880 18881 /***/ }), 18882 18883 /***/ "wduq": 18884 /***/ (function(module, __webpack_exports__, __webpack_require__) { 18885 18886 "use strict"; 18887 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 18888 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 18889 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); 18890 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 18891 18892 18893 /** 18894 * WordPress dependencies 18895 */ 18896 18897 const wordpress = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { 18898 xmlns: "http://www.w3.org/2000/svg", 18899 viewBox: "-2 -2 24 24" 18900 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { 18901 d: "M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z" 18902 })); 18903 /* harmony default export */ __webpack_exports__["a"] = (wordpress); 18904 18905 18906 /***/ }), 18907 18908 /***/ "wx14": 18909 /***/ (function(module, __webpack_exports__, __webpack_require__) { 18910 18911 "use strict"; 18912 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; }); 18913 function _extends() { 18914 _extends = Object.assign || function (target) { 18915 for (var i = 1; i < arguments.length; i++) { 18916 var source = arguments[i]; 18917 18918 for (var key in source) { 18919 if (Object.prototype.hasOwnProperty.call(source, key)) { 18920 target[key] = source[key]; 18921 } 18922 } 18923 } 18924 18925 return target; 18926 }; 18927 18928 return _extends.apply(this, arguments); 18929 } 18930 18931 /***/ }), 18932 18933 /***/ "xrib": 18934 /***/ (function(module, __webpack_exports__, __webpack_require__) { 18935 18936 "use strict"; 18937 /* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export Fill */ 18938 /* unused harmony export Slot */ 18939 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); 18940 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 18941 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("tI+e"); 18942 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); 18943 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("K9lf"); 18944 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__); 18945 /* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("TvNi"); 18946 /* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_3__); 18947 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("1ZqX"); 18948 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); 18949 /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("Z23Y"); 18950 /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_5__); 18951 /* harmony import */ var _preferences_modal_options__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("Y5n4"); 18952 /* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("T40v"); 18953 18954 18955 /** 18956 * Defines as extensibility slot for the Settings sidebar 18957 */ 18958 18959 /** 18960 * WordPress dependencies 18961 */ 18962 18963 18964 18965 18966 18967 /** 18968 * Internal dependencies 18969 */ 18970 18971 18972 18973 const { 18974 Fill, 18975 Slot 18976 } = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["createSlotFill"])('PluginDocumentSettingPanel'); 18977 18978 const PluginDocumentSettingFill = ({ 18979 isEnabled, 18980 panelName, 18981 opened, 18982 onToggle, 18983 className, 18984 title, 18985 icon, 18986 children 18987 }) => { 18988 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_preferences_modal_options__WEBPACK_IMPORTED_MODULE_6__[/* EnablePluginDocumentSettingPanelOption */ "d"], { 18989 label: title, 18990 panelName: panelName 18991 }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(Fill, null, isEnabled && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["PanelBody"], { 18992 className: className, 18993 title: title, 18994 icon: icon, 18995 opened: opened, 18996 onToggle: onToggle 18997 }, children))); 18998 }; 18999 /** 19000 * Renders items below the Status & Availability panel in the Document Sidebar. 19001 * 19002 * @param {Object} props Component properties. 19003 * @param {string} [props.name] The machine-friendly name for the panel. 19004 * @param {string} [props.className] An optional class name added to the row. 19005 * @param {string} [props.title] The title of the panel 19006 * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar. 19007 * 19008 * @example 19009 * ```js 19010 * // Using ES5 syntax 19011 * var el = wp.element.createElement; 19012 * var __ = wp.i18n.__; 19013 * var registerPlugin = wp.plugins.registerPlugin; 19014 * var PluginDocumentSettingPanel = wp.editPost.PluginDocumentSettingPanel; 19015 * 19016 * function MyDocumentSettingPlugin() { 19017 * return el( 19018 * PluginDocumentSettingPanel, 19019 * { 19020 * className: 'my-document-setting-plugin', 19021 * title: 'My Panel', 19022 * }, 19023 * __( 'My Document Setting Panel' ) 19024 * ); 19025 * } 19026 * 19027 * registerPlugin( 'my-document-setting-plugin', { 19028 * render: MyDocumentSettingPlugin 19029 * } ); 19030 * ``` 19031 * 19032 * @example 19033 * ```jsx 19034 * // Using ESNext syntax 19035 * import { registerPlugin } from '@wordpress/plugins'; 19036 * import { PluginDocumentSettingPanel } from '@wordpress/edit-post'; 19037 * 19038 * const MyDocumentSettingTest = () => ( 19039 * <PluginDocumentSettingPanel className="my-document-setting-plugin" title="My Panel"> 19040 * <p>My Document Setting Panel</p> 19041 * </PluginDocumentSettingPanel> 19042 * ); 19043 * 19044 * registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } ); 19045 * ``` 19046 * 19047 * @return {WPComponent} The component to be rendered. 19048 */ 19049 19050 19051 const PluginDocumentSettingPanel = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["compose"])(Object(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_3__["withPluginContext"])((context, ownProps) => { 19052 if (undefined === ownProps.name) { 19053 typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_5___default()('PluginDocumentSettingPanel requires a name property.') : void 0; 19054 } 19055 19056 return { 19057 icon: ownProps.icon || context.icon, 19058 panelName: `${context.name}/${ownProps.name}` 19059 }; 19060 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withSelect"])((select, { 19061 panelName 19062 }) => { 19063 return { 19064 opened: select(_store__WEBPACK_IMPORTED_MODULE_7__[/* store */ "a"]).isEditorPanelOpened(panelName), 19065 isEnabled: select(_store__WEBPACK_IMPORTED_MODULE_7__[/* store */ "a"]).isEditorPanelEnabled(panelName) 19066 }; 19067 }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withDispatch"])((dispatch, { 19068 panelName 19069 }) => ({ 19070 onToggle() { 19071 return dispatch(_store__WEBPACK_IMPORTED_MODULE_7__[/* store */ "a"]).toggleEditorPanelOpened(panelName); 19072 } 19073 19074 })))(PluginDocumentSettingFill); 19075 PluginDocumentSettingPanel.Slot = Slot; 19076 /* harmony default export */ __webpack_exports__["a"] = (PluginDocumentSettingPanel); 19077 19078 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB"))) 19079 19080 /***/ }) 19081 19082 /******/ });